public static void capturedFieldSetValue(TrieParserReader reader, int idx, TrieParser trie, long value) { int pos = idx*4; assert(pos < reader.capturedValues.length) : "Either the idx argument is too large or TrieParseReader was not constructed to hold this many fields"; int type = reader.capturedValues[pos++]; assert(type==0); int bpos = reader.capturedValues[pos++]; int blen = reader.capturedValues[pos++]; int bmsk = reader.capturedValues[pos++]; trie.setValue(reader.capturedBlobArray, bpos, blen, bmsk, value); }
public static void capturedFieldSetValue(TrieParserReader reader, int idx, TrieParser trie, long value) { int pos = idx*4; assert(pos < reader.capturedValues.length) : "Either the idx argument is too large or TrieParseReader was not constructed to hold this many fields"; int type = reader.capturedValues[pos++]; assert(type==0); int bpos = reader.capturedValues[pos++]; int blen = reader.capturedValues[pos++]; int bmsk = reader.capturedValues[pos++]; trie.setValue(reader.capturedBlobArray, bpos, blen, bmsk, value); }
public GreenTokenMap addTemplate(long id, byte[] template, int offset, int length, int mask) { tp.setValue(template, offset, length, mask, id); return this; }
public GreenTokenMap addTemplate(long id, byte[] template, int offset, int length) { tp.setValue(template, offset, length, Integer.MAX_VALUE, id); return this; }
private static TrieParser literalParser() { TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.number, NUMBER_ID); trie.setValue(JSONConstants.falseLiteral, FALSE_ID); trie.setValue(JSONConstants.nullLiteral, NULL_ID); trie.setValue(JSONConstants.trueLiteral, TRUE_ID); return trie; }
private static TrieParser stringBeginParser() { //TODO: double check that slash and " if appearing inside UTF8 encoding do not get picked up as an escape.. TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.string221, STRING_PART | 0x2200); trie.setValue(JSONConstants.string222, STRING_END | 0x2200); return trie; }
private static TrieParser stringBeginParser() { //TODO: double check that slash and " if appearing inside UTF8 encoding do not get picked up as an escape.. TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.string221, STRING_PART | 0x2200); trie.setValue(JSONConstants.string222, STRING_END | 0x2200); return trie; }
private static TrieParser stringBeginParser() { //TODO: double check that slash and " if appearing inside UTF8 encoding do not get picked up as an escape.. TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.string221, STRING_PART | 0x2200); trie.setValue(JSONConstants.string222, STRING_END | 0x2200); return trie; }
private static TrieParser structureNameSeparatorParser() { TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.nameSeparator, NAME_SEPARATOR); return trie; }
private static TrieParser structureNameSeparatorParser() { TrieParser trie = new TrieParser(256,1,false,true); trie.setValue(JSONConstants.nameSeparator, NAME_SEPARATOR); return trie; }
public int valueOf(byte[] data, int offset, int length, int mask) { int value = (int)TrieParserReader.query(reader, trie, data, offset, length, mask, -1); if (value>0) { return value; } else { trie.setValue(data, offset, length, mask, ++squenceCount); return squenceCount; } }
@Override public void store(Pipe<RawDataSchema> pipe) { if (showAllInserts) { System.out.println(" map.setUTF8Value(\""+pipe.peekInputStream(pipe, 0).readUTFFully()+"\","+activePathId+");"); } //set full byte field in pipe to map with the key routeValue //this is the converted to tri parser format text value routerMap.setValue(pipe, activePathId); }
private void storeNewFileData(TrieParser trie, final int rootSize, StringBuilder builder, int newPathId, byte[] asBytes, final int bytesLength, int typeId, FileChannel activeFileChannel) throws IOException { long fileSize = activeFileChannel.size(); trie.setValue(asBytes, rootSize, bytesLength, Integer.MAX_VALUE, newPathId); builder.setLength(0); data.getType()[newPathId] = typeId; data.getFcId()[newPathId] = channelHolder.add(activeFileChannel); data.getEtagBytes()[newPathId] = Appendables.appendHexDigits(builder, data.getFcId()[newPathId]).toString().getBytes(); data.getFileSizes()[newPathId] = fileSize; builder.setLength(0); }
private List<PrivateTopic> privateTopicsFromProducer(String source) { List<PrivateTopic> localSourceTopics = null; byte[] bytes = CharSequenceToUTF8Local.get().convert(source).append(" ").asBytes(); int sourceId = (int)TrieParserReader.query(TrieParserReaderLocal.get(), privateTopicSource, bytes, 0, bytes.length, Integer.MAX_VALUE); if (sourceId<0) { localSourceTopics = new ArrayList<PrivateTopic>(); privateTopicSource.setValue(bytes, sourceId = privateSourceTopics.size()); privateSourceTopics.add(localSourceTopics); } else { localSourceTopics = privateSourceTopics.get(sourceId); } return localSourceTopics; }