use of org.agrona.concurrent.status.ReadablePosition in project Aeron by real-logic.
the class DriverConductor method positionArray.
private static ReadablePosition[] positionArray(final List<SubscriberPosition> subscriberPositions) {
final int size = subscriberPositions.size();
final ReadablePosition[] positions = new ReadablePosition[subscriberPositions.size()];
for (int i = 0; i < size; i++) {
positions[i] = subscriberPositions.get(i).position();
}
return positions;
}
use of org.agrona.concurrent.status.ReadablePosition in project Aeron by real-logic.
the class NetworkPublication method updatePublishersLimit.
/**
* Update the publishers limit for flow control as part of the conductor duty cycle.
*
* @return 1 if the limit has been updated otherwise 0.
*/
int updatePublishersLimit() {
int workCount = 0;
if (isConnected) {
long minConsumerPosition = senderPosition.getVolatile();
if (spyPositions.length > 0) {
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 {
publisherLimit.setOrdered(senderPosition.getVolatile());
}
return workCount;
}
use of org.agrona.concurrent.status.ReadablePosition in project aeron by real-logic.
the class IpcPublication method close.
public void close() {
publisherLimit.close();
for (final ReadablePosition position : subscriberPositions) {
position.close();
}
rawLog.close();
}
use of org.agrona.concurrent.status.ReadablePosition in project aeron by real-logic.
the class NetworkPublication method close.
public void close() {
publisherLimit.close();
senderPosition.close();
senderLimit.close();
for (final ReadablePosition position : spyPositions) {
position.close();
}
rawLog.close();
}
use of org.agrona.concurrent.status.ReadablePosition in project aeron by real-logic.
the class PublicationImage method close.
/**
* {@inheritDoc}
*/
public void close() {
hwmPosition.close();
rebuildPosition.close();
for (final ReadablePosition position : subscriberPositions) {
position.close();
}
congestionControl.close();
rawLog.close();
}
Aggregations