public TestTimestampEncoder(TestTimestampData testTimestamps) throws IOException { this.timestamps = testTimestamps; this.blockMeta = new PrefixTreeBlockMeta(); this.blockMeta.setNumMetaBytes(0); this.blockMeta.setNumRowBytes(0); this.blockMeta.setNumQualifierBytes(0); this.encoder = new LongEncoder(); for (Long ts : testTimestamps.getInputs()) { encoder.add(ts); } encoder.compile(); blockMeta.setTimestampFields(encoder); bytes = encoder.getByteArray(); decoder = new TimestampDecoder(); decoder.initOnBlock(blockMeta, bytes); }
/***************** construct ***********************/ public PrefixTreeEncoder(OutputStream outputStream, boolean includeMvccVersion) { // used during cell accumulation this.blockMeta = new PrefixTreeBlockMeta(); this.rowRange = new SimpleMutableByteRange(); this.familyRange = new SimpleMutableByteRange(); this.qualifierRange = new SimpleMutableByteRange(); this.timestamps = new long[INITIAL_PER_CELL_ARRAY_SIZES]; this.mvccVersions = new long[INITIAL_PER_CELL_ARRAY_SIZES]; this.typeBytes = new byte[INITIAL_PER_CELL_ARRAY_SIZES]; this.valueOffsets = new int[INITIAL_PER_CELL_ARRAY_SIZES]; this.values = new byte[VALUE_BUFFER_INIT_SIZE]; // used during compilation this.familyDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.qualifierDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.timestampEncoder = new LongEncoder(); this.mvccVersionEncoder = new LongEncoder(); this.cellTypeEncoder = new CellTypeEncoder(); this.rowTokenizer = new Tokenizer(); this.familyTokenizer = new Tokenizer(); this.qualifierTokenizer = new Tokenizer(); this.rowWriter = new RowSectionWriter(); this.familyWriter = new ColumnSectionWriter(); this.qualifierWriter = new ColumnSectionWriter(); initializeTagHelpers(); reset(outputStream, includeMvccVersion); }
/***************** construct ***********************/ public PrefixTreeEncoder(OutputStream outputStream, boolean includeMvccVersion) { // used during cell accumulation this.blockMeta = new PrefixTreeBlockMeta(); this.rowRange = new SimpleByteRange(); this.familyRange = new SimpleByteRange(); this.qualifierRange = new SimpleByteRange(); this.timestamps = new long[INITIAL_PER_CELL_ARRAY_SIZES]; this.mvccVersions = new long[INITIAL_PER_CELL_ARRAY_SIZES]; this.typeBytes = new byte[INITIAL_PER_CELL_ARRAY_SIZES]; this.valueOffsets = new int[INITIAL_PER_CELL_ARRAY_SIZES]; this.values = new byte[VALUE_BUFFER_INIT_SIZE]; // used during compilation this.familyDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.qualifierDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.timestampEncoder = new LongEncoder(); this.mvccVersionEncoder = new LongEncoder(); this.cellTypeEncoder = new CellTypeEncoder(); this.rowTokenizer = new Tokenizer(); this.familyTokenizer = new Tokenizer(); this.qualifierTokenizer = new Tokenizer(); this.rowWriter = new RowSectionWriter(); this.familyWriter = new ColumnSectionWriter(); this.qualifierWriter = new ColumnSectionWriter(); initializeTagHelpers(); reset(outputStream, includeMvccVersion); }
/***************** construct ***********************/ public PrefixTreeEncoder(OutputStream outputStream, boolean includeMvccVersion) { // used during cell accumulation this.blockMeta = new PrefixTreeBlockMeta(); this.rowRange = new SimpleByteRange(); this.familyRange = new SimpleByteRange(); this.qualifierRange = new SimpleByteRange(); this.timestamps = new long[INITIAL_PER_CELL_ARRAY_SIZES]; this.mvccVersions = new long[INITIAL_PER_CELL_ARRAY_SIZES]; this.typeBytes = new byte[INITIAL_PER_CELL_ARRAY_SIZES]; this.valueOffsets = new int[INITIAL_PER_CELL_ARRAY_SIZES]; this.values = new byte[VALUE_BUFFER_INIT_SIZE]; // used during compilation this.familyDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.qualifierDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.timestampEncoder = new LongEncoder(); this.mvccVersionEncoder = new LongEncoder(); this.cellTypeEncoder = new CellTypeEncoder(); this.rowTokenizer = new Tokenizer(); this.familyTokenizer = new Tokenizer(); this.qualifierTokenizer = new Tokenizer(); this.rowWriter = new RowSectionWriter(); this.familyWriter = new ColumnSectionWriter(); this.qualifierWriter = new ColumnSectionWriter(); reset(outputStream, includeMvccVersion); }
public void setTimestampFields(LongEncoder encoder){ this.minTimestamp = encoder.getMin(); this.timestampIndexWidth = encoder.getBytesPerIndex(); this.timestampDeltaWidth = encoder.getBytesPerDelta(); this.numTimestampBytes = encoder.getTotalCompressedBytes(); }
public void setMvccVersionFields(LongEncoder encoder){ this.minMvccVersion = encoder.getMin(); this.mvccVersionIndexWidth = encoder.getBytesPerIndex(); this.mvccVersionDeltaWidth = encoder.getBytesPerDelta(); this.numMvccVersionBytes = encoder.getTotalCompressedBytes(); }
public LongEncoder getTimestampEncoder() { return timestampEncoder; }
public LongEncoder getMvccVersionEncoder() { return mvccVersionEncoder; }