use of io.aeron.archive.codecs.mark.MarkFileHeaderDecoder in project Aeron by real-logic.
the class ArchiveTool method printErrors.
private static void printErrors(final PrintStream out, final ArchiveMarkFile markFile) {
out.println("Archive error log:");
CommonContext.printErrorLog(markFile.errorBuffer(), out);
final MarkFileHeaderDecoder decoder = markFile.decoder();
decoder.skipControlChannel();
decoder.skipLocalControlChannel();
decoder.skipEventsChannel();
final String aeronDirectory = decoder.aeronDirectory();
out.println();
out.println("Aeron driver error log (directory: " + aeronDirectory + "):");
final File cncFile = new File(aeronDirectory, CncFileDescriptor.CNC_FILE);
final MappedByteBuffer cncByteBuffer = IoUtil.mapExistingFile(cncFile, FileChannel.MapMode.READ_ONLY, "cnc");
final DirectBuffer cncMetaDataBuffer = CncFileDescriptor.createMetaDataBuffer(cncByteBuffer);
final int cncVersion = cncMetaDataBuffer.getInt(CncFileDescriptor.cncVersionOffset(0));
CncFileDescriptor.checkVersion(cncVersion);
CommonContext.printErrorLog(CncFileDescriptor.createErrorLogBuffer(cncByteBuffer, cncMetaDataBuffer), out);
}
use of io.aeron.archive.codecs.mark.MarkFileHeaderDecoder in project aeron by real-logic.
the class ArchiveTool method printErrors.
private static void printErrors(final PrintStream out, final ArchiveMarkFile markFile) {
out.println("Archive error log:");
CommonContext.printErrorLog(markFile.errorBuffer(), out);
final MarkFileHeaderDecoder decoder = markFile.decoder();
decoder.skipControlChannel();
decoder.skipLocalControlChannel();
decoder.skipEventsChannel();
final String aeronDirectory = decoder.aeronDirectory();
out.println();
out.println("Aeron driver error log (directory: " + aeronDirectory + "):");
final File cncFile = new File(aeronDirectory, CncFileDescriptor.CNC_FILE);
final MappedByteBuffer cncByteBuffer = IoUtil.mapExistingFile(cncFile, FileChannel.MapMode.READ_ONLY, "cnc");
final DirectBuffer cncMetaDataBuffer = CncFileDescriptor.createMetaDataBuffer(cncByteBuffer);
final int cncVersion = cncMetaDataBuffer.getInt(CncFileDescriptor.cncVersionOffset(0));
CncFileDescriptor.checkVersion(cncVersion);
CommonContext.printErrorLog(CncFileDescriptor.createErrorLogBuffer(cncByteBuffer, cncMetaDataBuffer), out);
}
Aggregations