private boolean isDrained() { final long rebuildPosition = this.rebuildPosition.get(); for (final ReadablePosition subscriberPosition : subscriberPositions) { if (subscriberPosition.getVolatile() < rebuildPosition) { return false; } } return true; }
public void onRttMeasurement(final long nowNs, final long rttNs, final InetSocketAddress srcAddress) { outstandingRttMeasurements--; lastRttTimestampNs = nowNs; this.rttInNs = rttNs; rttIndicator.setOrdered(rttNs); }
public void closeStatusIndicator() { if (!statusIndicator.isClosed()) { statusIndicator.setOrdered(ChannelEndpointStatus.CLOSING); statusIndicator.close(); } }
long channelStatus(final int channelStatusId) { switch (channelStatusId) { case 0: return ChannelEndpointStatus.INITIALIZING; case ChannelEndpointStatus.NO_ID_ALLOCATED: return ChannelEndpointStatus.ACTIVE; default: return countersReader.getCounterValue(channelStatusId); } }
/** * The position up to which the current stream rebuild is complete for reception. * * @return the position up to which the current stream rebuild is complete for reception. */ long rebuildPosition() { return rebuildPosition.get(); }
private boolean isDrained(final long producerPosition) { for (final ReadablePosition subscriberPosition : subscriberPositions) { if (subscriberPosition.getVolatile() < producerPosition) { return false; } } return true; }
private boolean isFlowControlUnderRun(final long packetPosition) { final boolean isFlowControlUnderRun = packetPosition < lastSmPosition; if (isFlowControlUnderRun) { flowControlUnderRuns.incrementOrdered(); } return isFlowControlUnderRun; }
void internalClose() { super.close(); isClosed = true; } }
long consumerPosition() { return senderPosition.getVolatile(); } }
public int publisherLimitId() { return publisherLimit.id(); }
/** * Return the counter label. * * @return the counter label. */ public String label() { return countersReader.getCounterLabel(counterId); }
/** * Called by the {@link DriverConductor} to determine if the channel endpoint should be closed. * * @return true if ready to be closed. */ public boolean shouldBeClosed() { return 0 == refCount && !statusIndicator.isClosed(); }
/** * 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 timeOfLastKeepaliveMs(final long nowMs) { timeOfLastKeepaliveMs = nowMs; heartbeatStatus.setOrdered(nowMs); }
public long availableWindow() { if (isClosed) { return CLOSED; } return positionLimit.getVolatile() - (termBeginPosition + termOffset); }
private boolean isFlowControlOverRun(final long proposedPosition) { final boolean isFlowControlOverRun = proposedPosition > lastSmWindowLimit; if (isFlowControlOverRun) { flowControlOverRuns.incrementOrdered(); } return isFlowControlOverRun; }
/** * The counter id for the subscriber position counter. * * @return the id for the subscriber position counter. */ public int subscriberPositionId() { return subscriberPosition.id(); }