use of io.aeron.archive.client.AeronArchive.NULL_TIMESTAMP in project Aeron by real-logic.
the class CatalogTest method shouldFixTimestampForEmptyRecordingAfterFailure.
@Test
void shouldFixTimestampForEmptyRecordingAfterFailure() {
final long newRecordingId = newRecording();
try (Catalog catalog = new Catalog(archiveDir, clock)) {
final CatalogEntryProcessor entryProcessor = (recordingDescriptorOffset, headerEncoder, headerDecoder, descriptorEncoder, descriptorDecoder) -> assertEquals(NULL_TIMESTAMP, descriptorDecoder.stopTimestamp());
assertTrue(catalog.forEntry(newRecordingId, entryProcessor));
}
currentTimeMs = 42L;
try (Catalog catalog = new Catalog(archiveDir, null, 0, CAPACITY, clock, null, segmentFileBuffer)) {
final CatalogEntryProcessor entryProcessor = (recordingDescriptorOffset, headerEncoder, headerDecoder, descriptorEncoder, descriptorDecoder) -> assertEquals(42L, descriptorDecoder.stopTimestamp());
assertTrue(catalog.forEntry(newRecordingId, entryProcessor));
}
}
use of io.aeron.archive.client.AeronArchive.NULL_TIMESTAMP in project aeron by real-logic.
the class CatalogTest method shouldFixTimestampForEmptyRecordingAfterFailure.
@Test
void shouldFixTimestampForEmptyRecordingAfterFailure() {
final long newRecordingId = newRecording();
try (Catalog catalog = new Catalog(archiveDir, clock)) {
final CatalogEntryProcessor entryProcessor = (recordingDescriptorOffset, headerEncoder, headerDecoder, descriptorEncoder, descriptorDecoder) -> assertEquals(NULL_TIMESTAMP, descriptorDecoder.stopTimestamp());
assertTrue(catalog.forEntry(newRecordingId, entryProcessor));
}
currentTimeMs = 42L;
try (Catalog catalog = new Catalog(archiveDir, null, 0, CAPACITY, clock, null, segmentFileBuffer)) {
final CatalogEntryProcessor entryProcessor = (recordingDescriptorOffset, headerEncoder, headerDecoder, descriptorEncoder, descriptorDecoder) -> assertEquals(42L, descriptorDecoder.stopTimestamp());
assertTrue(catalog.forEntry(newRecordingId, entryProcessor));
}
}
Aggregations