private boolean isDrained(final long producerPosition) { for (final ReadablePosition subscriberPosition : subscriberPositions) { if (subscriberPosition.getVolatile() < producerPosition) { return false; } } return true; }
public void removeSubscriber(final ReadablePosition subscriberPosition) { consumerPosition = Math.max(consumerPosition, subscriberPosition.getVolatile()); subscriberPositions = ArrayUtil.remove(subscriberPositions, subscriberPosition); subscriberPosition.close(); if (subscriberPositions.length == 0) { LogBufferDescriptor.isConnected(metaDataBuffer, false); } }
/** * Get the counter id for the position limit after which the publication will be back pressured. * * @return the counter id for the position limit after which the publication will be back pressured. */ public int positionLimitId() { return positionLimit.id(); }
public void removeSubscriber(final ReadablePosition spyPosition) { spyPositions = ArrayUtil.remove(spyPositions, spyPosition); hasSpies = spyPositions.length > 0; spyPosition.close(); }
/** * Remove a {@link ReadablePosition} for a subscriber that has been removed so it is not tracked for flow control. * * @param subscriberPosition for the subscriber that has been removed. */ public void removeSubscriber(final ReadablePosition subscriberPosition) { subscriberPositions = ArrayUtil.remove(subscriberPositions, subscriberPosition); subscriberPosition.close(); }
public long availableWindow() { if (isClosed) { return CLOSED; } return positionLimit.getVolatile() - (termBeginPosition + termOffset); }
public void removeSubscriber(final ReadablePosition subscriberPosition) { consumerPosition = Math.max(consumerPosition, subscriberPosition.getVolatile()); subscriberPositions = ArrayUtil.remove(subscriberPositions, subscriberPosition); subscriberPosition.close(); if (subscriberPositions.length == 0) { LogBufferDescriptor.isConnected(metaDataBuffer, false); } }
public void close() { publisherPos.close(); publisherLimit.close(); for (final ReadablePosition position : subscriberPositions) { position.close(); } rawLog.close(); }
/** * Get the counter id for the position limit after which the publication will be back pressured. * * @return the counter id for the position limit after which the publication will be back pressured. */ public int positionLimitId() { return positionLimit.id(); }
/** * Get the position limit beyond which this {@link Publication} will be back pressured. * <p> * This should only be used as a guide to determine when back pressure is likely to be applied. * * @return the position limit beyond which this {@link Publication} will be back pressured. */ public long positionLimit() { if (isClosed) { return CLOSED; } return positionLimit.getVolatile(); }
public void removeSubscriber(final ReadablePosition subscriberPosition) { consumerPosition = Math.max(consumerPosition, subscriberPosition.getVolatile()); subscriberPositions = ArrayUtil.remove(subscriberPositions, subscriberPosition); subscriberPosition.close(); if (subscriberPositions.length == 0) { LogBufferDescriptor.isConnected(metaDataBuffer, false); } }
/** * {@inheritDoc} */ public void close() { hwmPosition.close(); rebuildPosition.close(); for (final ReadablePosition position : subscriberPositions) { position.close(); } congestionControl.close(); rawLog.close(); }
/** * Get the counter id for the position limit after which the publication will be back pressured. * * @return the counter id for the position limit after which the publication will be back pressured. */ public int positionLimitId() { return positionLimit.id(); }
private long maxSpyPosition(final long senderPosition) { long position = senderPosition; for (final ReadablePosition spyPosition : spyPositions) { position = Math.max(position, spyPosition.getVolatile()); } return position; }
public void close() { publisherPos.close(); publisherLimit.close(); senderPosition.close(); senderLimit.close(); for (final ReadablePosition position : spyPositions) { position.close(); } rawLog.close(); }
public long availableWindow() { if (isClosed) { return CLOSED; } return positionLimit.getVolatile() - position(); }
/** * Remove a {@link ReadablePosition} for a subscriber that has been removed so it is not tracked for flow control. * * @param subscriberPosition for the subscriber that has been removed. */ public void removeSubscriber(final ReadablePosition subscriberPosition) { subscriberPositions = ArrayUtil.remove(subscriberPositions, subscriberPosition); subscriberPosition.close(); }
private boolean isDrained() { final long rebuildPosition = this.rebuildPosition.get(); for (final ReadablePosition subscriberPosition : subscriberPositions) { if (subscriberPosition.getVolatile() < rebuildPosition) { return false; } } return true; }
/** * Remove a {@link ReadablePosition} for a subscriber that has been removed so it is not tracked for flow control. * * @param subscriberPosition for the subscriber that has been removed. */ public void removeSubscriber(final ReadablePosition subscriberPosition) { subscriberPositions = ArrayUtil.remove(subscriberPositions, subscriberPosition); subscriberPosition.close(); }
private boolean spiesFinishedConsuming(final DriverConductor conductor, final long eosPosition) { if (spyPositions.length > 0) { for (final ReadablePosition spyPosition : spyPositions) { if (spyPosition.getVolatile() < eosPosition) { return false; } } hasSpies = false; conductor.cleanupSpies(this); } return true; }