Source:
public TransactionContext startTransaction(RaftClientRequest request) throws IOException { long startTime = Time.monotonicNowNanos(); final ContainerCommandRequestProto proto = getContainerCommandRequestProto(request.getMessage().getContent()); Preconditions.checkArgument(request.getRaftGroupId().equals(gid)); try { dispatcher.validateContainerCommand(proto); } catch (IOException ioe) { if (ioe instanceof ContainerNotOpenException) { metrics.intNumContainerNotOpenVerifyFailures(); } else { metrics.intNumStartTransactionVerifyFailures(); LOG.error("startTransaction validation failed on leader", ioe); } TransactionContext ctxt = TransactionContext.newBuilder() .setClientRequest(request) .setStateMachine(this) .setServerRole(RaftPeerRole.LEADER) .build(); ctxt.setException(ioe); return ctxt; } if (proto.getCmdType() == Type.WriteChunk) { final WriteChunkRequestProto write = proto.getWriteChunk(); final WriteChunkRequestProto commitWriteChunkProto = WriteChunkRequestProto.newBuilder() .setBlockID(write.getBlockID()) .setChunkData(write.getChunkData()) .build(); ContainerCommandRequestProto commitContainerCommandProto = ContainerCommandRequestProto .newBuilder(proto) .setWriteChunk(commitWriteChunkProto) .setTraceID(proto.getTraceID()) .build(); return TransactionContext.newBuilder() .setClientRequest(request) .setStateMachine(this) .setServerRole(RaftPeerRole.LEADER) .setStateMachineContext(startTime) .setStateMachineData(write.getData()) .setLogData(commitContainerCommandProto.toByteString()) .build(); } else { return TransactionContext.newBuilder() .setClientRequest(request) .setStateMachine(this) .setServerRole(RaftPeerRole.LEADER) .setStateMachineContext(startTime) .setLogData(request.getMessage().getContent()) .build(); } }

Target:
public TransactionContext startTransaction(RaftClientRequest request) throws IOException { long startTime = Time.monotonicNowNanos(); final ContainerCommandRequestProto proto = getContainerCommandRequestProto(request.getMessage().getContent()); Preconditions.checkArgument(request.getRaftGroupId().equals(gid)); try { dispatcher.validateContainerCommand(proto); } catch (IOException ioe) { if (ioe instanceof ContainerNotOpenException) { metrics.incNumContainerNotOpenVerifyFailures(); } else { metrics.incNumStartTransactionVerifyFailures(); LOG.error("startTransaction validation failed on leader", ioe); } TransactionContext ctxt = TransactionContext.newBuilder() .setClientRequest(request) .setStateMachine(this) .setServerRole(RaftPeerRole.LEADER) .build(); ctxt.setException(ioe); return ctxt; } if (proto.getCmdType() == Type.WriteChunk) { final WriteChunkRequestProto write = proto.getWriteChunk(); final WriteChunkRequestProto commitWriteChunkProto = WriteChunkRequestProto.newBuilder() .setBlockID(write.getBlockID()) .setChunkData(write.getChunkData()) .build(); ContainerCommandRequestProto commitContainerCommandProto = ContainerCommandRequestProto .newBuilder(proto) .setWriteChunk(commitWriteChunkProto) .setTraceID(proto.getTraceID()) .build(); return TransactionContext.newBuilder() .setClientRequest(request) .setStateMachine(this) .setServerRole(RaftPeerRole.LEADER) .setStateMachineContext(startTime) .setStateMachineData(write.getData()) .setLogData(commitContainerCommandProto.toByteString()) .build(); } else { return TransactionContext.newBuilder() .setClientRequest(request) .setStateMachine(this) .setServerRole(RaftPeerRole.LEADER) .setStateMachineContext(startTime) .setLogData(request.getMessage().getContent()) .build(); } }