Search in sources :

Example 1 with MarkFileHeaderDecoder

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);
}
Also used : MappedByteBuffer(java.nio.MappedByteBuffer) MarkFileHeaderDecoder(io.aeron.archive.codecs.mark.MarkFileHeaderDecoder) MigrationUtils.fullVersionString(io.aeron.archive.MigrationUtils.fullVersionString) File(java.io.File)

Example 2 with MarkFileHeaderDecoder

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);
}
Also used : MappedByteBuffer(java.nio.MappedByteBuffer) MarkFileHeaderDecoder(io.aeron.archive.codecs.mark.MarkFileHeaderDecoder) MigrationUtils.fullVersionString(io.aeron.archive.MigrationUtils.fullVersionString) File(java.io.File)

Aggregations

MigrationUtils.fullVersionString (io.aeron.archive.MigrationUtils.fullVersionString)2 MarkFileHeaderDecoder (io.aeron.archive.codecs.mark.MarkFileHeaderDecoder)2 File (java.io.File)2 MappedByteBuffer (java.nio.MappedByteBuffer)2