Skip to content

Commit e573701

Browse files
authored
HDDS-11448. Improve documentation in ContainerStateMachine (apache#7183)
1 parent 0e49f7a commit e573701

File tree

1 file changed

+7
-6
lines changed
  • hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis

1 file changed

+7
-6
lines changed

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public ContainerStateMachine(HddsDatanodeService hddsDatanodeService, RaftGroupI
233233
// cache with FIFO eviction, and if element not found, this needs
234234
// to be obtained from disk for slow follower
235235
stateMachineDataCache = new ResourceCache<>(
236-
(index, data) -> ((ByteString)data).size(),
236+
(index, data) -> data.size(),
237237
pendingRequestsBytesLimit,
238238
(p) -> {
239239
if (p.wasEvicted()) {
@@ -704,9 +704,10 @@ private ExecutorService getChunkExecutor(WriteChunkRequestProto req) {
704704
return chunkExecutors.get(i);
705705
}
706706

707-
/*
708-
* writeStateMachineData calls are not synchronized with each other
709-
* and also with applyTransaction.
707+
/**
708+
* {@link #writeStateMachineData(ContainerCommandRequestProto, long, long, long)}
709+
* calls are not synchronized with each other
710+
* and also with {@link #applyTransaction(TransactionContext)}.
710711
*/
711712
@Override
712713
public CompletableFuture<Message> write(LogEntryProto entry, TransactionContext trx) {
@@ -824,7 +825,7 @@ public CompletableFuture<Void> flush(long index) {
824825
}
825826

826827
/**
827-
* This method is used by the Leader to read state machine date for sending appendEntries to followers.
828+
* This method is used by the Leader to read state machine data for sending appendEntries to followers.
828829
* It will first get the data from {@link #stateMachineDataCache}.
829830
* If the data is not in the cache, it will read from the file by dispatching a command
830831
*
@@ -1197,7 +1198,7 @@ public void notifyGroupRemove() {
11971198
try {
11981199
containerController.markContainerForClose(cid);
11991200
containerController.quasiCloseContainer(cid,
1200-
"Ratis group removed");
1201+
"Ratis group removed. Group id: " + gid);
12011202
} catch (IOException e) {
12021203
LOG.debug("Failed to quasi-close container {}", cid);
12031204
}

0 commit comments

Comments
 (0)