Saturday, March 26, 2016

Cube and Cube Status

 An intelligent cube is made up of two files - an info file (contains the structure of the cube) and a data file. Each one of them has a representation in memory and indicates different things:
1.    When the data file is not updated with its representation from memory, the cube’s "dirty status flag" is set to true.
2.    When the info file is different from its representation in memory, then the cube’s "monitoring information dirty status flag" is set to true.
While (1) indicates that the data of the cube is incorrect (2) indicates that the cube's monitoring information is different on disk than it is in memory.


When a cube is saved to disk, there are two portions saved to separate files – a) The cube data itself  and b) The cube info, which includes all the monitoring information.

The cube manager also holds these two portions separately in memory when the cube is loaded.  The Info portion is never swapped out; it is small relative to the size of the cube data and allows the cube manager to provide monitoring information to the user even when the cube data is unloaded. This monitoring information can become “dirty”, meaning the version in memory is more recent than the version on disk, even if the cube data is not.  This is why we have separate flags for Data Dirty and Monitoring Information Dirty. 

‘M’ status is used to abbreviate the concept of “Monitoring Information Dirty” while ‘D’ is used to abbreviate the concept of “Data Dirty
When any cube monitoring information is changed, the M flag is turned on. Following discusses a few scenarios when cube monitoring information will be changed:
1.    When the cube is deactivated, its status changes in memory; any Info portion that had been saved to disk is now out of date. When the cube is re-Loaded, the Data portion is loaded into memory; the Info portion is not loaded from disk, since the most up to date copy is always in memory. When both Data and Info are saved to disk the Data Dirty and Monitoring Information Dirty flags are cleared.

Note: The exact change in the cube status is not important. The M flag is set when any of the monitoring information is changed (any change to the cube is detected). The M flag is unset when the monitoring information is backed up to disk.
2.    When a subset report is hit, the “History hit count” of the Intelligent Cube changes. At this time the monitoring information will need to be backed up, hence the M flag will be turned on.

The following section discusses an example of the workflow and status change for MicroStrategy 9.x Intelligent Cube:
Index:
P = Processing
A = Active
L = Loaded
D = Dirty
F = Filed
M = Monitoring Information Dirty
1.    When a user executes an Intelligent Cube, the initial status is P.



2.    After execution completes, the cube is published but it only exists in memory. Since the cube is not persisted to disk yet, D and M are used to signal that this cube needs to be written to disk. Hence the status changes from P -> ADML.



3.    Depending on the backup frequency( 2 in this example), the cube is then saved to disk. Now the status changes from ADML -> ALF.



4.    The user then unloads the Intelligent Cube from memory. This action unloads the data section of the cube instance. The status changes from ALF -> AF. If the M flag is on, it will write the monitoring information to disk. If the D flag is on, it will write the data information to disk. The dirty flags (data and info) will then be reset.



5.    After unloading, the user deactivates the Intelligent Cube. The status changes from AF -> MF



6.    The user now wishes to activate the cube again. The status changes from MF -> AMF.



Note: In MicroStrategy 9.0.0, if Dynamic Sourcing is enabled, the cube is automatically loaded in memory when it is activated. The cube status in the cube monitor changes from MF -> AMLF instead of just AMF.
In MicroStrategy 9.0.1, if Dynamic Sourcing is enabled, the cube is only partially loaded in memory as a result of some optimizations. And this status is not reflected in the cube monitor. So the user continues to see AMF instead of AMLF in MicroStrategy 9.0.1.
Dynamic Sourcing can be enabled by going to Project Configuration ->Intelligent Cubes ->General ->Enable Dynamic Sourcing.
7.    Once activated, the user loads the cube in memory. This action loads the cube data section to memory and the status changes from AMF -> AMLF (back to Step 3).



8.    The user then updates the cube. This action re-executes the cube against the warehouse and the status is reset back

to what it was in Step 2 - ADML, no matter what the previous cube status indicates. 


No comments:

Post a Comment