class TransactionLogCatchUpWriter implements TxPullResponseListener, AutoCloseable {

    @Override
    public synchronized void close() throws IOException
    {
        if ( asPartOfStoreCopy )
        {
            /* A checkpoint which points to the beginning of all the log files, meaning that
            all the streamed transactions will be applied as part of recovery. */
            long logVersion = logFiles.getLowestLogVersion();
            LogPosition checkPointPosition = new LogPosition( logVersion, LOG_HEADER_SIZE );

            log.info( "Writing checkpoint as part of store copy: " + checkPointPosition );
            writer.checkPoint( checkPointPosition );

            // * comment copied from old StoreCopyClient *
            // since we just create new log and put checkpoint into it with offset equals to
            // LOG_HEADER_SIZE we need to update last transaction offset to be equal to this newly defined max
            // offset otherwise next checkpoint that use last transaction offset will be created for non
            // existing offset that is in most of the cases bigger than new log size.
            // Recovery will treat that as last checkpoint and will not try to recover store till new
            // last closed transaction offset will not overcome old one. Till that happens it will be
            // impossible for recovery process to restore the store
            File neoStore = databaseLayout.metadataStore();
            MetaDataStore.setRecord(
                    pageCache,
                    neoStore,
                    LAST_CLOSED_TRANSACTION_LOG_BYTE_OFFSET,
                    checkPointPosition.getByteOffset() );
        }

        lifespan.close();

        if ( lastTxId != -1 )
        {
            File neoStoreFile = databaseLayout.metadataStore();
            MetaDataStore.setRecord( pageCache, neoStoreFile, LAST_TRANSACTION_ID, lastTxId );
        }
        stores.close();
    }

      TransactionLogCatchUpWriter( DatabaseLayout databaseLayout, FileSystemAbstraction fs, PageCache pageCache, Config config,
            LogProvider logProvider, long fromTxId, boolean asPartOfStoreCopy, boolean keepTxLogsInStoreDir,
            boolean forceTransactionRotations );

}