/** * If batch is not yet full this new publish is stored else this is added and released with the rest * @param pipe Pipe target * @param blobTail int blobTail position to release * @param slabTail int slabTail postiion to release */ public static <S extends MessageSchema<S>> void batchedReleasePublish(Pipe<S> pipe, int blobTail, long slabTail) { assert(null==pipe.ringWalker || pipe.ringWalker.cursor<=0 && !PipeReader.isNewMessage(pipe.ringWalker)) : "Unsupported mix of high and low level API. "; releaseBatchedReads(pipe, blobTail, slabTail); }
/** * If batch is not yet full this new publish is stored else this is added and released with the rest * @param pipe Pipe target * @param blobTail int blobTail position to release * @param slabTail int slabTail postiion to release */ public static <S extends MessageSchema<S>> void batchedReleasePublish(Pipe<S> pipe, int blobTail, long slabTail) { assert(null==pipe.ringWalker || pipe.ringWalker.cursor<=0 && !PipeReader.isNewMessage(pipe.ringWalker)) : "Unsupported mix of high and low level API. "; releaseBatchedReads(pipe, blobTail, slabTail); }
/** * If batch is not yet full this new publish is stored else this is added and released with the rest * @param pipe Pipe target * @param blobTail int blobTail position to release * @param slabTail int slabTail postiion to release */ public static <S extends MessageSchema<S>> void batchedReleasePublish(Pipe<S> pipe, int blobTail, long slabTail) { assert(null==pipe.ringWalker || pipe.ringWalker.cursor<=0 && !PipeReader.isNewMessage(pipe.ringWalker)) : "Unsupported mix of high and low level API. "; releaseBatchedReads(pipe, blobTail, slabTail); }
private boolean dataToRead(long[] counts) { int msgIdx = 0; boolean data = false; while (PipeReader.tryReadFragment(input)) { if (PipeReader.isNewMessage(input)) { msgIdx = PipeReader.getMsgIdx(input); if (msgIdx<0) { PipeReader.releaseReadLock(input); requestShutdown(); break; } else { counts[msgIdx]++; data = true; } } totalBytes += (PipeReader.sizeOfFragment(input)*4) + PipeReader.bytesConsumedByFragment(input); //logger.info("reading new input total bytes :"+totalBytes); PipeReader.releaseReadLock(input); } return data; }
assert(PipeReader.isNewMessage(inputRing)) : "This test should only have one simple message made up of one fragment"; int msgId = PipeReader.getMsgIdx(inputRing);
if (msgId<0) { if (PipeReader.tryReadFragment(inputRing)) { assert(PipeReader.isNewMessage(inputRing)) : "This test should only have one simple message made up of one fragment"; msgId = PipeReader.getMsgIdx(inputRing); } else {
assertTrue(PipeReader.isNewMessage(fieldsRing));
assert(PipeReader.isNewMessage(stage.inputRing)) : "There are no multi fragment message found in the MetaFields";