@Override
  public void appendCommitRecord(
      long txID, boolean sync, IOCompletion callback, boolean lineUpContext) throws Exception {
    JournalInternalRecord commitRecord =
        new JournalCompleteRecordTX(TX_RECORD_TYPE.COMMIT, txID, null);
    AtomicInteger value = transactions.remove(Long.valueOf(txID));
    if (value != null) {
      commitRecord.setNumberOfRecords(value.get());
    }

    writeRecord(commitRecord, true, callback);
  }
 @Override
 public void appendPrepareRecord(
     long txID, EncodingSupport transactionData, boolean sync, IOCompletion callback)
     throws Exception {
   JournalInternalRecord prepareRecord =
       new JournalCompleteRecordTX(TX_RECORD_TYPE.PREPARE, txID, transactionData);
   AtomicInteger value = transactions.get(Long.valueOf(txID));
   if (value != null) {
     prepareRecord.setNumberOfRecords(value.get());
   }
   writeRecord(prepareRecord, sync, callback);
 }
 protected void writeEncoder(final JournalInternalRecord record, final int txcounter)
     throws Exception {
   record.setNumberOfRecords(txcounter);
   writeEncoder(record);
 }