Search in sources :

Example 1 with SegmentCacheManager

use of mondrian.rolap.agg.SegmentCacheManager in project mondrian by pentaho.

the class RolapSchemaTest method createSchema.

private RolapSchema createSchema() {
    SchemaKey key = new SchemaKey(mock(SchemaContentKey.class), mock(ConnectionKey.class));
    ByteString md5 = new ByteString("test schema".getBytes());
    // noinspection deprecation
    // mock rolap connection to eliminate calls for cache loading
    MondrianServer mServerMock = mock(MondrianServer.class);
    RolapConnection rolapConnectionMock = mock(RolapConnection.class);
    AggregationManager aggManagerMock = mock(AggregationManager.class);
    SegmentCacheManager scManagerMock = mock(SegmentCacheManager.class);
    when(rolapConnectionMock.getServer()).thenReturn(mServerMock);
    when(mServerMock.getAggregationManager()).thenReturn(aggManagerMock);
    when(aggManagerMock.getCacheMgr()).thenReturn(scManagerMock);
    return new RolapSchema(key, md5, rolapConnectionMock);
}
Also used : SegmentCacheManager(mondrian.rolap.agg.SegmentCacheManager) AggregationManager(mondrian.rolap.agg.AggregationManager) ByteString(mondrian.util.ByteString)

Example 2 with SegmentCacheManager

use of mondrian.rolap.agg.SegmentCacheManager in project mondrian by pentaho.

the class CacheControlImpl method printCacheState.

public void printCacheState(final PrintWriter pw, final CellRegion region) {
    final List<RolapStar> starList = getStarList(region);
    for (RolapStar star : starList) {
        star.print(pw, "", false);
    }
    final SegmentCacheManager manager = MondrianServer.forConnection(connection).getAggregationManager().cacheMgr;
    Locus.execute(connection, "CacheControlImpl.printCacheState", new Locus.Action<Void>() {

        public Void execute() {
            manager.printCacheState(region, pw, Locus.peek());
            return null;
        }
    });
}
Also used : SegmentCacheManager(mondrian.rolap.agg.SegmentCacheManager) Locus(mondrian.server.Locus)

Example 3 with SegmentCacheManager

use of mondrian.rolap.agg.SegmentCacheManager in project mondrian by pentaho.

the class Execution method unregisterSegmentRequests.

/**
 * Calls into the SegmentCacheManager and unregisters all the registrations made for this execution on segments form
 * the index.
 */
public void unregisterSegmentRequests() {
    // We also have to cancel all requests for the current segments.
    final Locus locus = new Locus(this, "Execution.unregisterSegmentRequests", "cleaning up segment registrations");
    final SegmentCacheManager mgr = locus.getServer().getAggregationManager().cacheMgr;
    mgr.execute(new SegmentCacheManager.Command<Void>() {

        public Void call() throws Exception {
            mgr.getIndexRegistry().cancelExecutionSegments(Execution.this);
            return null;
        }

        public Locus getLocus() {
            return locus;
        }
    });
}
Also used : SegmentCacheManager(mondrian.rolap.agg.SegmentCacheManager)

Aggregations

SegmentCacheManager (mondrian.rolap.agg.SegmentCacheManager)3 AggregationManager (mondrian.rolap.agg.AggregationManager)1 Locus (mondrian.server.Locus)1 ByteString (mondrian.util.ByteString)1