You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/27 11:09:13 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #16239: [fix][broker]fix npe when invoke replaceBookie.

codelipenghui commented on code in PR #16239:
URL: https://github.com/apache/pulsar/pull/16239#discussion_r907261919


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java:
##########
@@ -206,9 +206,13 @@ private static Pair<Set<String>, Set<String>> getIsolationGroup(
                     castToString(properties.getOrDefault(SECONDARY_ISOLATION_BOOKIE_GROUPS, ""));
             if (!primaryIsolationGroupString.isEmpty()) {
                 pair.setLeft(new HashSet(Arrays.asList(primaryIsolationGroupString.split(","))));
+            } else {
+                pair.setLeft(new HashSet());

Review Comment:
   ```suggestion
                   pair.setLeft(Collections.emptySet());
   ```



##########
pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java:
##########
@@ -206,9 +206,13 @@ private static Pair<Set<String>, Set<String>> getIsolationGroup(
                     castToString(properties.getOrDefault(SECONDARY_ISOLATION_BOOKIE_GROUPS, ""));
             if (!primaryIsolationGroupString.isEmpty()) {
                 pair.setLeft(new HashSet(Arrays.asList(primaryIsolationGroupString.split(","))));
+            } else {
+                pair.setLeft(new HashSet());
             }
             if (!secondaryIsolationGroupString.isEmpty()) {
                 pair.setRight(new HashSet(Arrays.asList(secondaryIsolationGroupString.split(","))));
+            } else {
+                pair.setRight(new HashSet());

Review Comment:
   ```suggestion
                   pair.setLeft(Collections.emptySet());
   ```



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org