use of io.aeron.archive.ArchiveMarkFile in project aeron by real-logic.
the class SystemTestWatcher method countArchiveMarkFileErrors.
private int countArchiveMarkFileErrors(final List<Path> paths, final Predicate<String> filter) {
final MutableInteger errorCount = new MutableInteger();
for (final Path path : paths) {
try (ArchiveMarkFile archive = openArchiveMarkFile(path)) {
final AtomicBuffer buffer = archive.errorBuffer();
ErrorLogReader.read(buffer, (observationCount, firstObservationTimestamp, lastObservationTimestamp, encodedException) -> {
if (filter.test(encodedException)) {
errorCount.set(errorCount.get() + observationCount);
}
});
}
}
return errorCount.get();
}
use of io.aeron.archive.ArchiveMarkFile in project Aeron by real-logic.
the class SystemTestWatcher method countArchiveMarkFileErrors.
private int countArchiveMarkFileErrors(final List<Path> paths, final Predicate<String> filter) {
final MutableInteger errorCount = new MutableInteger();
for (final Path path : paths) {
try (ArchiveMarkFile archive = openArchiveMarkFile(path)) {
final AtomicBuffer buffer = archive.errorBuffer();
ErrorLogReader.read(buffer, (observationCount, firstObservationTimestamp, lastObservationTimestamp, encodedException) -> {
if (filter.test(encodedException)) {
errorCount.set(errorCount.get() + observationCount);
}
});
}
}
return errorCount.get();
}
use of io.aeron.archive.ArchiveMarkFile in project Aeron by real-logic.
the class SystemTestWatcher method printArchiveMarkFileErrors.
private void printArchiveMarkFileErrors(final List<Path> paths) {
for (final Path path : paths) {
try (ArchiveMarkFile archiveFile = openArchiveMarkFile(path)) {
final AtomicBuffer buffer = archiveFile.errorBuffer();
System.out.printf("%n%n%s file %s%n", "Archive Errors", path);
final int distinctErrorCount = ErrorLogReader.read(buffer, this::printObservationCallback);
System.out.format("%d distinct errors observed.%n", distinctErrorCount);
}
}
}
use of io.aeron.archive.ArchiveMarkFile in project aeron by real-logic.
the class SystemTestWatcher method printArchiveMarkFileErrors.
private void printArchiveMarkFileErrors(final List<Path> paths) {
for (final Path path : paths) {
try (ArchiveMarkFile archiveFile = openArchiveMarkFile(path)) {
final AtomicBuffer buffer = archiveFile.errorBuffer();
System.out.printf("%n%n%s file %s%n", "Archive Errors", path);
final int distinctErrorCount = ErrorLogReader.read(buffer, this::printObservationCallback);
System.out.format("%d distinct errors observed.%n", distinctErrorCount);
}
}
}
Aggregations