}
private int appendMsg(final int number, final long offset, final TxCommand cmd, final DataFile dataFile)
throws InvalidProtocolBufferException, IOException {
final AppendMessageCommand appendCmd = AppendMessageCommand.parseFrom(cmd.getCmdContent());
final PutCommand putCmd =
(PutCommand) decoer.decode(IoBuffer.wrap(appendCmd.getPutCommand().toByteArray()), null);
final MessageStore store = this.storeManager.getOrCreateMessageStore(putCmd.getTopic(), putCmd.getPartition());
if (this.transactionStore.getInflyTx(putCmd.getTransactionId()) == null) {
dataFile.increment();
}
this.transactionStore.addMessage(store, appendCmd.getMessageId(), putCmd, new JournalLocation(number, offset));
return 0;
}