use of io.aeron.archive.client.RecordingDescriptorConsumer in project Aeron by real-logic.
the class EmbeddedReplayThroughput method findRecordingId.
private long findRecordingId(final String expectedChannel) {
final MutableLong foundRecordingId = new MutableLong();
final RecordingDescriptorConsumer consumer = (controlSessionId, correlationId, recordingId, startTimestamp, stopTimestamp, startPosition, stopPosition, initialTermId, segmentFileLength, termBufferLength, mtuLength, sessionId, streamId, strippedChannel, originalChannel, sourceIdentity) -> foundRecordingId.set(recordingId);
final int recordingsFound = aeronArchive.listRecordingsForUri(0L, 10, expectedChannel, STREAM_ID, consumer);
if (1 != recordingsFound) {
throw new IllegalStateException("should have been only one recording");
}
return foundRecordingId.get();
}
use of io.aeron.archive.client.RecordingDescriptorConsumer in project aeron by real-logic.
the class EmbeddedReplayThroughput method findRecordingId.
private long findRecordingId(final String expectedChannel) {
final MutableLong foundRecordingId = new MutableLong();
final RecordingDescriptorConsumer consumer = (controlSessionId, correlationId, recordingId, startTimestamp, stopTimestamp, startPosition, stopPosition, initialTermId, segmentFileLength, termBufferLength, mtuLength, sessionId, streamId, strippedChannel, originalChannel, sourceIdentity) -> foundRecordingId.set(recordingId);
final int recordingsFound = aeronArchive.listRecordingsForUri(0L, 10, expectedChannel, STREAM_ID, consumer);
if (1 != recordingsFound) {
throw new IllegalStateException("should have been only one recording");
}
return foundRecordingId.get();
}
use of io.aeron.archive.client.RecordingDescriptorConsumer in project aeron by real-logic.
the class BasicArchiveTest method findRecordingId.
private long findRecordingId(final String expectedChannel, final int expectedStreamId, final long expectedPosition) {
final MutableLong foundRecordingId = new MutableLong();
final RecordingDescriptorConsumer consumer = (controlSessionId, correlationId, recordingId, startTimestamp, stopTimestamp, startPosition, stopPosition, initialTermId, segmentFileLength, termBufferLength, mtuLength, sessionId, streamId, strippedChannel, originalChannel, sourceIdentity) -> {
foundRecordingId.set(recordingId);
assertEquals(0L, startPosition);
assertEquals(expectedPosition, stopPosition);
assertEquals(expectedStreamId, streamId);
assertEquals(expectedChannel, originalChannel);
};
final int recordingsFound = aeronArchive.listRecordingsForUri(0L, 10, expectedChannel, expectedStreamId, consumer);
assertThat(recordingsFound, greaterThan(0));
return foundRecordingId.get();
}
use of io.aeron.archive.client.RecordingDescriptorConsumer in project aeron by real-logic.
the class EmbeddedReplayThroughput method findRecordingId.
private long findRecordingId(final String expectedChannel, final int expectedStreamId) {
final MutableLong foundRecordingId = new MutableLong();
final RecordingDescriptorConsumer consumer = (controlSessionId, correlationId, recordingId, startTimestamp, stopTimestamp, startPosition, stopPosition, initialTermId, segmentFileLength, termBufferLength, mtuLength, sessionId, streamId, strippedChannel, originalChannel, sourceIdentity) -> foundRecordingId.set(recordingId);
final int recordingsFound = aeronArchive.listRecordingsForUri(0L, 10, expectedChannel, expectedStreamId, consumer);
if (1 != recordingsFound) {
throw new IllegalStateException("Should have been one recording");
}
return foundRecordingId.get();
}
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