public VSizeColumnarIntsSerializer(final SegmentWriteOutMedium segmentWriteOutMedium, final int maxValue) { this.segmentWriteOutMedium = segmentWriteOutMedium; this.numBytes = VSizeColumnarInts.getNumBytesForMax(maxValue); }
private static int sizePer(int maxValue, int chunkFactor) { return chunkFactor * VSizeColumnarInts.getNumBytesForMax(maxValue) + CompressedVSizeColumnarIntsSupplier.bufferPadding(VSizeColumnarInts.getNumBytesForMax(maxValue)); }
private void writeNumBytesForMax() throws IOException { if (!numBytesForMaxWritten) { final byte numBytesForMax = VSizeColumnarInts.getNumBytesForMax(maxId); valuesOut.write(new byte[4 - numBytesForMax]); numBytesForMaxWritten = true; } } }
public VSizeColumnarMultiIntsSerializer(SegmentWriteOutMedium segmentWriteOutMedium, int maxId) { this.segmentWriteOutMedium = segmentWriteOutMedium; this.maxId = maxId; this.writeInt = WriteInt.values()[VSizeColumnarInts.getNumBytesForMax(maxId) - 1]; }
public static int maxIntsInBufferForValue(int maxValue) { return maxIntsInBufferForBytes(VSizeColumnarInts.getNumBytesForMax(maxValue)); }
public static VSizeColumnarInts fromIndexedInts(IndexedInts ints, int maxValue) { int numBytes = getNumBytesForMax(maxValue); final ByteBuffer buffer = ByteBuffer.allocate((ints.size() * numBytes) + (4 - numBytes)); writeToBuffer(buffer, ints, numBytes, maxValue); return new VSizeColumnarInts(buffer.asReadOnlyBuffer(), numBytes); }
CompressedVSizeColumnarIntsSerializer( final SegmentWriteOutMedium segmentWriteOutMedium, final int maxValue, final int chunkFactor, final ByteOrder byteOrder, final CompressionStrategy compression, final GenericIndexedWriter<ByteBuffer> flattener ) { this.numBytes = VSizeColumnarInts.getNumBytesForMax(maxValue); this.chunkFactor = chunkFactor; int chunkBytes = chunkFactor * numBytes; this.isBigEndian = byteOrder.equals(ByteOrder.BIG_ENDIAN); this.compression = compression; this.flattener = flattener; this.intBuffer = ByteBuffer.allocate(Integer.BYTES).order(byteOrder); CompressionStrategy.Compressor compressor = compression.getCompressor(); this.endBuffer = compressor.allocateInBuffer(chunkBytes, segmentWriteOutMedium.getCloser()).order(byteOrder); this.numInserted = 0; }
final int numBytes = VSizeColumnarInts.getNumBytesForMax(maxValue); final int chunkBytes = chunkFactor * numBytes;
public VSizeColumnarIntsSerializer(final SegmentWriteOutMedium segmentWriteOutMedium, final int maxValue) { this.segmentWriteOutMedium = segmentWriteOutMedium; this.numBytes = VSizeColumnarInts.getNumBytesForMax(maxValue); }
private static int sizePer(int maxValue, int chunkFactor) { return chunkFactor * VSizeColumnarInts.getNumBytesForMax(maxValue) + CompressedVSizeColumnarIntsSupplier.bufferPadding(VSizeColumnarInts.getNumBytesForMax(maxValue)); }
public VSizeColumnarMultiIntsSerializer(SegmentWriteOutMedium segmentWriteOutMedium, int maxId) { this.segmentWriteOutMedium = segmentWriteOutMedium; this.maxId = maxId; this.writeInt = WriteInt.values()[VSizeColumnarInts.getNumBytesForMax(maxId) - 1]; }
private void writeNumBytesForMax() throws IOException { if (!numBytesForMaxWritten) { final byte numBytesForMax = VSizeColumnarInts.getNumBytesForMax(maxId); valuesOut.write(new byte[4 - numBytesForMax]); numBytesForMaxWritten = true; } } }
public static int maxIntsInBufferForValue(int maxValue) { return maxIntsInBufferForBytes(VSizeColumnarInts.getNumBytesForMax(maxValue)); }
public static VSizeColumnarInts fromIndexedInts(IndexedInts ints, int maxValue) { int numBytes = getNumBytesForMax(maxValue); final ByteBuffer buffer = ByteBuffer.allocate((ints.size() * numBytes) + (4 - numBytes)); writeToBuffer(buffer, ints, numBytes, maxValue); return new VSizeColumnarInts(buffer.asReadOnlyBuffer(), numBytes); }
CompressedVSizeColumnarIntsSerializer( final SegmentWriteOutMedium segmentWriteOutMedium, final int maxValue, final int chunkFactor, final ByteOrder byteOrder, final CompressionStrategy compression, final GenericIndexedWriter<ByteBuffer> flattener ) { this.numBytes = VSizeColumnarInts.getNumBytesForMax(maxValue); this.chunkFactor = chunkFactor; int chunkBytes = chunkFactor * numBytes; this.isBigEndian = byteOrder.equals(ByteOrder.BIG_ENDIAN); this.compression = compression; this.flattener = flattener; this.intBuffer = ByteBuffer.allocate(Integer.BYTES).order(byteOrder); CompressionStrategy.Compressor compressor = compression.getCompressor(); this.endBuffer = compressor.allocateInBuffer(chunkBytes, segmentWriteOutMedium.getCloser()).order(byteOrder); this.numInserted = 0; }
final int numBytes = VSizeColumnarInts.getNumBytesForMax(maxValue); final int chunkBytes = chunkFactor * numBytes;