long consumerPosition() { return senderPosition.getVolatile(); } }
/** * To be called from the {@link Receiver} to see if a image should be retained. * * @param nowNs current time to check against for activity. * @return true if the image should be retained otherwise false. */ boolean hasActivityAndNotEndOfStream(final long nowNs) { boolean isActive = true; if (((lastPacketTimestampNs + imageLivenessTimeoutNs) - nowNs < 0) || (isEndOfStream && rebuildPosition.getVolatile() >= hwmPosition.get())) { isActive = false; } return isActive; }
void close() { finalPosition = subscriberPosition.getVolatile(); isEos = finalPosition >= endOfStreamPosition(logBuffers.metaDataBuffer()); isClosed = true; }
/** * Update the publishers limit for flow control as part of the conductor duty cycle. * * @return 1 if the limit has been updated otherwise 0. */ final int updatePublisherLimit() { int workCount = 0; final long senderPosition = this.senderPosition.getVolatile(); if (hasReceivers || (spiesSimulateConnection && spyPositions.length > 0)) { long minConsumerPosition = senderPosition; for (final ReadablePosition spyPosition : spyPositions) { minConsumerPosition = Math.min(minConsumerPosition, spyPosition.getVolatile()); } final long proposedPublisherLimit = minConsumerPosition + termWindowLength; if (publisherLimit.proposeMaxOrdered(proposedPublisherLimit)) { cleanBuffer(proposedPublisherLimit); workCount = 1; } } else if (publisherLimit.get() > senderPosition) { publisherLimit.setOrdered(senderPosition); } return workCount; }
public void decRef() { if (0 == --refCount) { state = State.DRAINING; channelEndpoint.decRef(); timeOfLastActivityNs = nanoClock.nanoTime(); final long producerPosition = producerPosition(); if (publisherLimit.get() > producerPosition) { publisherLimit.setOrdered(producerPosition); } endOfStreamPosition(metaDataBuffer, producerPosition); if (senderPosition.getVolatile() >= producerPosition) { isEndOfStream = true; } } }
if (!isExclusive) checkForBlockedPublisher(producerPosition, senderPosition.getVolatile(), timeNs); final long senderPosition = this.senderPosition.getVolatile(); if (producerPosition > senderPosition)
final long hwmPosition = this.hwmPosition.getVolatile();
long consumerPosition() { return senderPosition.getVolatile(); } }
long consumerPosition() { return senderPosition.getVolatile(); } }
private boolean isCurrentBlockCommitted() { return commitPosition.getVolatile() >= completeEventsProcessor.getLastReadEventPosition(); }
private boolean isCurrentBlockCommitted() { return commitPosition.getVolatile() >= completeEventsProcessor.getLastReadEventPosition(); }
/** * To be called from the {@link Receiver} to see if a image should be retained. * * @param nowNs current time to check against for activity. * @return true if the image should be retained otherwise false. */ boolean hasActivityAndNotEndOfStream(final long nowNs) { boolean isActive = true; if (((lastPacketTimestampNs + imageLivenessTimeoutNs) - nowNs < 0) || (isEndOfStream && rebuildPosition.getVolatile() >= hwmPosition.get())) { isActive = false; } return isActive; }
/** * To be called from the {@link Receiver} to see if a image should be retained. * * @param nowNs current time to check against for activity. * @return true if the image should be retained otherwise false. */ boolean hasActivityAndNotEndOfStream(final long nowNs) { boolean isActive = true; if (((lastPacketTimestampNs + imageLivenessTimeoutNs) - nowNs < 0) || (isEndOfStream && rebuildPosition.getVolatile() >= hwmPosition.get())) { isActive = false; } return isActive; }
void close() { finalPosition = subscriberPosition.getVolatile(); isEos = finalPosition >= endOfStreamPosition(logBuffers.metaDataBuffer()); isClosed = true; }
void close() { finalPosition = subscriberPosition.getVolatile(); isEos = finalPosition >= endOfStreamPosition(logBuffers.metaDataBuffer()); isClosed = true; }
/** * Update the publishers limit for flow control as part of the conductor duty cycle. * * @return 1 if the limit has been updated otherwise 0. */ final int updatePublisherLimit() { int workCount = 0; final long senderPosition = this.senderPosition.getVolatile(); if (hasReceivers || (spiesSimulateConnection && spyPositions.length > 0)) { long minConsumerPosition = senderPosition; for (final ReadablePosition spyPosition : spyPositions) { minConsumerPosition = Math.min(minConsumerPosition, spyPosition.getVolatile()); } final long proposedPublisherLimit = minConsumerPosition + termWindowLength; if (publisherLimit.proposeMaxOrdered(proposedPublisherLimit)) { cleanBuffer(proposedPublisherLimit); workCount = 1; } } else if (publisherLimit.get() > senderPosition) { publisherLimit.setOrdered(senderPosition); } return workCount; }
/** * Update the publishers limit for flow control as part of the conductor duty cycle. * * @return 1 if the limit has been updated otherwise 0. */ final int updatePublisherLimit() { int workCount = 0; final long senderPosition = this.senderPosition.getVolatile(); if (hasReceivers || (spiesSimulateConnection && spyPositions.length > 0)) { long minConsumerPosition = senderPosition; for (final ReadablePosition spyPosition : spyPositions) { minConsumerPosition = Math.min(minConsumerPosition, spyPosition.getVolatile()); } final long proposedPublisherLimit = minConsumerPosition + termWindowLength; if (publisherLimit.proposeMaxOrdered(proposedPublisherLimit)) { cleanBuffer(proposedPublisherLimit); workCount = 1; } } else if (publisherLimit.get() > senderPosition) { publisherLimit.setOrdered(senderPosition); } return workCount; }
public void decRef() { if (0 == --refCount) { state = State.DRAINING; channelEndpoint.decRef(); timeOfLastActivityNs = nanoClock.nanoTime(); final long producerPosition = producerPosition(); if (publisherLimit.get() > producerPosition) { publisherLimit.setOrdered(producerPosition); } endOfStreamPosition(metaDataBuffer, producerPosition); if (senderPosition.getVolatile() >= producerPosition) { isEndOfStream = true; } } }
public void decRef() { if (0 == --refCount) { state = State.DRAINING; channelEndpoint.decRef(); timeOfLastActivityNs = nanoClock.nanoTime(); final long producerPosition = producerPosition(); if (publisherLimit.get() > producerPosition) { publisherLimit.setOrdered(producerPosition); } endOfStreamPosition(metaDataBuffer, producerPosition); if (senderPosition.getVolatile() >= producerPosition) { isEndOfStream = true; } } }
final long hwmPosition = this.hwmPosition.getVolatile();