Segment states
State | Meaning |
---|---|
Local | Initial state of a segment |
1. Create variant of actor that processes all requests synchronously, and does not need a thread. This would be a more 'embedded' mode of operation (albeit with worse scale-out).
2. Move functionality into AggregationManager?
3. Delete {@link mondrian.rolap.RolapStar#lookupOrCreateAggregation}and {@link mondrian.rolap.RolapStar#lookupSegment}and {@link mondrian.rolap.RolapStar}.lookupAggregationShared (formerly RolapStar.lookupAggregation).
(Keeping track of where methods came from will make it easier to merge to the mondrian-4 code line.)
1. {@link mondrian.rolap.RolapStar#getCellFromCache} moved from{@link Aggregation}.getCellValue
1. Obsolete CountingAggregationManager, and property mondrian.rolap.agg.enableCacheHitCounters.
2. AggregationManager becomes non-singleton.
3. SegmentCacheWorker methods and segmentCache field become non-static. initCache() is called on construction. SegmentCache is passed into constructor (therefore move ServiceDiscovery into client). AggregationManager (or maybe MondrianServer) is another constructor parameter.
5. Move SegmentHeader, SegmentBody, ConstrainedColumn into mondrian.spi. Leave behind dependencies on mondrian.rolap.agg. In particular, put code that converts Segment + SegmentWithData to and from SegmentHeader + SegmentBody (e.g. {@link SegmentHeader}#forSegment) into a utility class. (Do this as CLEANUP, after functionality is complete?)
6. Move functionality Aggregation to Segment. Long-term, Aggregation should not be used as a 'gatekeeper' to Segment. Remove Aggregation fields columns and axes.
9. Obsolete {@link RolapStar#cacheAggregations}. Similar effect will be achieved by removing the 'jvm cache' from the chain of caches.
10. Rename Aggregation.Axis to SegmentAxis.
11. Remove Segment.setData and instead split out subclass SegmentWithData. Now segment is immutable. You don't have to wait for its state to change. You wait for a Future<SegmentWithData> to become ready.
12. Remove methods: RolapCube.checkAggregateModifications, RolapStar.checkAggregateModifications, RolapSchema.checkAggregateModifications, RolapStar.pushAggregateModificationsToGlobalCache, RolapSchema.pushAggregateModificationsToGlobalCache, RolapCube.pushAggregateModificationsToGlobalCache.
13. Add new implementations of Future: CompletedFuture and SlotFuture.
14. Remove methods:
13. Fix flush. Obsolete {@link Aggregation}.flush, and {@link RolapStar}.flush, which called it.
18. {@code SegmentCacheManager#locateHeaderBody} (and maybe othermethods) call {@link SegmentCacheWorker#get}, and that's a slow blocking call. Make waits for segment futures should be called from a worker or client, not an agent.
7. RolapStar.localAggregations and .sharedAggregations. Obsolete sharedAggregations.
8. Longer term. Move {@link mondrian.rolap.RolapStar.Bar}.segmentRefs to {@link mondrian.server.Execution}. Would it still be thread-local?
10. Call {@link mondrian.spi.DataSourceChangeListener#isAggregationChanged}. Previously called from {@link RolapStar}.checkAggregateModifications, now never called.
12. We can quickly identify segments affected by a flush using {@link SegmentCacheIndex#intersectRegion}. But then what? Options:
14. Move {@link AggregationManager#getCellFromCache} somewhere else.It's concerned with local segments, not the global/external cache.
15. Method to convert SegmentHeader + SegmentBody to Segment + SegmentWithData is imperfect. Cannot parse predicates, compound predicates. Need mapping in star to do it properly and efficiently? {@link mondrian.rolap.agg.SegmentBuilder.SegmentConverter} is a hack thatcan be removed when this is fixed. See {@link SegmentBuilder#toSegment}. Also see #20.
17. Revisit the strategy for finding segments that can be copied from global and external cache into local cache. The strategy of sending N {@link CellRequest}s at a time, then executing SQL to fill in the gaps, is flawed. We need to maximize N in order to reduce segment fragmentation, but if too high, we blow memory. BasicQueryTest.testAnalysis is an example of this. Instead, we should send cell-requests in batches (is ~1000 the right size?), identify those that can be answered from global or external cache, return those segments, but not execute SQL until the end of the phase. If so, {@link CellRequestQuantumExceededException} be obsoleted.
19. Tracing. a. Remove or re-purpose {@link FastBatchingCellReader#pendingCount}; b. Add counter to measure requests satisfied by calling {@link mondrian.rolap.agg.SegmentCacheManager#peek}.
20. Obsolete {@link SegmentDataset} and its implementing classes.{@link SegmentWithData} can use {@link SegmentBody} instead. Will savecopying.
21. Obsolete {@link mondrian.util.CombiningGenerator}.
22. {@link SegmentHeader#constrain(mondrian.spi.SegmentColumn[])} isbroken for N-dimensional regions where N > 1. Each call currently creates N more 1-dimensional regions, but should create 1 more N-dimensional region. {@link SegmentHeader#excludedRegions} should be a list of{@link SegmentColumn} arrays.
23. All code that calls {@link Future#get} should probably handle{@link CancellationException}.
24. Obsolete {@link #handler}. Indirection doesn't win anything.
@author jhyde
|
|
|
|