@Override public List<ByteRange> getInputs() { List<String> d = Lists.newArrayList(); d.add("abc"); d.add("abcde"); d.add("abc"); d.add("bbc"); d.add("abc"); return ByteRangeUtils.fromArrays(Bytes.getUtf8ByteArrays(d)); }
@Override public List<ByteRange> getOutputs() { List<String> d = Lists.newArrayList(); d.add("abc"); d.add("abcde"); d.add("bbc"); return ByteRangeUtils.fromArrays(Bytes.getUtf8ByteArrays(d)); }
/*************** 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(); }
/** * UVInt: tokenWidth * bytes: token */ protected void writeRowToken(OutputStream os) throws IOException { UVIntTool.writeBytes(tokenWidth, os); int tokenStartIndex = tokenizerNode.isRoot() ? 0 : 1; ByteRangeUtils.write(os, tokenizerNode.getToken(), tokenStartIndex); }
protected int numIdenticalBytes(ByteRange bytes) { return ByteRangeUtils.numEqualPrefixBytes(token, bytes, tokenStartOffset); }