} else { rFlags = rVersion.equals(VERSION.UNCOMPRESSED_MULTI_VALUE) ? Feature.MULTI_VALUE.getMask() : NO_FLAGS; final boolean hasMultipleValues = Feature.MULTI_VALUE.isSet(rFlags) || Feature.MULTI_VALUE_V3.isSet(rFlags); .setDictionaryEncodedColumnSupplier(dictionaryEncodedColumnSupplier); if (!Feature.NO_BITMAP_INDEX.isSet(rFlags)) { GenericIndexed<ImmutableBitmap> rBitmaps = GenericIndexed.read( buffer,
} else { rFlags = rVersion.equals(VERSION.UNCOMPRESSED_MULTI_VALUE) ? Feature.MULTI_VALUE.getMask() : NO_FLAGS; final boolean hasMultipleValues = Feature.MULTI_VALUE.isSet(rFlags) || Feature.MULTI_VALUE_V3.isSet(rFlags); .setDictionaryEncodedColumnSupplier(dictionaryEncodedColumnSupplier); if (!Feature.NO_BITMAP_INDEX.isSet(rFlags)) { GenericIndexed<ImmutableBitmap> rBitmaps = GenericIndexed.read( buffer,
private WritableSupplier<ColumnarMultiInts> readMultiValuedColumn( VERSION version, ByteBuffer buffer, int flags ) { switch (version) { case UNCOMPRESSED_MULTI_VALUE: { return VSizeColumnarMultiInts.readFromByteBuffer(buffer); } case UNCOMPRESSED_WITH_FLAGS: { if (Feature.MULTI_VALUE.isSet(flags)) { return VSizeColumnarMultiInts.readFromByteBuffer(buffer); } else { throw new IAE("Unrecognized multi-value flag[%d] for version[%s]", flags, version); } } case COMPRESSED: { if (Feature.MULTI_VALUE.isSet(flags)) { return CompressedVSizeColumnarMultiIntsSupplier.fromByteBuffer(buffer, byteOrder); } else if (Feature.MULTI_VALUE_V3.isSet(flags)) { return V3CompressedVSizeColumnarMultiIntsSupplier.fromByteBuffer(buffer, byteOrder); } else { throw new IAE("Unrecognized multi-value flag[%d] for version[%s]", flags, version); } } default: throw new IAE("Unsupported multi-value version[%s]", version); } } };
public SerializerBuilder withValue(ColumnarIntsSerializer valueWriter, boolean hasMultiValue, boolean compressed) { this.valueWriter = valueWriter; if (hasMultiValue) { if (compressed) { this.version = VERSION.COMPRESSED; this.flags |= Feature.MULTI_VALUE_V3.getMask(); } else { this.version = VERSION.UNCOMPRESSED_MULTI_VALUE; this.flags |= Feature.MULTI_VALUE.getMask(); } } else { if (compressed) { this.version = VERSION.COMPRESSED; } else { this.version = VERSION.UNCOMPRESSED_SINGLE_VALUE; } } return this; }
public boolean isSet(int flags) { return (getMask() & flags) != 0; }
private static boolean mustWriteFlags(final int flags) { // Flags that are not implied by version codes < COMPRESSED must be written. This includes MULTI_VALUE_V3. return flags != NO_FLAGS && flags != Feature.MULTI_VALUE.getMask(); } }
public int getMask() { return (1 << ordinal()); } }
public SerializerBuilder withBitmapIndex(@Nullable GenericIndexedWriter<ImmutableBitmap> bitmapIndexWriter) { if (bitmapIndexWriter == null) { flags |= Feature.NO_BITMAP_INDEX.getMask(); } else { flags &= ~Feature.NO_BITMAP_INDEX.getMask(); } this.bitmapIndexWriter = bitmapIndexWriter; return this; }
private WritableSupplier<ColumnarMultiInts> readMultiValuedColumn(VERSION version, ByteBuffer buffer, int flags) { switch (version) { case UNCOMPRESSED_MULTI_VALUE: { return VSizeColumnarMultiInts.readFromByteBuffer(buffer); } case UNCOMPRESSED_WITH_FLAGS: { if (Feature.MULTI_VALUE.isSet(flags)) { return VSizeColumnarMultiInts.readFromByteBuffer(buffer); } else { throw new IAE("Unrecognized multi-value flag[%d] for version[%s]", flags, version); } } case COMPRESSED: { if (Feature.MULTI_VALUE.isSet(flags)) { return CompressedVSizeColumnarMultiIntsSupplier.fromByteBuffer(buffer, byteOrder); } else if (Feature.MULTI_VALUE_V3.isSet(flags)) { return V3CompressedVSizeColumnarMultiIntsSupplier.fromByteBuffer(buffer, byteOrder); } else { throw new IAE("Unrecognized multi-value flag[%d] for version[%s]", flags, version); } } default: throw new IAE("Unsupported multi-value version[%s]", version); } } };
public SerializerBuilder withValue(ColumnarIntsSerializer valueWriter, boolean hasMultiValue, boolean compressed) { this.valueWriter = valueWriter; if (hasMultiValue) { if (compressed) { this.version = VERSION.COMPRESSED; this.flags |= Feature.MULTI_VALUE_V3.getMask(); } else { this.version = VERSION.UNCOMPRESSED_MULTI_VALUE; this.flags |= Feature.MULTI_VALUE.getMask(); } } else { if (compressed) { this.version = VERSION.COMPRESSED; } else { this.version = VERSION.UNCOMPRESSED_SINGLE_VALUE; } } return this; }
public boolean isSet(int flags) { return (getMask() & flags) != 0; }
public int getMask() { return (1 << ordinal()); } }
private static boolean mustWriteFlags(final int flags) { // Flags that are not implied by version codes < COMPRESSED must be written. This includes MULTI_VALUE_V3. return flags != NO_FLAGS && flags != Feature.MULTI_VALUE.getMask(); } }
public SerializerBuilder withBitmapIndex(@Nullable GenericIndexedWriter<ImmutableBitmap> bitmapIndexWriter) { if (bitmapIndexWriter == null) { flags |= Feature.NO_BITMAP_INDEX.getMask(); } else { flags &= ~Feature.NO_BITMAP_INDEX.getMask(); } this.bitmapIndexWriter = bitmapIndexWriter; return this; }