jsancio commented on code in PR #18957:
URL: https://github.com/apache/kafka/pull/18957#discussion_r1965923366
##########
tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java:
##########
@@ -404,16 +404,16 @@ static Set<RaftVoterEndpoint>
getControllerAdvertisedListeners(
}
LinkedHashSet<RaftVoterEndpoint> results = new LinkedHashSet<>();
for (String listenerName : props.getProperty(
- KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")) {
+ KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")) {
Review Comment:
How about this indentation and formatting so that the for loop statement
block is clearly separated from the for loop iterable.
```java
for (String listenerName : props.getProperty(
KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")
) {
```
##########
tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java:
##########
@@ -404,16 +404,16 @@ static Set<RaftVoterEndpoint>
getControllerAdvertisedListeners(
}
LinkedHashSet<RaftVoterEndpoint> results = new LinkedHashSet<>();
for (String listenerName : props.getProperty(
- KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")) {
+ KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")) {
listenerName = ListenerName.normalised(listenerName).value();
Endpoint endpoint = listeners.get(listenerName);
if (endpoint == null) {
throw new TerseException("Cannot find information about
controller listener name: " +
listenerName);
}
results.add(new RaftVoterEndpoint(endpoint.listenerName().get(),
- endpoint.host() == null ? "localhost" : endpoint.host(),
- endpoint.port()));
+ endpoint.host() == null ? "localhost" : endpoint.host(),
+ endpoint.port()));
Review Comment:
How about this formatting?
```java
results.add(
new RaftVoterEndpoint(
endpoint.listenerName().get(),
endpoint.host() == null ? "localhost" : endpoint.host(),
endpoint.port()
)
);
```
##########
tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java:
##########
@@ -266,13 +266,13 @@ else if (leader.lastCaughtUpTimestamp().isPresent() &&
maxLagFollower.lastCaught
System.out.println(
"ClusterId: " + clusterId +
- "\nLeaderId: " + quorumInfo.leaderId() +
- "\nLeaderEpoch: " + quorumInfo.leaderEpoch() +
- "\nHighWatermark: " + quorumInfo.highWatermark() +
- "\nMaxFollowerLag: " + maxFollowerLag +
- "\nMaxFollowerLagTimeMs: " + maxFollowerLagTimeMs +
- "\nCurrentVoters: " + printVoterState(quorumInfo) +
- "\nCurrentObservers: " + printObserverState(quorumInfo)
+ "\nLeaderId: " + quorumInfo.leaderId() +
+ "\nLeaderEpoch: " + quorumInfo.leaderEpoch() +
+ "\nHighWatermark: " + quorumInfo.highWatermark() +
+ "\nMaxFollowerLag: " + maxFollowerLag +
+ "\nMaxFollowerLagTimeMs: " + maxFollowerLagTimeMs +
+ "\nCurrentVoters: " + printVoterState(quorumInfo) +
+ "\nCurrentObservers: " + printObserverState(quorumInfo)
Review Comment:
This indentation doesn't look correct. We indent Java code using 4 spaces.
--
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]