aeron-cluster/src/main/java/io/aeron/cluster/ClusterControl.java
public static CountersReader mapCounters(final File cncFile)
    {
        final MappedByteBuffer cncByteBuffer = IoUtil.mapExistingFile(cncFile, "cnc");
        final DirectBuffer cncMetaData = createMetaDataBuffer(cncByteBuffer);
        final int cncVersion = cncMetaData.getInt(cncVersionOffset(0));

        if (CncFileDescriptor.CNC_VERSION != cncVersion)
        {
            throw new AeronException(
                "Aeron CnC version does not match: version=" + cncVersion + " required=" + CNC_VERSION);
        }

        return new CountersReader(
            createCountersMetaDataBuffer(cncByteBuffer, cncMetaData),
            createCountersValuesBuffer(cncByteBuffer, cncMetaData),
            StandardCharsets.US_ASCII);
    }
public static CountersReader mapCounters(final File cncFile)
    {
        final MappedByteBuffer cncByteBuffer = IoUtil.mapExistingFile(cncFile, "cnc");
        final DirectBuffer cncMetaData = createMetaDataBuffer(cncByteBuffer);
        final int cncVersion = cncMetaData.getInt(cncVersionOffset(0));

        if (CncFileDescriptor.CNC_VERSION != cncVersion)
        {
            throw new AeronException(
                "Aeron CnC version does not match: version=" + cncVersion + " required=" + CNC_VERSION);
        }

        return new CountersReader(
            createCountersMetaDataBuffer(cncByteBuffer, cncMetaData),
            createCountersValuesBuffer(cncByteBuffer, cncMetaData),
            StandardCharsets.US_ASCII);
    }
public static CountersReader mapCounters ( final File cncFile ) { final MappedByteBuffer cncByteBuffer = IoUtil . mapExistingFile ( cncFile , "cnc" ) ; final DirectBuffer cncMetaData = createMetaDataBuffer ( cncByteBuffer ) ; final int cncVersion = cncMetaData . getInt ( cncVersionOffset ( 0 ) ) ; if ( CncFileDescriptor . CNC_VERSION != cncVersion ) { throw new AeronException ( "Aeron CnC version does not match: version=" + cncVersion + " required=" + CNC_VERSION ) ; } return new CountersReader ( createCountersMetaDataBuffer ( cncByteBuffer , cncMetaData ) , createCountersValuesBuffer ( cncByteBuffer , cncMetaData ) , StandardCharsets . US_ASCII ) ; }
Map a {@link CountersReader} over the provided {@link File} for the CnC file.

@param cncFile for the counters.
@return a {@link CountersReader} over the provided CnC file.
Map a { @link CountersReader } over the provided { @link File } for the CnC file .