Package mondrian.rolap.agg

Examples of mondrian.rolap.agg.Aggregation$Axis


     * @param aggregationKey this is the contrained column bitkey
     */
    public Aggregation lookupOrCreateAggregation(
        AggregationKey aggregationKey)
    {
        Aggregation aggregation = lookupAggregation(aggregationKey);

        if (aggregation == null) {
            aggregation = new Aggregation(aggregationKey);

            this.localAggregations.get().put(aggregationKey, aggregation);

            // Let the change listener get the opportunity to register the
            // first time the aggregation is used
View Full Code Here


     *
     * <p>Must be called from synchronized context.
     */
    public Aggregation lookupAggregation(AggregationKey aggregationKey) {
        // First try thread local cache
        Aggregation aggregation = localAggregations.get().get(aggregationKey);
        if (aggregation != null) {
            return aggregation;
        }

        if (cacheAggregations && !RolapStar.disableCaching) {
View Full Code Here

                    for (Map.Entry<AggregationKey, Aggregation> e
                        : sharedAggregations.entrySet())
                    {
                        AggregationKey aggregationKey = e.getKey();

                        Aggregation aggregation = e.getValue();
                        if (changeListener.isAggregationChanged(aggregation)) {
                            // Create new thread local aggregation
                            // This thread will renew aggregations
                            // And these will be checked in if all queries
                            // that are currently using these aggregates
                            // are finished
                            aggregation = new Aggregation(aggregationKey);

                            localAggregations.get().put(
                                aggregationKey, aggregation);
                        }
                    }
View Full Code Here

                Iterator<Map.Entry<AggregationKey, Aggregation>>
                    it = pendingAggregations.entrySet().iterator();
                while (it.hasNext()) {
                    Map.Entry<AggregationKey, Aggregation> e = it.next();
                    AggregationKey aggregationKey = e.getKey();
                    Aggregation aggregation = e.getValue();
                    // In case this aggregation is not requested by anyone
                    // this aggregation may be pushed into global cache
                    // otherwise put it in pending cache, that will be pushed
                    // when another query finishes
                    if (!isAggregationRequested(aggregationKey)) {
                        pushAggregateModification(
                            aggregationKey, aggregation, sharedAggregations);
                        it.remove();
                    }
                }
                // Push thread local modifications
                it = localAggregations.get().entrySet().iterator();
                while (it.hasNext()) {
                    Map.Entry<AggregationKey, Aggregation> e = it.next();
                    AggregationKey aggregationKey = e.getKey();
                    Aggregation aggregation = e.getValue();
                    // In case this aggregation is not requested by anyone
                    // this aggregation may be pushed into global cache
                    // otherwise put it in pending cache, that will be pushed
                    // when another query finishes
                    Map<AggregationKey, Aggregation> targetMap;
View Full Code Here

                        it = destAggregations.entrySet().iterator();
                while (it.hasNext()) {
                    Map.Entry<AggregationKey, Aggregation> e =
                        it.next();
                    AggregationKey aggregationKey = e.getKey();
                    Aggregation aggregation = e.getValue();

                    if (localAggregationKey.equals(aggregationKey)) {
                        if (localAggregation.getCreationTimestamp().after(
                            aggregation.getCreationTimestamp()))
                        {
                            it.remove();
                        } else {
                            // Entry is newer, do not replace
                            found = true;
View Full Code Here

public class Scale9Test
{
    static float DELTA = (float)1e-7;

    @Test public void testAxis () {
        Axis axis = checkCoords(new Axis(1));
        assertEquals(1f/3, axis.size(0), DELTA);
        assertEquals(1-2f/3, axis.size(1), DELTA);
        assertEquals(1f/3, axis.size(2), DELTA);
    }
View Full Code Here

        assertEquals(1-2f/3, axis.size(1), DELTA);
        assertEquals(1f/3, axis.size(2), DELTA);
    }

    @Test public void testAxisResize () {
        Axis axis1 = checkCoords(new Axis(1).resize(0, .25f).resize(2, .25f));
        Axis axis2 = checkCoords(new Axis(1).resize(1, .5f));
        for (Axis axis : new Axis[] {axis1, axis2}) {
            assertEquals(.25f, axis.size(0), DELTA);
            assertEquals(.5f, axis.size(1), DELTA);
            assertEquals(.25f, axis.size(2), DELTA);
        }
View Full Code Here

            assertEquals(.25f, axis.size(2), DELTA);
        }
    }

    @Test public void testAxisDest () {
        Axis axis = checkCoords(new Axis(1, new Axis(1)));
        assertEquals(1f/3, axis.size(0), DELTA);
        assertEquals(1-2f/3, axis.size(1), DELTA);
        assertEquals(1f/3, axis.size(2), DELTA);

        axis = checkCoords(new Axis(2, new Axis(1)));
        assertEquals(1f/3, axis.size(0), DELTA);
        assertEquals(2-2f/3, axis.size(1), DELTA);
        assertEquals(1f/3, axis.size(2), DELTA);

        axis = checkCoords(new Axis(.5f, new Axis(1)));
        assertEquals(1f/3, axis.size(0), DELTA);
        assertEquals(.5-2f/3, axis.size(1), DELTA);
        assertEquals(1f/3, axis.size(2), DELTA);
    }
View Full Code Here

        assertEquals(.5-2f/3, axis.size(1), DELTA);
        assertEquals(1f/3, axis.size(2), DELTA);
    }

    @Test public void testAxisClamp () {
        Axis axis = checkCoords(Scale9.clamp(new Axis(1), 1));
        assertEquals(1f/3, axis.size(0), DELTA);
        assertEquals(1-2f/3, axis.size(1), DELTA);
        assertEquals(1f/3, axis.size(2), DELTA);

        axis = checkCoords(Scale9.clamp(new Axis(2).resize(1, 1.5f), 1));
        assertEquals(.25f, axis.size(0), DELTA);
        assertEquals(.5f, axis.size(1), DELTA);
        assertEquals(.25f, axis.size(2), DELTA);

        axis = checkCoords(Scale9.clamp(new Axis(1), .5f));
        assertEquals(.25f, axis.size(0), DELTA);
        assertEquals(0, axis.size(1), DELTA);
        assertEquals(.25f, axis.size(2), DELTA);
    }
View Full Code Here

TOP

Related Classes of mondrian.rolap.agg.Aggregation$Axis

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.