diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java index b3398de07ad3..9dc6af19353a 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java @@ -233,7 +233,7 @@ public ContainerStateMachine(HddsDatanodeService hddsDatanodeService, RaftGroupI // cache with FIFO eviction, and if element not found, this needs // to be obtained from disk for slow follower stateMachineDataCache = new ResourceCache<>( - (index, data) -> ((ByteString)data).size(), + (index, data) -> data.size(), pendingRequestsBytesLimit, (p) -> { if (p.wasEvicted()) { @@ -704,9 +704,10 @@ private ExecutorService getChunkExecutor(WriteChunkRequestProto req) { return chunkExecutors.get(i); } - /* - * writeStateMachineData calls are not synchronized with each other - * and also with applyTransaction. + /** + * {@link #writeStateMachineData(ContainerCommandRequestProto, long, long, long)} + * calls are not synchronized with each other + * and also with {@link #applyTransaction(TransactionContext)}. */ @Override public CompletableFuture write(LogEntryProto entry, TransactionContext trx) { @@ -824,7 +825,7 @@ public CompletableFuture flush(long index) { } /** - * This method is used by the Leader to read state machine date for sending appendEntries to followers. + * This method is used by the Leader to read state machine data for sending appendEntries to followers. * It will first get the data from {@link #stateMachineDataCache}. * If the data is not in the cache, it will read from the file by dispatching a command * @@ -1197,7 +1198,7 @@ public void notifyGroupRemove() { try { containerController.markContainerForClose(cid); containerController.quasiCloseContainer(cid, - "Ratis group removed"); + "Ratis group removed. Group id: " + gid); } catch (IOException e) { LOG.debug("Failed to quasi-close container {}", cid); }