/** * Opens the channel reader for reading from beginning of message * @return ChannelReader opened for reading or null if channel has no data */ public ChannelReader beginRead() { if (Pipe.hasContentToRead(pipe)) { Pipe.markTail(pipe); int msg = Pipe.takeMsgIdx(pipe); if (msg >= 0) { isReading = true; return Pipe.openInputStream(pipe); } } return null; }
/** * Opens the channel reader for reading from beginning of message * @return ChannelReader opened for reading or null if channel has no data */ public ChannelReader beginRead() { if (Pipe.hasContentToRead(pipe)) { Pipe.markTail(pipe); int msg = Pipe.takeMsgIdx(pipe); if (msg >= 0) { isReading = true; return Pipe.openInputStream(pipe); } } return null; }
/** * Opens the channel reader for reading from beginning of message * @return ChannelReader opened for reading or null if channel has no data */ public ChannelReader beginRead() { if (Pipe.hasContentToRead(pipe)) { Pipe.markTail(pipe); int msg = Pipe.takeMsgIdx(pipe); if (msg >= 0) { isReading = true; return Pipe.openInputStream(pipe); } } return null; }
int fieldContextFlags = Pipe.takeInt(input); DataInputBlobReader<NetResponseSchema> stream = Pipe.openInputStream(input); DataInputBlobReader<NetResponseSchema> host = Pipe.openInputStream(input); int port = Pipe.takeInt(input); DataInputBlobReader<NetResponseSchema> stream = Pipe.openInputStream(input);
&& ((listener instanceof PubSubListenerBase))) { if (! ((PubSubListenerBase)listener).message(topic.topic, Pipe.openInputStream(p))) { Pipe.resetTail(p); return;//continue later and repeat this same value. if (! methods[dispatch].method(listener, topic.topic, Pipe.openInputStream(p))) { Pipe.resetTail(p); return;//continue later and repeat this same value.
DataInputBlobReader<PersistedBlobLoadConsumerSchema> stream = Pipe.openInputStream(p);
int fieldSequence = Pipe.takeInt(input); int fieldVerb = Pipe.takeInt(input); DataInputBlobReader<HTTPRequestSchema> data = Pipe.openInputStream(input); int fieldRevision = Pipe.takeInt(input); int fieldRequestContext = Pipe.takeInt(input);
private void process(Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output) { while (Pipe.hasContentToRead(input)) { int msgIdx = Pipe.takeMsgIdx(input); switch(msgIdx) { case HTTPRequestSchema.MSG_RESTREQUEST_300: System.err.println("dummy rest request"); long fieldChannelId = Pipe.takeLong(input); int fieldSequence = Pipe.takeInt(input); int fieldVerb = Pipe.takeInt(input); DataInputBlobReader<HTTPRequestSchema> data = Pipe.openInputStream(input); int fieldRevision = Pipe.takeInt(input); int fieldRequestContext = Pipe.takeInt(input); HTTPUtil.publishStatus(fieldChannelId, fieldSequence, 501, output); Pipe.confirmLowLevelRead(input, Pipe.sizeOf(input, msgIdx)); Pipe.releaseReadLock(input); break; case -1: Pipe.publishEOF(output); break; } PipeReader.releaseReadLock(input); } }
ChannelReader reader = Pipe.openInputStream(input);
private void logRequestNow(Pipe<HTTPLogRequestSchema> p, Pipe<RawDataSchema> output) { int msgId = Pipe.takeMsgIdx(p); assert(msgId == HTTPLogRequestSchema.MSG_REQUEST_1); long timeNS = Pipe.takeLong(p); //time long chnl = Pipe.takeLong(p); //channelId int seq = Pipe.takeInt(p); //sequenceId DataInputBlobReader<HTTPLogRequestSchema> header = Pipe.openInputStream(p); //head //batch the writes.. int esitmate = 100+header.available(); batchMessages(output, esitmate); publishLogMessage(timeNS, chnl, seq, -1, BYTES_REQUEST, header, Pipe.outputStream(output)); Pipe.confirmLowLevelRead(p, Pipe.sizeOf(p, HTTPLogRequestSchema.MSG_REQUEST_1)); Pipe.releaseReadLock(p); }
DataInputBlobReader<PersistedBlobStoreProducerSchema> data = Pipe.openInputStream(toStoreProducer);
int verbId = HTTPVerb.MASK & routeVerb; HTTPRequestReader reader = (HTTPRequestReader)Pipe.openInputStream(p);
private void logResponseNow(Pipe<HTTPLogResponseSchema> p, Pipe<RawDataSchema> output) { int msgId = Pipe.takeMsgIdx(p); assert(msgId == HTTPLogResponseSchema.MSG_RESPONSE_1); long timeNS = Pipe.takeLong(p); //time long chnl = Pipe.takeLong(p); //channelId int seq = Pipe.takeInt(p); //sequenceId DataInputBlobReader<HTTPLogResponseSchema> header = Pipe.openInputStream(p); //head long durationNS = Pipe.takeLong(p); //batch the writes.. int esitmate = 100+header.available(); batchMessages(output, esitmate); publishLogMessage(timeNS, chnl, seq, durationNS, BYTES_RESPONSE, header, Pipe.outputStream(output)); Pipe.confirmLowLevelRead(p, Pipe.sizeOf(p, HTTPLogResponseSchema.MSG_RESPONSE_1)); Pipe.releaseReadLock(p); }
@Override public boolean begin(Pipe<HTTPRequestSchema> input) { int msgIdx = Pipe.takeMsgIdx(input); channelId = Pipe.takeLong(input); sequence = Pipe.takeInt(input); verb = Pipe.takeInt(input); DataInputBlobReader<HTTPRequestSchema> params = Pipe.openInputStream(input); StructuredReader reader = params.structured(); requestId = reader.readInt(WebFields.id); if (requestId>=0) { name = reader.readText(WebFields.name); } revision = Pipe.takeInt(input); context = Pipe.takeInt(input); Pipe.confirmLowLevelRead(input, Pipe.sizeOf(input, msgIdx)); Pipe.releaseReadLock(input); return true; }
ChannelReader inStream = Pipe.openInputStream(input); assert(inStream.isStructured());
private void process(Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output) { while (Pipe.hasContentToRead(input)) { int msgIdx = Pipe.takeMsgIdx(input); switch(msgIdx) { case HTTPRequestSchema.MSG_RESTREQUEST_300: long fieldChannelId = Pipe.takeLong(input); int fieldSequence = Pipe.takeInt(input); int fieldVerb = Pipe.takeInt(input); DataInputBlobReader<HTTPRequestSchema> data = Pipe.openInputStream(input); int fieldRevision = Pipe.takeInt(input); int fieldRequestContext = Pipe.takeInt(input); HTTPUtil.publishArrayResponse(fieldRequestContext, fieldSequence, 200, output, fieldChannelId, typeBytes, content); Pipe.confirmLowLevelRead(input, Pipe.sizeOf(input, msgIdx)); Pipe.releaseReadLock(input); break; case -1: Pipe.publishEOF(output); break; } PipeReader.releaseReadLock(input); } }
int fieldVerb = HTTPVerb.MASK & temp; DataInputBlobReader<HTTPRequestSchema> paramStream = Pipe.openInputStream(input);//param
DataInputBlobReader<HTTPRequestSchema> paramStream = Pipe.openInputStream(input);//param
assert(0==bucketCounts || count==bucketCounts) : "all inputs must agree on buckets count"; bucketCounts = Math.max(bucketCounts, count); Pipe.openInputStream(pipe); } else { shutDown = true;
return; } else { DataInputBlobReader<RawDataSchema> stream = Pipe.openInputStream(input);