szetszwo commented on code in PR #7388:
URL: https://github.com/apache/ozone/pull/7388#discussion_r1829910554
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java:
##########
@@ -215,8 +216,10 @@ public void notifyConfigurationChanged(long term, long
index,
RaftProtos.RaftConfigurationProto newRaftConfiguration) {
List<RaftProtos.RaftPeerProto> newPeers =
newRaftConfiguration.getPeersList();
- LOG.info("Received Configuration change notification from Ratis. New Peer"
+
- " list:\n{}", newPeers);
+ List<String> newPeersLogWithoutStartupRole = newPeers.stream()
+ .map(peer -> String.format("id: \"%s\" address: \"%s\"",
peer.getId().toStringUtf8(), peer.getAddress()))
+ .collect(Collectors.toList());
+ LOG.info("Received Configuration change notification from Ratis. New Peer
list: {}", newPeersLogWithoutStartupRole);
Review Comment:
- Let's use StringBuilder instead of creating a new List.
- Print also term and index.
```java
final StringBuilder b = new StringBuilder(1024)
.append("notifyConfigurationChanged from Ratis: term=").append(term)
.append(", index=").append(index)
.append(", New Peer list: ");
newPeers.forEach(peer ->
b.append(peer.getId()).append("(").append(peer.getAddress()).append("), "));
LOG.info(b.substring(0, b.length() - 2));
```
--
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]