public CharSequenceToUTF8 convert(CharSequence charSeq) { convert(charSeq, 0, charSeq.length()); return this; }
public CharSequenceToUTF8 convert(CharSequence charSeq) { convert(charSeq, 0, charSeq.length()); return this; }
public CharSequenceToUTF8 convert(CharSequence charSeq) { convert(charSeq, 0, charSeq.length()); return this; }
public StructBuilder removeFieldWithName(CharSequence name) { CharSequenceToUTF8 c = CharSequenceToUTF8Local.get().convert(name); int i = fieldCount; while (--i>=0) { byte[] field = fieldNames[i]; if (c.isEquals(field)) { //move it all down fieldCount--; //was this field on the end? if (i<fieldCount) { //value at location i must be removed System.arraycopy(fieldNames, i+1, fieldNames, i, fieldCount-i); System.arraycopy(fieldTypes, i+1, fieldTypes, i, fieldCount-i); System.arraycopy(fieldDims, i+1, fieldDims, i, fieldCount-i); } return this; } } throw new UnsupportedOperationException("Field "+name+" not found"); }
public StructBuilder removeFieldWithName(CharSequence name) { CharSequenceToUTF8 c = CharSequenceToUTF8Local.get().convert(name); int i = fieldCount; while (--i>=0) { byte[] field = fieldNames[i]; if (c.isEquals(field)) { //move it all down fieldCount--; //was this field on the end? if (i<fieldCount) { //value at location i must be removed System.arraycopy(fieldNames, i+1, fieldNames, i, fieldCount-i); System.arraycopy(fieldTypes, i+1, fieldTypes, i, fieldCount-i); System.arraycopy(fieldDims, i+1, fieldDims, i, fieldCount-i); } return this; } } throw new UnsupportedOperationException("Field "+name+" not found"); }
public StructBuilder removeFieldWithName(CharSequence name) { CharSequenceToUTF8 c = CharSequenceToUTF8Local.get().convert(name); int i = fieldCount; while (--i>=0) { byte[] field = fieldNames[i]; if (c.isEquals(field)) { //move it all down fieldCount--; //was this field on the end? if (i<fieldCount) { //value at location i must be removed System.arraycopy(fieldNames, i+1, fieldNames, i, fieldCount-i); System.arraycopy(fieldTypes, i+1, fieldTypes, i, fieldCount-i); System.arraycopy(fieldDims, i+1, fieldDims, i, fieldCount-i); } return this; } } throw new UnsupportedOperationException("Field "+name+" not found"); }
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; }
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; } } }
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; } } }
@Override public void useSerialStores(int instances, int largestBlock, String passphrase) { CharSequenceToUTF8 charSequenceToUTF8 = CharSequenceToUTF8Local.get(); SecureRandom sr = new SecureRandom(charSequenceToUTF8.convert(passphrase).asBytes()); charSequenceToUTF8.clear(); NoiseProducer noiseProducer = new NoiseProducer(sr); serialStoreReleaseAck = new Pipe[instances]; serialStoreReplay = new Pipe[instances]; serialStoreWriteAck = new Pipe[instances]; serialStoreRequestReplay = new Pipe[instances]; serialStoreWrite = new Pipe[instances]; int j = instances; while (--j>=0) { buildSerialStore(j, noiseProducer, largestBlock, SequentialReplayerImpl.File); } }
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 StructBuilder addField(CharSequence fieldName, StructType fieldType, int fieldDim, Object assoc) { if (fieldCount == fieldTypes.length) { fieldNames = grow(fieldNames); fieldTypes = grow(fieldTypes); fieldDims = grow(fieldDims); fieldAssoc = grow(fieldAssoc); } fieldNames[fieldCount] = CharSequenceToUTF8Local.get().convert(fieldName).asBytes(); fieldTypes[fieldCount] = fieldType; fieldDims[fieldCount] = fieldDim; fieldAssoc[fieldCount] = assoc; fieldCount++; return this; }
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) { byte[] tbytes = CharSequenceToUTF8Local.get().convert(targets[t]).append(" ").asBytes(); int targetId = (int)TrieParserReader.query(TrieParserReaderLocal.get(), privateTopicTarget, tbytes, 0, tbytes.length, Integer.MAX_VALUE); if (targetId<0) {
final byte[] textBytes = CharSequenceToUTF8Local.get().convert(value).asBytes();
public StructBuilder addField(CharSequence fieldName, StructType fieldType, int fieldDim, Object assoc, JSONRequired isRequired, Object validator) { if (fieldCount == fieldTypes.length) { fieldNames = grow(fieldNames); fieldTypes = grow(fieldTypes); fieldDims = grow(fieldDims); fieldAssoc = grow(fieldAssoc); fieldReq = grow(fieldReq); fieldValid = grow(fieldValid); } fieldNames[fieldCount] = CharSequenceToUTF8Local.get().convert(fieldName).asBytes(); fieldTypes[fieldCount] = fieldType; fieldDims[fieldCount] = fieldDim; fieldAssoc[fieldCount] = assoc; fieldReq[fieldCount] = isRequired; fieldValid[fieldCount] = validator; fieldCount++; return this; }
public StructBuilder addField(CharSequence fieldName, StructType fieldType, int fieldDim, Object assoc, JSONRequired isRequired, Object validator) { if (fieldCount == fieldTypes.length) { fieldNames = grow(fieldNames); fieldTypes = grow(fieldTypes); fieldDims = grow(fieldDims); fieldAssoc = grow(fieldAssoc); fieldReq = grow(fieldReq); fieldValid = grow(fieldValid); } fieldNames[fieldCount] = CharSequenceToUTF8Local.get().convert(fieldName).asBytes(); fieldTypes[fieldCount] = fieldType; fieldDims[fieldCount] = fieldDim; fieldAssoc[fieldCount] = assoc; fieldReq[fieldCount] = isRequired; fieldValid[fieldCount] = validator; fieldCount++; return this; }