use of io.aeron.archive.client.RecordingDescriptorConsumer in project aeron by real-logic.
the class ReplayedBasicSubscriber method findLatestRecording.
private static long findLatestRecording(final AeronArchive archive) {
final MutableLong lastRecordingId = new MutableLong();
final RecordingDescriptorConsumer consumer = (controlSessionId, correlationId, recordingId, startTimestamp, stopTimestamp, startPosition, stopPosition, initialTermId, segmentFileLength, termBufferLength, mtuLength, sessionId, streamId, strippedChannel, originalChannel, sourceIdentity) -> lastRecordingId.set(recordingId);
final long fromRecordingId = 0L;
final int recordCount = 100;
final int foundCount = archive.listRecordingsForUri(fromRecordingId, recordCount, CHANNEL, STREAM_ID, consumer);
if (foundCount == 0) {
throw new IllegalStateException("no recordings found");
}
return lastRecordingId.get();
}
Aggregations