public HTTPHeaderDateTimeFormatterLowGC() { HTTP_HEADER_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss"; SECONDS_OFFSET = 23; //where the seconds begin SECONDS_LENGTH = 2; //where the seconds ends formatter = DateTimeFormatter .ofPattern(HTTP_HEADER_DATE_FORMAT) .withZone( ZoneOffset.UTC ); temp = RawDataSchema.instance.newPipe(2, 32); temp.initBuffers(); }
public ISOTimeFormatterLowGC(boolean fileNameSafe) { if (fileNameSafe) { YYYY_MM_DD_HH_MM_SS_SSS_Z = "yyyyMMddHHmmssSSS"; SECONDS_OFFSET = 12; //where the seconds begin SECONDS_LENGTH = 5; //where the seconds begin SECONDS_PLACES = 0; //sub second places of accuracy (always negative) } else { YYYY_MM_DD_HH_MM_SS_SSS_Z = "yyyy-MM-dd HH:mm:ss.SSS z"; SECONDS_OFFSET = 17; //where the seconds begin SECONDS_LENGTH = 6; //where the seconds begin SECONDS_PLACES = -3; //sub second places of accuracy (always negative) } formatter = DateTimeFormatter .ofPattern(YYYY_MM_DD_HH_MM_SS_SSS_Z) .withZone( ZoneOffset.UTC ); temp = RawDataSchema.instance.newPipe(2, 32); temp.initBuffers(); }
public ISOTimeFormatterLowGC(boolean fileNameSafe) { if (fileNameSafe) { YYYY_MM_DD_HH_MM_SS_SSS_Z = "yyyyMMddHHmmssSSS"; SECONDS_OFFSET = 12; //where the seconds begin SECONDS_LENGTH = 5; //where the seconds begin SECONDS_PLACES = 0; //sub second places of accuracy (always negative) } else { YYYY_MM_DD_HH_MM_SS_SSS_Z = "yyyy-MM-dd HH:mm:ss.SSS z"; SECONDS_OFFSET = 17; //where the seconds begin SECONDS_LENGTH = 6; //where the seconds begin SECONDS_PLACES = -3; //sub second places of accuracy (always negative) } formatter = DateTimeFormatter .ofPattern(YYYY_MM_DD_HH_MM_SS_SSS_Z) .withZone( ZoneOffset.UTC ); temp = RawDataSchema.instance.newPipe(2, 32); temp.initBuffers(); }
public ISOTimeFormatterLowGC(boolean fileNameSafe) { if (fileNameSafe) { YYYY_MM_DD_HH_MM_SS_SSS_Z = "yyyyMMddHHmmssSSS"; SECONDS_OFFSET = 12; //where the seconds begin SECONDS_LENGTH = 5; //where the seconds begin SECONDS_PLACES = 0; //sub second places of accuracy (always negative) } else { YYYY_MM_DD_HH_MM_SS_SSS_Z = "yyyy-MM-dd HH:mm:ss.SSS z"; SECONDS_OFFSET = 17; //where the seconds begin SECONDS_LENGTH = 6; //where the seconds begin SECONDS_PLACES = -3; //sub second places of accuracy (always negative) } formatter = DateTimeFormatter .ofPattern(YYYY_MM_DD_HH_MM_SS_SSS_Z) .withZone( ZoneOffset.UTC ); temp = RawDataSchema.instance.newPipe(2, 32); temp.initBuffers(); }
public OAuth1HeaderBuilder(int port, String scheme, String host, String path) { try { this.mac = Mac.getInstance("HmacSHA1"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } consumerKeyBuilder.setLength(0); this.addMACParam(OAUTH_CONSUMER_KEY,consumerKeyBuilder); this.addMACParam(OAUTH_NONCE,nonceBuilder); this.addMACParam(OAUTH_SIGNATURE_METHOD,"HMAC-SHA1"); this.addMACParam(OAUTH_TIMESTAMP,timeBuilder); this.addMACParam(OAUTH_VERSION,"1.0"); tokenBuilder.setLength(0); this.addMACParam(OAUTH_TOKEN,tokenBuilder); callbackBuilder.setLength(0); this.addMACParam(OAUTH_CALLBACK, callbackBuilder); verifierBuilder.setLength(0); this.addMACParam(OAUTH_VERIFIER, verifierBuilder); this.workingPipe = RawDataSchema.instance.newPipe(2, 1000); this.workingPipe.initBuffers(); this.formalPath = buildFormalPath(port, scheme, host, path); }
public int setUTF8Value(CharSequence prefix, CharSequence cs, CharSequence suffix, long value) { if (((prefix.length() + cs.length() + suffix.length()) << 3) > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,suffix.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, 0); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = 0; len += Pipe.copyUTF8ToByte(prefix, 0, prefix.length(), workingPipe); len += Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); len += Pipe.copyUTF8ToByte(suffix, 0, suffix.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public int setUTF8Value(CharSequence prefix, CharSequence cs, CharSequence suffix, long value) { if (((prefix.length() + cs.length() + suffix.length()) << 3) > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,suffix.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, 0); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = 0; len += Pipe.copyUTF8ToByte(prefix, 0, prefix.length(), workingPipe); len += Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); len += Pipe.copyUTF8ToByte(suffix, 0, suffix.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public int setUTF8Value(CharSequence prefix, CharSequence cs, CharSequence suffix, long value) { if (((prefix.length() + cs.length() + suffix.length()) << 3) > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,suffix.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, 0); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = 0; len += Pipe.copyUTF8ToByte(prefix, 0, prefix.length(), workingPipe); len += Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); len += Pipe.copyUTF8ToByte(suffix, 0, suffix.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public int setUTF8Value(CharSequence cs, CharSequence suffix, long value) { if ((cs.length()+suffix.length())<<3 > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,suffix.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, 0); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = 0; len += Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); len += Pipe.copyUTF8ToByte(suffix, 0, suffix.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public int setUTF8Value(CharSequence cs, CharSequence suffix, long value) { if ((cs.length()+suffix.length())<<3 > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,suffix.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, 0); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = 0; len += Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); len += Pipe.copyUTF8ToByte(suffix, 0, suffix.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public int setUTF8Value(CharSequence cs, CharSequence suffix, long value) { if ((cs.length()+suffix.length())<<3 > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,suffix.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, 0); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = 0; len += Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); len += Pipe.copyUTF8ToByte(suffix, 0, suffix.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
private ConsoleJSONDumpStage buildGraph2(String blockFilePath, File tempFile, StringBuilder results, GraphManager gm2) { Pipe<RawDataSchema> encryptedDataPipe2 = RawDataSchema.instance.newPipe(10, 1000); Pipe<RawDataSchema> resultDataPipe2 = RawDataSchema.instance.newPipe(10, 1000); Pipe<BlockStorageReceiveSchema> doFinalInput3 = BlockStorageReceiveSchema.instance.newPipe(10, 1000); Pipe<BlockStorageXmitSchema> doFinalOutput3 = BlockStorageXmitSchema.instance.newPipe(10, 1000); BlockStorageStage.newInstance(gm2, blockFilePath, doFinalOutput3, doFinalInput3); results.setLength(0); results.append("single large message: "); FileBlobReadStage read= new FileBlobReadStage(gm2, encryptedDataPipe2, tempFile.getAbsolutePath()); RawDataCryptAESCBCPKCS5Stage decrypt2 = new RawDataCryptAESCBCPKCS5Stage(gm2, pass, false, encryptedDataPipe2, resultDataPipe2, doFinalInput3, doFinalOutput3 ); ConsoleJSONDumpStage lastStage2 = ConsoleJSONDumpStage.newInstance(gm2, resultDataPipe2, results, true); return lastStage2; }
public int setUTF8Value(CharSequence cs, long value) { if (cs.length()<<3 > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,cs.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public static long query(TrieParserReader reader, TrieParser trie, CharSequence cs) { if ((cs.length()*6) > reader.workingPipe.maxVarLen) { reader.workingPipe = RawDataSchema.instance.newPipe(2,cs.length()*6); reader.workingPipe.initBuffers(); } Pipe.addMsgIdx(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); int origPos = Pipe.getWorkingBlobHeadPosition(reader.workingPipe); int len = Pipe.copyUTF8ToByte(cs, 0, cs.length(), reader.workingPipe); Pipe.addBytePosAndLen(reader.workingPipe, origPos, len); Pipe.publishWrites(reader.workingPipe); Pipe.confirmLowLevelWrite(reader.workingPipe, Pipe.sizeOf(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); /// Pipe.takeMsgIdx(reader.workingPipe); long result = TrieParserReader.query(reader,trie,reader.workingPipe,-1); Pipe.confirmLowLevelRead(reader.workingPipe, Pipe.sizeOf(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.releaseReadLock(reader.workingPipe); return result; }
public static long query(TrieParserReader reader, TrieParser trie, CharSequence cs) { if ((cs.length()*6) > reader.workingPipe.maxVarLen) { reader.workingPipe = RawDataSchema.instance.newPipe(2,cs.length()*6); reader.workingPipe.initBuffers(); } Pipe.addMsgIdx(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); int origPos = Pipe.getWorkingBlobHeadPosition(reader.workingPipe); int len = Pipe.copyUTF8ToByte(cs, 0, cs.length(), reader.workingPipe); Pipe.addBytePosAndLen(reader.workingPipe, origPos, len); Pipe.publishWrites(reader.workingPipe); Pipe.confirmLowLevelWrite(reader.workingPipe, Pipe.sizeOf(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); /// Pipe.takeMsgIdx(reader.workingPipe); long result = TrieParserReader.query(reader,trie,reader.workingPipe,-1); Pipe.confirmLowLevelRead(reader.workingPipe, Pipe.sizeOf(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.releaseReadLock(reader.workingPipe); return result; }
public static long query(TrieParserReader reader, TrieParser trie, CharSequence cs) { if ((cs.length()*6) > reader.workingPipe.maxVarLen) { reader.workingPipe = RawDataSchema.instance.newPipe(2,cs.length()*6); reader.workingPipe.initBuffers(); } Pipe.addMsgIdx(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); int origPos = Pipe.getWorkingBlobHeadPosition(reader.workingPipe); int len = Pipe.copyUTF8ToByte(cs, 0, cs.length(), reader.workingPipe); Pipe.addBytePosAndLen(reader.workingPipe, origPos, len); Pipe.publishWrites(reader.workingPipe); Pipe.confirmLowLevelWrite(reader.workingPipe, Pipe.sizeOf(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); /// Pipe.takeMsgIdx(reader.workingPipe); long result = TrieParserReader.query(reader,trie,reader.workingPipe,-1); Pipe.confirmLowLevelRead(reader.workingPipe, Pipe.sizeOf(reader.workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.releaseReadLock(reader.workingPipe); return result; }
public int setUTF8Value(CharSequence cs, long value) { if (cs.length()<<3 > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,cs.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public int setUTF8Value(CharSequence cs, long value) { if (cs.length()<<3 > workingPipe.maxVarLen) { workingPipe = RawDataSchema.instance.newPipe(2,cs.length()); workingPipe.initBuffers(); } Pipe.addMsgIdx(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); int origPos = Pipe.getWorkingBlobHeadPosition(workingPipe); int len = Pipe.copyUTF8ToByte(cs, 0, cs.length(), workingPipe); Pipe.addBytePosAndLen(workingPipe, origPos, len); Pipe.publishWrites(workingPipe); Pipe.confirmLowLevelWrite(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.takeMsgIdx(workingPipe); setValue(workingPipe, value); Pipe.confirmLowLevelRead(workingPipe, Pipe.sizeOf(workingPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); //WARNING: this is not thread safe if set is called and we have not yet parsed!! Pipe.releaseReadLock(workingPipe); return len; }
public static void main(String[] args) { String inputPathString = "<some file name>"; GraphManager gm = new GraphManager(); Pipe<RawDataSchema> output = RawDataSchema.instance.newPipe(10, 2000); new FileBlobReadStage(gm, output, inputPathString); ParseInput done = new ParseInput(gm, output); StageScheduler s = StageScheduler.defaultScheduler(gm); s.startup(); GraphManager.blockUntilStageBeginsShutdown(gm, done); }
int tokenForPrivateTopic(TopicWritable topic) { if (null==publishPrivateTopics) { return -1; } if (null==tempTopicPipe) { tempTopicPipe = RawDataSchema.instance.newPipe(2, maxDynamicTopicLength); tempTopicPipe.initBuffers(); } int size = Pipe.addMsgIdx(tempTopicPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); DataOutputBlobWriter<RawDataSchema> output = Pipe.openOutputStream(tempTopicPipe); topic.write(output); DataOutputBlobWriter.closeLowLevelField(output); Pipe.confirmLowLevelWrite(tempTopicPipe, size); Pipe.publishWrites(tempTopicPipe); Pipe.takeMsgIdx(tempTopicPipe); int token = publishPrivateTopics.getToken(tempTopicPipe); Pipe.confirmLowLevelRead(tempTopicPipe, size); Pipe.releaseReadLock(tempTopicPipe); return token; }