/***************** 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); }
protected void initializeTagHelpers() { this.tagsRange = new SimpleMutableByteRange(); this.tagsDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.tagsTokenizer = new Tokenizer(); this.tagsWriter = new ColumnSectionWriter(); }
/*************** construct ****************************/ public TestColumnBuilder(TestColumnData columns) { this.columns = columns; List<ByteRange> inputs = columns.getInputs(); this.columnSorter = new ByteRangeTreeSet(inputs); this.sortedUniqueColumns = columnSorter.compile().getSortedRanges(); List<byte[]> copies = ByteRangeUtils.copyToNewArrays(sortedUniqueColumns); Assert.assertTrue(Bytes.isSorted(copies)); this.blockMeta = new PrefixTreeBlockMeta(); this.blockMeta.setNumMetaBytes(0); this.blockMeta.setNumRowBytes(0); this.builder = new Tokenizer(); }
protected void testInternal(List<String> inputs, int expectedTreeDepth) { Tokenizer builder = new Tokenizer(); for (String s : inputs) { SimpleMutableByteRange b = new SimpleMutableByteRange(Bytes.toBytes(s)); builder.addSorted(b); } Assert.assertEquals(1, builder.getRoot().getNodeDepth()); Assert.assertEquals(expectedTreeDepth, builder.getTreeDepth()); }
public TestTokenizer(TestTokenizerData sortedByteArrays) { this.inputs = sortedByteArrays.getInputs(); this.builder = new Tokenizer(); for (byte[] array : inputs) { builder.addSorted(new SimpleMutableByteRange(array)); } this.roundTripped = builder.getArrays(); }
/***************** 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); }
protected void initializeTagHelpers() { this.tagsRange = new SimpleByteRange(); this.tagsDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet() : new ByteRangeTreeSet(); this.tagsTokenizer = new Tokenizer(); this.tagsWriter = new ColumnSectionWriter(); }
protected void testInternal(List<String> inputs, int expectedTreeDepth) { Tokenizer builder = new Tokenizer(); for (String s : inputs) { SimpleByteRange b = new SimpleByteRange(Bytes.toBytes(s)); builder.addSorted(b); } Assert.assertEquals(1, builder.getRoot().getNodeDepth()); Assert.assertEquals(expectedTreeDepth, builder.getTreeDepth()); }
public TestTokenizer(TestTokenizerData sortedByteArrays) { this.inputs = sortedByteArrays.getInputs(); this.builder = new Tokenizer(); for (byte[] array : inputs) { builder.addSorted(new SimpleByteRange(array)); } this.roundTripped = builder.getArrays(); }
/***************** 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 ColumnSectionWriter(PrefixTreeBlockMeta blockMeta, Tokenizer builder, ColumnNodeType nodeType) { this();// init collections reconstruct(blockMeta, builder, nodeType); }
public void reconstruct(PrefixTreeBlockMeta blockMeta, Tokenizer builder, ColumnNodeType nodeType) { this.blockMeta = blockMeta; this.tokenizer = builder; this.nodeType = nodeType; }
public Tokenizer getRowTokenizer() { return rowTokenizer; }
public ColumnSectionWriter(PrefixTreeBlockMeta blockMeta, Tokenizer builder, boolean familyVsQualifier) { this();// init collections reconstruct(blockMeta, builder, familyVsQualifier); }
public void reconstruct(PrefixTreeBlockMeta blockMeta, Tokenizer builder, boolean familyVsQualifier) { this.blockMeta = blockMeta; this.tokenizer = builder; this.familyVsQualifier = familyVsQualifier; }