/** * Returns the next pair in the time series, if available. * * @return Pair if there's next value, null if series is done. */ public Pair readPair() { next(); if(endOfStream) { return null; } return new Pair(storedTimestamp, storedVal); }
Pair pair; while ((pair = d.readPair()) != null) { if (pair.getTimestamp() >= start && pair.getTimestamp() < end) { DataPoint<T> dataPoint = null; dataPoint = new DataPoint(pair.getTimestamp(), pair.getDoubleValue()); break; case 1: // AVAILABILITY dataPoint = new DataPoint(pair.getTimestamp(), AvailabilityType.fromByte( ((Double) pair.getDoubleValue()).byteValue())); break; case 2: // COUNTER dataPoint = new DataPoint(pair.getTimestamp(), ((Double) pair.getDoubleValue ()).longValue()); break; Long key = pair.getTimestamp();
Pair pair; while ((pair = d.readPair()) != null) { if (pair.getTimestamp() >= start && pair.getTimestamp() < end) { DataPoint<T> dataPoint = null; dataPoint = new DataPoint(pair.getTimestamp(), pair.getDoubleValue()); break; case 1: // AVAILABILITY dataPoint = new DataPoint(pair.getTimestamp(), AvailabilityType.fromByte( ((Double) pair.getDoubleValue()).byteValue())); break; case 2: // COUNTER dataPoint = new DataPoint(pair.getTimestamp(), ((Double) pair.getDoubleValue ()).longValue()); break; Long key = pair.getTimestamp();
private Map<Key, Value> getEntries() { // sort all retrieved entries by key order, consistent with the accumulo // version Map<Key, Value> entries = new TreeMap<>(); if (decompressors != null) { TaggedMetric tm = decompressors.getTaggedMetric(); WrappedGorillaDecompressor decompressor = decompressors.getDecompressorWrapper(); fi.iki.yak.ts.compression.gorilla.Pair gPair = null; while (decompressor != null && decompressors != null) { gPair = decompressor.readPair(); if (gPair == null) { if (decompressors.hasNext()) { decompressor = decompressors.next(); } else { if ((decompressors = getNextDecompressorIterable()) != null) { tm = decompressors.getTaggedMetric(); decompressor = decompressors.getDecompressorWrapper(); } } } else { long ts = gPair.getTimestamp(); if (ts >= startTs && ts <= endTs) { entries.put(MetricAdapter.toKey(this.query.getMetric(), tm.getTags(), ts), new Value(MetricAdapter.encodeValue(gPair.getDoubleValue()))); } } } } return entries; }
/** * Returns the next pair in the time series, if available. * * @return Pair if there's next value, null if series is done. */ public Pair readPair() { next(); if(endOfStream) { return null; } return new Pair(storedTimestamp, storedVal); }
/** * Returns the next pair in the time series, if available. * * @return Pair if there's next value, null if series is done. */ public Pair readPair() { next(); if(endOfStream) { return null; } Pair pair = new Pair(storedTimestamp, storedVal); return pair; }
/** * Returns the next pair in the time series, if available. * * @return Pair if there's next value, null if series is done. */ public Pair readPair() { next(); if(endOfStream) { return null; } Pair pair = new Pair(storedTimestamp, storedVal); return pair; }
uncompressedDoubles[i] = i; uncompressedValues[i] = i; pairs.add(new Pair(now, i));
uncompressedDoubles[i] = i; uncompressedValues[i] = i; pairs.add(new Pair(now, i));