public void convert(CharSequence textBlock, EncodingTransform transform, EncodingStorage storage) { cleanInternalState(); DataOutputBlobWriter<RawDataSchema> outputStream = openTransform(textBlock); transform.transform(templateParserReader, outputStream); closeTransform(outputStream); storage.store(workingPipeB); closeStore(); }
private void visitorBranch(TrieParser that, ByteSquenceVisitor visitor, byte[] source, int localSourcePos, int sourceLength, int sourceMask, final long unfoundResult, short[] data) { if (this.runLength<sourceLength) { //TrieMap data final short[] data1 = data; final int p = 1+pos; pos = (0==(0xFFFFFF&TrieParser.computeJumpMask((short) source[sourceMask & localSourcePos], data[pos]))) ? 3+pos : 2+p+((((int)data1[p])<<15) | (0x7FFF&data1[1+p])); visit(that, pos, visitor, source, localSourcePos, sourceLength, sourceMask, unfoundResult);//only that jump } else{ return; } }
private void visitSafeEnd(TrieParserVisitor pv, int i, byte[] buffer, int bufferPosition) { assert(TYPE_SAFE_END == data[i]); i++;//skip over the ID; int s = SIZE_OF_RESULT; long result = 0; while (--s >= 0) { result = (result<<8) | ((long)data[i++]); } pv.visit(buffer, bufferPosition, result); visitPatterns(pv,i,buffer,bufferPosition); }
public List<PrivateTopic> getPrivateTopicsFromSource(String source) { byte[] bytes = CharSequenceToUTF8Local.get().convert(source).append(" ").asBytes(); int sourceId = (int)TrieParserReader.query(TrieParserReaderLocal.get(), privateTopicSource, bytes, 0, bytes.length, Integer.MAX_VALUE); List<PrivateTopic> result = (sourceId<0) ? Collections.EMPTY_LIST : privateSourceTopics.get(sourceId); return result; }
private static void appendVolume(AppendableByteWriter<?> target, long traf) { if (traf>9999) { Appendables.appendValue(target.append("Vol:"), traf); } else { Appendables.appendFixedDecimalDigits(target.append("Vol:"), traf, 1000); } }
private static int indexOfMatchInArray(short value, short[] data, int i) { if (1==i) { return Branchless.ifEquals(value, data[0], 0, -1); //return (value==data[0]) ? 0 : -1; } return indexOfMatchInArrayScan(value, data, i); }
public static AppendableProxy join(Appendable ... targets) { if (targets.length==1) { return new AppendableProxy(targets[0]); } else { return new AppendablesProxy(targets); } }
public static long query(TrieParserReader reader, TrieParser trie, byte[] source, int sourcePos, long sourceLength, int sourceMask, final long unfoundResult, final long noMatchResult) { return (TrieParser.getLimit(trie)>0) ? query2(reader, trie, source, sourcePos, sourceLength, sourceMask, unfoundResult, noMatchResult): unfoundResult; }
public void convert(CharSequence textBlock, EncodingTransform transform, EncodingStorage storage) { cleanInternalState(); DataOutputBlobWriter<RawDataSchema> outputStream = openTransform(textBlock); transform.transform(templateParserReader, outputStream); closeTransform(outputStream); storage.store(workingPipeB); closeStore(); }
public long fieldLookup(byte[] source, int pos, int len, int mask, int structId) { assert ((IS_STRUCT_BIT&structId) !=0 ) : "Struct Id must be passed in"; assert (structId>=0) : "Bad Struct ID "+structId; TrieParserReader reader = TrieParserReaderLocal.get(); return TrieParserReader.query(reader, fields[STRUCT_MASK&structId], source, pos, len, mask); }
private void visitorBranch(TrieParser that, ByteSquenceVisitor visitor, byte[] source, int localSourcePos, int sourceLength, int sourceMask, final short[] data) { if (this.runLength<sourceLength) { //TrieMap data final int p = 1+pos; pos = (0==(0xFFFFFF&TrieParser.computeJumpMask((short) source[sourceMask & localSourcePos], data[pos]))) ? 3+pos : 2+p+((((int)data[p])<<15) | (0x7FFF&data[1+p])); visit(that, pos, visitor, source, localSourcePos, sourceLength, sourceMask, this.unfoundConstant, this.noMatchConstant);//only that jump } else{ return; } }
private void visitSafeEnd(TrieParserVisitor pv, int i, byte[] buffer, int bufferPosition) { assert(TYPE_SAFE_END == data[i]); i++;//skip over the ID; int s = SIZE_OF_RESULT; long result = 0; while (--s >= 0) { result = (result<<8) | ((long)data[i++]); } pv.visit(buffer, bufferPosition, result); visitPatterns(pv,i,buffer,bufferPosition); }
private static int indexOfMatchInArray(short value, short[] data, int i) { if (1==i) { Branchless.ifEquals(value, data[0], 0, -1); //return (value==data[0]) ? 0 : -1; } return indexOfMatchInArrayScan(value, data, i); }
public void convert(CharSequence textBlock, EncodingTransform transform, EncodingStorage storage) { cleanInternalState(); DataOutputBlobWriter<RawDataSchema> outputStream = openTransform(textBlock); transform.transform(templateParserReader, outputStream); closeTransform(outputStream); storage.store(workingPipeB); closeStore(); }
private void visitorBranch(TrieParser that, ByteSquenceVisitor visitor, byte[] source, int localSourcePos, int sourceLength, int sourceMask, final short[] data) { if (this.runLength<sourceLength) { //TrieMap data final int p = 1+pos; pos = (0==(0xFFFFFF&TrieParser.computeJumpMask((short) source[sourceMask & localSourcePos], data[pos]))) ? 3+pos : 2+p+((((int)data[p])<<15) | (0x7FFF&data[1+p])); visit(that, pos, visitor, source, localSourcePos, sourceLength, sourceMask, this.unfoundConstant, this.noMatchConstant);//only that jump } else{ return; } }
private void visitSafeEnd(TrieParserVisitor pv, int i, byte[] buffer, int bufferPosition) { assert(TYPE_SAFE_END == data[i]); i++;//skip over the ID; int s = SIZE_OF_RESULT; long result = 0; while (--s >= 0) { result = (result<<8) | ((long)data[i++]); } pv.visit(buffer, bufferPosition, result); visitPatterns(pv,i,buffer,bufferPosition); }