Package mondrian.rolap.cache

Examples of mondrian.rolap.cache.SegmentCacheIndex


                if (!MondrianProperties.instance().DisableCaching.get()) {
                    final Locus locus = Locus.peek();
                    cacheMgr.execute(
                        new SegmentCacheManager.Command<Void>() {
                            public Void call() throws Exception {
                                SegmentCacheIndex index =
                                    cacheMgr.getIndexRegistry()
                                    .getIndex(segmentWithData.getStar());
                                index.add(
                                    segmentWithData.getHeader(),
                                    response.converterMap.get(
                                        SegmentCacheIndexImpl
                                            .makeConverterKey(
                                                segmentWithData.getHeader())),
                                    true);
                                index.loadSucceeded(
                                    segmentWithData.getHeader(), body);
                                return null;
                            }
                            public Locus getLocus() {
                                return locus;
View Full Code Here


            }
        }
        final RolapStar.Measure measure = request.getMeasure();
        final RolapStar star = measure.getStar();
        final RolapSchema schema = star.getSchema();
        final SegmentCacheIndex index =
            cacheMgr.getIndexRegistry().getIndex(star);
        final List<SegmentHeader> headersInCache =
            index.locate(
                schema.getName(),
                schema.getChecksum(),
                measure.getCubeName(),
                measure.getName(),
                star.getFactTable().getAlias(),
                request.getConstrainedColumnsBitKey(),
                mappedCellValues,
                compoundPredicates);

        // Ask for the first segment to be loaded from cache. (If it's no longer
        // in cache, we'll be back, and presumably we'll try the second
        // segment.)

        if (!headersInCache.isEmpty()) {
            for (SegmentHeader headerInCache : headersInCache) {
                final Future<SegmentBody> future =
                    index.getFuture(locus.execution, headerInCache);

                if (future != null) {
                    // Segment header is in cache, body is being loaded.
                    // Worker will need to wait for load to complete.
                    futures.put(headerInCache, future);
                } else {
                    // Segment is in cache.
                    cacheHeaders.add(headerInCache);
                }

                index.setConverter(
                    headerInCache.schemaName,
                    headerInCache.schemaChecksum,
                    headerInCache.cubeName,
                    headerInCache.rolapStarFactTableName,
                    headerInCache.measureName,
                    headerInCache.compoundPredicates,
                    converter);

                converterMap.put(
                    SegmentCacheIndexImpl.makeConverterKey(request, key),
                    converter);
            }
            return true;
        }

        // Try to roll up if the measure's rollup aggregator supports
        // "fast" aggregation from raw objects.
        //
        // Do not try to roll up if this request has already chosen a rollup
        // with the same target dimensionality. It is quite likely that the
        // other rollup will satisfy this request, and it's complicated to be
        // 100% sure. If we're wrong, we'll be back.

        // Also make sure that we don't try to rollup a measure which
        // doesn't support rollup from raw data, like a distinct count
        // for example. Both the measure's aggregator and its rollup
        // aggregator must support raw data aggregation. We call
        // Aggregator.supportsFastAggregates() to verify.
        if (MondrianProperties.instance()
                .EnableInMemoryRollup.get()
            && measure.getAggregator().supportsFastAggregates(
                measure.getDatatype())
            && measure.getAggregator().getRollup().supportsFastAggregates(
                measure.getDatatype())
            && !isRequestCoveredByRollups(request))
        {
            // Don't even bother doing a segment lookup if we can't
            // rollup that measure.
            final List<List<SegmentHeader>> rollup =
                index.findRollupCandidates(
                    schema.getName(),
                    schema.getChecksum(),
                    measure.getCubeName(),
                    measure.getName(),
                    star.getFactTable().getAlias(),
View Full Code Here

        List<Future<Map<Segment, SegmentWithData>>> segmentFutures)
    {
        if (!MondrianProperties.instance().DisableCaching.get()) {
            for (GroupingSet groupingSet : groupingSets) {
                for (Segment segment : groupingSet.getSegments()) {
                    final SegmentCacheIndex index =
                        cacheMgr.getIndexRegistry().getIndex(segment.star);
                    index.add(
                        segment.getHeader(),
                        new SegmentBuilder.StarSegmentConverter(
                            segment.measure,
                            compoundPredicateList),
                        true);
                    // Make sure that we are registered as a client of
                    // the segment by invoking getFuture.
                    Util.discard(
                        index.getFuture(
                            Locus.peek().execution,
                            segment.getHeader()));
                }
            }
        }
View Full Code Here

                            public Void call() throws Exception {
                                boolean atLeastOneActive = false;
                                for (Segment seg
                                    : groupingSetsList.getDefaultSegments())
                                {
                                    final SegmentCacheIndex index =
                                        cacheMgr.getIndexRegistry()
                                            .getIndex(seg.star);
                                    // Make sure to check if the segment still
                                    // exists in the index. It could have been
                                    // removed by a cancellation request since
                                    // then.
                                    if (index.contains(seg.getHeader())) {
                                        index.linkSqlStatement(
                                            seg.getHeader(), stmt);
                                        atLeastOneActive = true;
                                    }
                                    if (!atLeastOneActive) {
                                        // There are no segments to load.
View Full Code Here

TOP

Related Classes of mondrian.rolap.cache.SegmentCacheIndex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.