class EntryCountThreshold implements Threshold {

    @Override
    public boolean reached( File ignored, long version, LogFileInformation source )
    {
        try
        {
            // try to ask next version log file which is my last tx
            long lastTx = source.getFirstEntryId( version + 1 );
            if ( lastTx == -1 )
            {
                throw new IllegalStateException(
                        "The next version should always exist, since this is called after rotation and the " +
                        "PruneStrategy never checks the current active log file" );
            }

            long highest = source.getLastEntryId();
            return highest - lastTx >= maxTransactionCount;
        }
        catch ( IOException e )
        {
            throw new RuntimeException( e );
        }
    }

      EntryCountThreshold( long maxTransactionCount );

}