protected void consumeFileWatch(Object target, Pipe p) { while (Pipe.hasContentToRead(p)) { Pipe.markTail(p); if (target instanceof FileWatchListenerBase) { FileWatchListenerBase t = ((FileWatchListenerBase)target); // t.fileEvent(reader); } else { FileWatchMethodListenerBase t = ((FileWatchMethodListenerBase)target); //method?? } } //(WatchFileReadStage) target //TODO: take in the data and write the messsage... what about updates and delete??? //TODO: raw pipe may be a mistack to use.. throw new UnsupportedOperationException("not yet implemented"); }
/** * 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; }
protected void consumeStoreWriteAck(int index, Object target, Pipe<PersistedBlobLoadProducerSchema> p) { final int store = IntHashTable.getItem(serialStoreProdAckPipeMap, NON_ZERO_BASE+p.id)-NON_ZERO_BASE; while (Pipe.hasContentToRead(p)) { Pipe.markTail(p); int msgIdx = Pipe.takeMsgIdx(p); if (msgIdx == PersistedBlobLoadProducerSchema.MSG_ACKWRITE_11) { long value = Pipe.takeLong(p); if (!((SerialStoreProducerAckListener)target).producerAck(store, value)) { Pipe.resetTail(p); return;//continue later and repeat this same value. } } else { logger.error("unrecognized message on {} ",p); throw new UnsupportedOperationException("unexpected message "+msgIdx); } Pipe.confirmLowLevelRead(p, Pipe.sizeOf(p,msgIdx)); Pipe.releaseReadLock(p); } }
protected void consumeStoreReleaseAck(int index, Object target, Pipe<PersistedBlobLoadReleaseSchema> p) { final int store = IntHashTable.getItem(serialStoreRelAckPipeMap, NON_ZERO_BASE+p.id)-NON_ZERO_BASE; while (Pipe.hasContentToRead(p)) { Pipe.markTail(p); int msgIdx = Pipe.takeMsgIdx(p); if (msgIdx == PersistedBlobLoadReleaseSchema.MSG_ACKRELEASE_10) { long value = Pipe.takeLong(p); if (!((SerialStoreReleaseAckListener)target).releaseAck(store, value)) { Pipe.resetTail(p); return;//continue later and repeat this same value. } } else { logger.error("unrecognized message on {} ",p); throw new UnsupportedOperationException("unexpected message "+msgIdx); } Pipe.confirmLowLevelRead(p, Pipe.sizeOf(p,msgIdx)); Pipe.releaseReadLock(p); } }
while (Pipe.hasContentToRead(p)) { Pipe.markTail(p); int msgIdx = Pipe.takeMsgIdx(p);
Pipe.markTail(p); int msgIdx = Pipe.takeMsgIdx(p);
) { Pipe.markTail(p);
Pipe.markTail(pipeIn);