@Benchmark @OperationsPerInvocation(100000) public void encodingGorillaBenchmark(DataGenerator dg) { LongArrayOutput output = new LongArrayOutput(); GorillaCompressor c = new GorillaCompressor(dg.blockStart, output); for(int j = 0; j < dg.amountOfPoints; j++) { c.addValue(dg.uncompressedTimestamps[j], dg.uncompressedDoubles[j]); } c.close(); }
public GorillaCompressor(long timestamp, BitOutput output, Predictor predictor) { blockTimestamp = timestamp; out = output; addHeader(timestamp); this.valueCompressor = new ValueCompressor(output, predictor); }
/** * Adds a new long value to the series. Note, values must be inserted in order. * * @param timestamp Timestamp which is inside the allowed time block (default 24 hours with millisecond precision) * @param value next floating point value in the series */ public void addValue(long timestamp, long value) { if(storedTimestamp == 0) { writeFirst(timestamp, value); } else { compressTimestamp(timestamp); valueCompressor.compressValue(value); } }
public void addValue(long timestamp, double value) { if (closed) { throw new IllegalStateException("Compressor is closed"); } numEntries++; newestTimestamp = timestamp; compressor.addValue(timestamp, value); }
public WrappedGorillaCompressor(long timestamp) { this.compressorOutput = new LongArrayOutput(16); this.compressor = new GorillaCompressor(timestamp, this.compressorOutput); this.oldestTimestamp = timestamp; this.newestTimestamp = timestamp; }
public void close() { compressor.close(); backingArray = compressorOutput.getLongArray(); compressorOutput = null; closed = true; }
out.skipBit(); } else { deltaD = encodeZigZag32(deltaD);
out.skipBit(); } else { deltaD = encodeZigZag32(deltaD);
@Benchmark @OperationsPerInvocation(100000) public void encodingGorillaBenchmarkLong(DataGenerator dg) { LongArrayOutput output = new LongArrayOutput(); GorillaCompressor c = new GorillaCompressor(dg.blockStart, output); for(int j = 0; j < dg.amountOfPoints; j++) { c.addValue(dg.uncompressedTimestamps[j], dg.uncompressedValues[j]); } c.close(); }
/** * Adds a new long value to the series. Note, values must be inserted in order. * * @param timestamp Timestamp which is inside the allowed time block (default 24 hours with millisecond precision) * @param value next floating point value in the series */ public void addValue(long timestamp, long value) { if(storedTimestamp == 0) { writeFirst(timestamp, value); } else { compressTimestamp(timestamp); valueCompressor.compressValue(value); } }
public GorillaCompressor(long timestamp, BitOutput output, Predictor predictor) { blockTimestamp = timestamp; out = output; addHeader(timestamp); this.valueCompressor = new ValueCompressor(output, predictor); }
@Benchmark @OperationsPerInvocation(100000) public void encodingGorillaBenchmark(DataGenerator dg) { LongArrayOutput output = new LongArrayOutput(); GorillaCompressor c = new GorillaCompressor(dg.blockStart, output); for(int j = 0; j < dg.amountOfPoints; j++) { c.addValue(dg.uncompressedTimestamps[j], dg.uncompressedDoubles[j]); } c.close(); }
/** * Adds a new double value to the series. Note, values must be inserted in order. * * @param timestamp Timestamp which is inside the allowed time block (default 24 hours with millisecond precision) * @param value next floating point value in the series */ public void addValue(long timestamp, double value) { if(storedTimestamp == 0) { writeFirst(timestamp, Double.doubleToRawLongBits(value)); return; } compressTimestamp(timestamp); valueCompressor.compressValue(Double.doubleToRawLongBits(value)); }
@Benchmark @OperationsPerInvocation(100000) public void encodingGorillaBenchmarkLong(DataGenerator dg) { LongArrayOutput output = new LongArrayOutput(); GorillaCompressor c = new GorillaCompressor(dg.blockStart, output); for(int j = 0; j < dg.amountOfPoints; j++) { c.addValue(dg.uncompressedTimestamps[j], dg.uncompressedValues[j]); } c.close(); }
/** * Adds a new double value to the series. Note, values must be inserted in order. * * @param timestamp Timestamp which is inside the allowed time block (default 24 hours with millisecond precision) * @param value next floating point value in the series */ public void addValue(long timestamp, double value) { if(storedTimestamp == 0) { writeFirst(timestamp, Double.doubleToRawLongBits(value)); return; } compressTimestamp(timestamp); valueCompressor.compressValue(Double.doubleToRawLongBits(value)); }
GorillaCompressor gc = new GorillaCompressor(blockStart, arrayOutput); gc.addValue(uncompressedTimestamps[j], uncompressedDoubles[j]); gc.close(); c.close();
GorillaCompressor gc = new GorillaCompressor(blockStart, arrayOutput); gc.addValue(uncompressedTimestamps[j], uncompressedDoubles[j]); gc.close(); c.close();