jojochuang commented on code in PR #7480:
URL: https://github.com/apache/ozone/pull/7480#discussion_r1857167237
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java:
##########
@@ -1006,7 +1006,7 @@ private void removeStateMachineDataIfNeeded(long index) {
RaftServer.Division division =
ratisServer.getServer().getDivision(getGroupId());
if (division.getInfo().isLeader()) {
long minIndex = Arrays.stream(division.getInfo()
- .getFollowerNextIndices()).min().getAsLong();
+ .getFollowerNextIndices()).min().orElse(0);
LOG.debug("Removing data corresponding to log index {} min index {} "
+ "from cache", index, minIndex);
removeCacheDataUpTo(Math.min(minIndex, index));
Review Comment:
I think it's essentially the same, but your suggest is more readable. Will
update accordingly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]