/** * check if connection data can take another message * @return true if there is room for another write */ public boolean hasRoomForWrite() { return Pipe.hasRoomForWrite(pipe); }
public static boolean hasRoomForEOF(Pipe<NetPayloadSchema>[] output) { //all outputs must have room for EOF processing int i = output.length; while (--i>=0) { if (!Pipe.hasRoomForWrite(output[i])) { return false; } } return true; }
/** * check if connection data can take another message * @return true if there is room for another write */ public boolean hasRoomForWrite() { return Pipe.hasRoomForWrite(pipe); }
private boolean allHaveRoomToWrite(Pipe<ColumnSchema<M>>[] columnPipeOutput) { int i = columnPipeOutput.length; while (--i>=0) { if (!Pipe.hasRoomForWrite(columnPipeOutput[i])) { return false; } } return true; }
/** * check if connection data can take another message * @return true if there is room for another write */ public boolean hasRoomForWrite() { return Pipe.hasRoomForWrite(pipe); }
private boolean allHaveRoomToWrite(Pipe<ColumnSchema<M>>[] columnPipeOutput) { int i = columnPipeOutput.length; while (--i>=0) { if (!Pipe.hasRoomForWrite(columnPipeOutput[i])) { return false; } } return true; }
@Deprecated public static <S extends MessageSchema<S>> boolean roomToLowLevelWrite(Pipe<S> pipe, int size) { return hasRoomForWrite(pipe, size); }
private boolean hasRoomToPersist() { boolean result = Pipe.hasRoomForWrite(persistBlobStoreConsumer)&&Pipe.hasRoomForWrite(persistBlobStoreProducer); if ((!result) & (Integer.numberOfLeadingZeros(countOfPersistStoreBlocks) != Integer.numberOfLeadingZeros(++countOfPersistStoreBlocks))) { logger.info("Warning: encoding blocked {} times waiting to persist store ",countOfPersistStoreBlocks); } return result; }
@Override public void run() { int i = inputs.length; while (Pipe.hasRoomForWrite(clientRequestsPipe) && --i>=0) { sendRequest(inputs[i], clientRequestsPipe); } }
private boolean openForWrite() { writePrep(); if (Pipe.hasRoomForWrite(pipe)) { return beginNewWrite(); } return false; }
/** * * @param messageCount number of messages */ public boolean hasRoomFor(int messageCount) { return null==msgCommandChannel.goPipe || Pipe.hasRoomForWrite(msgCommandChannel.goPipe, FieldReferenceOffsetManager.maxFragmentSize(Pipe.from(msgCommandChannel.goPipe))*messageCount); }
private boolean sendError(final long channel, final int idx, int errorCode) { boolean sent = false; if (Pipe.hasRoomForWrite(errorResponsePipe)) { //will close connection as soon as error is returned. HTTPUtil.publishStatus(channel, sequences[idx], errorCode, errorResponsePipe); sequences[idx]++; sent = true; } sendRelease(channel, idx); return sent; }
private boolean openForWrite() { writePrep(); if (Pipe.hasRoomForWrite(pipe)) { return beginNewWrite(); } return false; }
/** * * @param messageCount number to be multiplied by msgCommandChannel.httpRequest * @return has room */ public boolean hasRoomFor(int messageCount) { assert(msgCommandChannel.httpRequest!=null) : "Client side HTTP Request must be enabled"; return Pipe.hasRoomForWrite(msgCommandChannel.httpRequest, FieldReferenceOffsetManager.maxFragmentSize( Pipe.from(msgCommandChannel.httpRequest))*messageCount); }
private boolean openForWrite() { writePrep(); if (Pipe.hasRoomForWrite(pipe)) { return beginNewWrite(); } return false; }
public boolean goHasRoomFor(int messageCount) { assert(null==goPipe || Pipe.isInit(goPipe)) : "not init yet"; return (null==goPipe || Pipe.hasRoomForWrite(goPipe, FieldReferenceOffsetManager.maxFragmentSize(Pipe.from(goPipe))*messageCount)); }
/** * Open the message for writing * @return returns the ChannelWriter or null if there is no room to write. */ public ChannelWriter beginWrite() { if (Pipe.hasRoomForWrite(pipe)) { Pipe.markHead(pipe); Pipe.addMsgIdx(pipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); isWriting = true; return Pipe.openOutputStream(pipe); } return null; }
/** * Open the message for writing * @return returns the ChannelWriter or null if there is no room to write. */ public ChannelWriter beginWrite() { if (Pipe.hasRoomForWrite(pipe)) { Pipe.markHead(pipe); Pipe.addMsgIdx(pipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); isWriting = true; return Pipe.openOutputStream(pipe); } return null; }
/** * Open the message for writing * @return returns the ChannelWriter or null if there is no room to write. */ public ChannelWriter beginWrite() { if (Pipe.hasRoomForWrite(pipe)) { Pipe.markHead(pipe); Pipe.addMsgIdx(pipe, RawDataSchema.MSG_CHUNKEDSTREAM_1); isWriting = true; return Pipe.openOutputStream(pipe); } return null; }
public static void writeEndGroupMessage(Pipe ring) { int msgIdx = MetaMessageDefs.MSG_ENDGROUP_LOC; //before write make sure the tail is moved ahead so we have room to write while (!Pipe.hasRoomForWrite(ring, Pipe.from(ring).fragDataSize[msgIdx])) { Pipe.spinWork(ring); } Pipe.addMsgIdx(ring, msgIdx); Pipe.publishWrites(ring); }