private void releaseOpenRead() { //log.trace("release block"); Pipe.confirmLowLevelRead(pipe, MSG_SIZE); Pipe.releaseReadLock(pipe); hasOpenRead = false; }
private void releaseOpenRead() { //log.trace("release block"); Pipe.confirmLowLevelRead(pipe, MSG_SIZE); Pipe.releaseReadLock(pipe); hasOpenRead = false; }
@Override public void visitSequenceOpen(String name, long id, int length) { int tempLen; if ((tempLen=Pipe.takeInt(expectedInput))!=length) { throw new AssertionError("expected length: "+Long.toHexString(tempLen)+" but got "+Long.toHexString(length)); } needsClose = false; Pipe.confirmLowLevelRead(expectedInput, Pipe.sizeOf(expectedInput, activeCursor)); Pipe.releaseReadLock(expectedInput); }
@Override public void visitSequenceOpen(String name, long id, int length) { int tempLen; if ((tempLen=Pipe.takeInt(expectedInput))!=length) { throw new AssertionError("expected length: "+Long.toHexString(tempLen)+" but got "+Long.toHexString(length)); } needsClose = false; Pipe.confirmLowLevelRead(expectedInput, Pipe.sizeOf(expectedInput, activeCursor)); Pipe.releaseReadLock(expectedInput); }
@Override public void visitSequenceOpen(String name, long id, int length) { int tempLen; if ((tempLen=Pipe.takeInt(expectedInput))!=length) { throw new AssertionError("expected length: "+Long.toHexString(tempLen)+" but got "+Long.toHexString(length)); } needsClose = false; Pipe.confirmLowLevelRead(expectedInput, Pipe.sizeOf(expectedInput, activeCursor)); Pipe.releaseReadLock(expectedInput); }
@Override public void visitTemplateClose(String name, long id) { if (needsClose) { needsClose = false; Pipe.confirmLowLevelRead(expectedInput, Pipe.sizeOf(expectedInput, activeCursor)); Pipe.releaseReadLock(expectedInput); } }
@Override public void visitFragmentClose(String name, long id) { if (needsClose) { needsClose = false; Pipe.confirmLowLevelRead(expectedInput, Pipe.sizeOf(expectedInput, activeCursor)); Pipe.releaseReadLock(expectedInput); } }
@Override public void visitTemplateClose(String name, long id) { if (needsClose) { needsClose = false; Pipe.confirmLowLevelRead(expectedInput, Pipe.sizeOf(expectedInput, activeCursor)); Pipe.releaseReadLock(expectedInput); } }
/** * Move position forward. ChanelReader is invalid and beginRead() must be called again. */ public void commitRead() { if (isReading) { Pipe.confirmLowLevelRead(pipe, Pipe.sizeOf(RawDataSchema.instance,RawDataSchema.MSG_CHUNKEDSTREAM_1)); Pipe.releaseReadLock(pipe); } isReading = false; }
private int endRemainingContent(byte[] targetData, int targetOffset) { //the entire remaining part of the block can be sent int len = remainingSourceLength; copyData(targetData, targetOffset, len, byteBackingArray(remainingSourceMeta, pipe), remainingSourceOffset); Pipe.confirmLowLevelRead(pipe, recordSize); Pipe.releaseReadLock(pipe); remainingSourceLength = -1; //clear because we are now done with the remaining content return len; }
private int endRemainingContent(byte[] targetData, int targetOffset) { //the entire remaining part of the block can be sent int len = remainingSourceLength; copyData(targetData, targetOffset, len, byteBackingArray(remainingSourceMeta, pipe), remainingSourceOffset); Pipe.confirmLowLevelRead(pipe, recordSize); Pipe.releaseReadLock(pipe); remainingSourceLength = -1; //clear because we are now done with the remaining content return len; }
private void detectShutdownInProgress() { if (Pipe.peekMsg(primaryIn, -1)) { //shutdown in progress so give up waiting Pipe.takeMsgIdx(primaryIn); Pipe.confirmLowLevelRead(primaryIn, Pipe.EOF_SIZE); Pipe.releaseReadLock(primaryIn); shutdownInProgress = true; } }
public static <S extends MessageSchema<S>> int readI(Pipe<S> pipe) { int msgIdx = Pipe.takeMsgIdx(pipe); assert(3==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size"; int value = Pipe.takeInt(pipe); Pipe.confirmLowLevelRead(pipe, 3); Pipe.releaseReadLock(pipe); return value; }
public static <S extends MessageSchema<S>> int readI(Pipe<S> pipe) { int msgIdx = Pipe.takeMsgIdx(pipe); assert(3==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size"; int value = Pipe.takeInt(pipe); Pipe.confirmLowLevelRead(pipe, 3); Pipe.releaseReadLock(pipe); return value; }
public static <S extends MessageSchema<S>> long readL(Pipe<S> pipe) { int msgIdx = Pipe.takeMsgIdx(pipe); assert(3==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size"; long value = Pipe.takeLong(pipe); Pipe.confirmLowLevelRead(pipe, 3); Pipe.releaseReadLock(pipe); return value; }
public static <S extends MessageSchema<S>> long readL(Pipe<S> pipe) { int msgIdx = Pipe.takeMsgIdx(pipe); assert(3==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size"; long value = Pipe.takeLong(pipe); Pipe.confirmLowLevelRead(pipe, 3); Pipe.releaseReadLock(pipe); return value; }
private void writeBegin(Pipe<NetPayloadSchema> pipe) { int msgIdx = Pipe.takeMsgIdx(pipe); int seq = Pipe.takeInt(pipe); Pipe.confirmLowLevelRead(pipe, Pipe.sizeOf(pipe, NetPayloadSchema.MSG_BEGIN_208)); Pipe.releaseReadLock(pipe); }
public static void appendNextFieldToReader(LittleEndianDataInputBlobReader reader, Pipe<RawDataSchema> targetPipe) { while (Pipe.hasContentToRead(targetPipe) && Pipe.peekInt(targetPipe) >=0) { Pipe.takeMsgIdx(targetPipe); accumLowLevelAPIField(reader); Pipe.readNextWithoutReleasingReadLock(targetPipe); Pipe.confirmLowLevelRead(targetPipe, Pipe.sizeOf(targetPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); } }
public static long blobQuery(TrieParserReader reader, TrieParser trie) { Pipe.outputStream(reader.workingPipe).closeLowLevelField(); 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 blobQuery(TrieParserReader reader, TrieParser trie) { Pipe.outputStream(reader.workingPipe).closeLowLevelField(); 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; }