Package com.rackspacecloud.blueflood.types

Examples of com.rackspacecloud.blueflood.types.SetRollup


                    sz += sizeOf(basicRollup.getMaxValue(), Type.B_ROLLUP_STAT);
                }
                break;
            case Type.B_SET:
                sz += 1; // version
                SetRollup setRollup = (SetRollup)o;
                sz += CodedOutputStream.computeRawVarint32Size(setRollup.getCount());
                for (Integer i : setRollup.getHashes()) {
                    sz += CodedOutputStream.computeRawVarint32Size(i);
                }
                break;
            case Type.B_ROLLUP_STAT:
                sz = 1 + 1; // type + isFP.
View Full Code Here


        }
    }
   
    private static SetRollup deserializeV1SetRollup(CodedInputStream in) throws IOException {
        int count = in.readRawVarint32();
        SetRollup rollup = new SetRollup();
        while (count-- > 0) {
            rollup = rollup.withObject(in.readRawVarint32());
        }
        return rollup;
    }
View Full Code Here

    private static Collection<PreaggregatedMetric> remarshalSets(Bundle bundle, String tenantId) {
        final Collection<Set> sets = bundle.getSets();
        final List<PreaggregatedMetric> metrics = new ArrayList<PreaggregatedMetric>(sets.size());
        for (Set s : sets) {
            Locator locator = Locator.createLocatorFromPathComponents(tenantId == null ? s.getTenant() : tenantId, splitForLocator(s.getName()));
            SetRollup rollup = new SetRollup();
            for (String value : s.getValues()) {
                rollup = rollup.withObject(value);
            }
            PreaggregatedMetric metric = new PreaggregatedMetric(bundle.getCollectionTime(), locator, DEFAULT_PREAG_TTL, rollup);
            metrics.add(metric);
        }
        return metrics;
View Full Code Here

   
    public static Collection<PreaggregatedMetric> convertSets(String tenant, long timestamp, Collection<Bundle.Set> sets) {
        List<PreaggregatedMetric> list = new ArrayList<PreaggregatedMetric>(sets.size());
        for (Bundle.Set set : sets) {
            Locator locator = Locator.createLocatorFromPathComponents(tenant, set.getName().split(NAME_DELIMITER, -1));
            SetRollup rollup = new SetRollup();
            for (String value : set.getValues()) {
                rollup = rollup.withObject(value);
            }
            PreaggregatedMetric metric = new PreaggregatedMetric(timestamp, locator, DEFAULT_TTL, rollup);
            list.add(metric);
        }
        return list;
View Full Code Here

    public static Points<SetRollup> generateFakeSetRollupPoints() {
        Points<SetRollup> points = new Points<SetRollup>();
        long startTime = 1234567L;
        for (int i = 0; i < 5; i++) {
            long timeNow = startTime + i*1000;
            Points.Point<SetRollup> point = new Points.Point<SetRollup>(timeNow, new SetRollup()
                    .withObject(i)
                    .withObject(i % 2)
                    .withObject(i / 2));
            points.add(point);
        }
View Full Code Here

            filterStatsObject = getFilteredStatsForString((String) point.getData());
        } else if (point.getData() instanceof Boolean) {
            numPoints = 1;
            filterStatsObject = getFilteredStatsForBoolean((Boolean) point.getData());
        } else if (point.getData() instanceof SetRollup) {
            SetRollup rollup = (SetRollup)point.getData();
            numPoints += rollup.getCount();
            filterStatsObject = getFilteredStatsForRollup(rollup, filterStats);
        } else if (point.getData() instanceof TimerRollup) {
            TimerRollup rollup = (TimerRollup)point.getData();
            numPoints += rollup.getCount();
            filterStatsObject = getFilteredStatsForRollup(rollup, filterStats);
        } else if (point.getData() instanceof CounterRollup) {
            CounterRollup rollup = (CounterRollup)point.getData();
            numPoints += rollup.getCount().longValue();
            filterStatsObject = getFilteredStatsForRollup(rollup, filterStats);
        } else {
            throw new SerializationException("Unsupported data type for Point");
        }
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.types.SetRollup

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.