public long fieldLookup(CharSequence sequence, int structId) { assert ((IS_STRUCT_BIT&structId) !=0 ) : "Struct Id must be passed in"; assert (structId>=0) : "Bad Struct ID "+structId; return TrieParserReader.query(TrieParserReaderLocal.get(), fields[STRUCT_MASK&structId], sequence); }
public long fieldLookup(CharSequence sequence, int struct) { assert ((IS_STRUCT_BIT&struct) !=0 ) : "Struct Id must be passed in"; TrieParserReader reader = TrieParserReaderLocal.get(); return TrieParserReader.query(reader, fields[STRUCT_MASK&struct], sequence); }
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); }
public long fieldLookup(CharSequence sequence, int structId) { assert ((IS_STRUCT_BIT&structId) !=0 ) : "Struct Id must be passed in"; assert (structId>=0) : "Bad Struct ID "+structId; return TrieParserReader.query(TrieParserReaderLocal.get(), fields[STRUCT_MASK&structId], sequence); }
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); }
public long fieldLookup(byte[] source, int pos, int len, int mask, int struct) { TrieParserReader reader = TrieParserReaderLocal.get(); return TrieParserReader.query(reader, fields[struct], source, pos, len, mask); }
private Pipe<FolderWatchSchema> lookupTargetPipe(String fileNameText) { final int fileIdx = (int)TrieParserReaderLocal.get().query(fileParser, fileNameText); return fileIdx<0 ? defaultOutput : output[fileIdx]; }
public static int lookupHostId(byte[] hostBytes, int pos, int length, int mask) { int result = (int)TrieParserReader.query(TrieParserReaderLocal.get(), domainRegistry, hostBytes, pos, length, mask); if (result<0) { throw new UnsupportedOperationException("Can not find host "+Appendables.appendUTF8(new StringBuilder(), hostBytes, pos, length, mask)+" pos:"+pos+" len:"+length+" mask:"+mask); } return result; }
public static String buildTrackTopic(final CharSequence baseTopic, final byte[] track) { if (null != track) { if (hasNoUnscopedTopics()) {//normal case where topics are scoped return baseTopic+new String(track); } else { //if scoped then add suffix if ((-1 == TrieParserReaderLocal.get().query(unScopedTopics, baseTopic))) { return baseTopic+new String(track); } } } return baseTopic.toString(); }
private static void unScopedCheckForTrack(MsgCommandChannel cmd, DataOutputBlobWriter<MessagePubSub> output) { boolean addSuffix=false; addSuffix = BuilderImpl.notUnscoped(TrieParserReaderLocal.get(), output); if (addSuffix) { output.write(cmd.track); } }
private List<PrivateTopic> privateTopicsFromConsumer(String target) { List<PrivateTopic> localTargetTopics = null; byte[] tbytes = CharSequenceToUTF8Local.get().convert(target).append(" ").asBytes(); int targetId = (int)TrieParserReader.query(TrieParserReaderLocal.get(), privateTopicTarget, tbytes, 0, tbytes.length, Integer.MAX_VALUE); if (targetId<0) { localTargetTopics = new ArrayList<PrivateTopic>(); //logger.info("record target '{}'",target); privateTopicTarget.setValue(tbytes, targetId = privateTargetTopics.size()); privateTargetTopics.add(localTargetTopics); } else { localTargetTopics = privateTargetTopics.get(targetId); } return localTargetTopics; }
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; }
public List<PrivateTopic> getPrivateTopicsFromTarget(String target) { byte[] bytes = CharSequenceToUTF8Local.get().convert(target).append(" ").asBytes(); int targetId = (int)TrieParserReader.query(TrieParserReaderLocal.get(), privateTopicTarget, bytes, 0, bytes.length, Integer.MAX_VALUE); List<PrivateTopic> result = (targetId<0) ? Collections.EMPTY_LIST: privateTargetTopics.get(targetId); return result; }
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; }
public void possiblePrivateTopicProducer(BehaviorNameable producer, String topic, int track) { //do not want to confuse all the tracks while looking for private topics, we only look at no track and first track if (track<=0) { int id = (int)TrieParserReaderLocal.get().query(possibleTopics, topic); if (-1 == id) { growPossiblePrivateTopics(); possiblePrivateCmds[possiblePrivateTopicsCount] = producer; possiblePrivateTopicsTopic[possiblePrivateTopicsCount]=topic; possiblePrivateTopicsProducerCount[possiblePrivateTopicsCount]++; possibleTopics.setUTF8Value(topic, possiblePrivateTopicsCount++); } else { //only record once for same channel and topic pair if (producer != possiblePrivateCmds[id]) { possiblePrivateCmds[id] = producer; possiblePrivateTopicsProducerCount[id]++; } } } }
private void parseExtractionPath(String extractionPath) { JSONExtractorActive running = this; TrieParserReader trieParserReader = TrieParserReaderLocal.get(); CharSequenceToUTF8Local.get() .convert(extractionPath) .append(".") .parseSetup(trieParserReader); int token = 0; while ((token = (int)trieParserReader.parseNext(parser)) != -1) { switch(token) { case keyToken: path.add(TrieParserReader.capturedFieldBytesAsUTF8(trieParserReader, 0, new StringBuilder())); break; case dotToken: break; case arrayToken: path.add("[]"); break; } } }
public int lookupId(CharSequence text) { //adds new one if it is not found. long idx = TrieParserReader.query(TrieParserReaderLocal.get(), parser, text); if (idx < 0) { idx = ++totalCount; int hashVal = JSONStreamParser.toValue((int)idx); parser.setUTF8Value(text, hashVal); //This pattern may cause an alt check of string capture //NOTE: this is only true for the keys parser.setUTF8Value("\"", text, "\"", hashVal); //logger.info("added token {} with value {} to parser", value, hashVal); } else { idx = JSONStreamParser.fromValue((int)idx); } return (int)idx; }
public int lookupId(CharSequence text) { //adds new one if it is not found. long idx = TrieParserReader.query(TrieParserReaderLocal.get(), parser, text); if (idx < 0) { idx = ++totalCount; int hashVal = JSONStreamParser.toValue((int)idx); parser.setUTF8Value(text, hashVal); //This pattern may cause an alt check of string capture //NOTE: this is only true for the keys parser.setUTF8Value("\"", text, "\"", hashVal); //logger.info("added token {} with value {} to parser", value, hashVal); } else { idx = JSONStreamParser.fromValue((int)idx); } return (int)idx; }
public int lookupId(CharSequence text) { //adds new one if it is not found. long idx = TrieParserReader.query(TrieParserReaderLocal.get(), parser, text); if (idx < 0) { idx = ++totalCount; int hashVal = JSONStreamParser.toValue((int)idx); parser.setUTF8Value(text, hashVal); //This pattern may cause an alt check of string capture //NOTE: this is only true for the keys parser.setUTF8Value("\"", text, "\"", hashVal); //logger.info("added token {} with value {} to parser", value, hashVal); } else { idx = JSONStreamParser.fromValue((int)idx); } return (int)idx; }
@Override public void startup() { //load log file and parse out all the telemetry snapshots... lineParser = new TrieParser(); lineParser.setUTF8Value("greenlightning: digraph gl {\n", 1); lineParser.setUTF8Value("digraph gl {\n", 1); lineParser.setUTF8Value("greenlightning: }\n", 2); lineParser.setUTF8Value("}\n", 2); lineParser.setUTF8Value("greenlightning: %b\n", 3); lineParser.setUTF8Value("%b\n", 3); reader = TrieParserReaderLocal.get(); logFileInput = Pipe.inputStream(logFile); //start // [8:RProxy] INFO com.ociweb.pronghorn.stage.scheduling.GraphManager - // 20181212215745711.dot // digraph gl { //body //stop // } }