public void reset() { checkArgument(columnClosed, "Column is open"); lengthOutput.reset(); output = output.createRecycledCompressedSliceOutput(); encodeOutput = new ColumnEncodeOutput(lengthOutput, output); columnClosed = false; }
private static Slice writeVintOld(SliceOutput output, long value) throws IOException { output.reset(); WritableUtils.writeVLong(output, value); Slice vLongOld = Slices.copyOf(output.slice()); output.reset(); RcFileDecoderUtils.writeVLong(output, value); Slice vLongNew = Slices.copyOf(output.slice()); assertEquals(vLongNew, vLongOld); if (value == (int) value) { output.reset(); WritableUtils.writeVInt(output, (int) value); Slice vIntOld = Slices.copyOf(output.slice()); assertEquals(vIntOld, vLongOld); output.reset(); RcFileDecoderUtils.writeVInt(output, (int) value); Slice vIntNew = Slices.copyOf(output.slice()); assertEquals(vIntNew, vLongOld); } return vLongOld; } }
public void reset() { checkArgument(columnClosed, "Column is open"); lengthOutput.reset(); output = output.createRecycledCompressedSliceOutput(); encodeOutput = new ColumnEncodeOutput(lengthOutput, output); columnClosed = false; }
public void reset() { checkArgument(columnClosed, "Column is open"); lengthOutput.reset(); output = output.createRecycledCompressedSliceOutput(); encodeOutput = new ColumnEncodeOutput(lengthOutput, output); columnClosed = false; }
private static Slice writeVintOld(SliceOutput output, long value) throws IOException { output.reset(); WritableUtils.writeVLong(output, value); Slice vLongOld = Slices.copyOf(output.slice()); output.reset(); RcFileDecoderUtils.writeVLong(output, value); Slice vLongNew = Slices.copyOf(output.slice()); assertEquals(vLongNew, vLongOld); if (value == (int) value) { output.reset(); WritableUtils.writeVInt(output, (int) value); Slice vIntOld = Slices.copyOf(output.slice()); assertEquals(vIntOld, vLongOld); output.reset(); RcFileDecoderUtils.writeVInt(output, (int) value); Slice vIntNew = Slices.copyOf(output.slice()); assertEquals(vIntNew, vLongOld); } return vLongOld; } }
private static Slice writeVintOld(SliceOutput output, long value) throws IOException { output.reset(); WritableUtils.writeVLong(output, value); Slice vLongOld = Slices.copyOf(output.slice()); output.reset(); RcFileDecoderUtils.writeVLong(output, value); Slice vLongNew = Slices.copyOf(output.slice()); assertEquals(vLongNew, vLongOld); if (value == (int) value) { output.reset(); WritableUtils.writeVInt(output, (int) value); Slice vIntOld = Slices.copyOf(output.slice()); assertEquals(vIntOld, vLongOld); output.reset(); RcFileDecoderUtils.writeVInt(output, (int) value); Slice vIntNew = Slices.copyOf(output.slice()); assertEquals(vIntNew, vLongOld); } return vLongOld; } }
private static Slice writeVintOld(SliceOutput output, long value) throws IOException { output.reset(); WritableUtils.writeVLong(output, value); Slice vLongOld = Slices.copyOf(output.slice()); output.reset(); RcFileDecoderUtils.writeVLong(output, value); Slice vLongNew = Slices.copyOf(output.slice()); assertEquals(vLongNew, vLongOld); if (value == (int) value) { output.reset(); WritableUtils.writeVInt(output, (int) value); Slice vIntOld = Slices.copyOf(output.slice()); assertEquals(vIntOld, vLongOld); output.reset(); RcFileDecoderUtils.writeVInt(output, (int) value); Slice vIntNew = Slices.copyOf(output.slice()); assertEquals(vIntNew, vLongOld); } return vLongOld; } }
assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {0, 1, 2, 3, 4})); output.reset(); assertEquals(output.slice(), Slices.EMPTY_SLICE); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2, 4, 6, 8, 10})); output.reset(5); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2, 4, 6, 8, 10})); output.reset(3); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2, 4, 6})); output.reset(1); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2})); output.reset(0); assertEquals(output.slice(), Slices.EMPTY_SLICE);
assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {0, 1, 2, 3, 4})); output.reset(); assertEquals(output.slice(), Slices.EMPTY_SLICE); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2, 4, 6, 8, 10})); output.reset(5); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2, 4, 6, 8, 10})); output.reset(3); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2, 4, 6})); output.reset(1); assertEquals(output.slice(), Slices.wrappedBuffer(new byte[] {2})); output.reset(0); assertEquals(output.slice(), Slices.EMPTY_SLICE);