pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] saandrews commented on a change in pull request #903: PIP-8: Introduce peer cluster for global namespace redirection
Date Thu, 01 Jan 1970 00:00:00 GMT
saandrews commented on a change in pull request #903: PIP-8: Introduce peer cluster for global
namespace redirection
URL: https://github.com/apache/incubator-pulsar/pull/903#discussion_r152129058
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/Namespaces.java
 ##########
 @@ -1495,5 +1502,35 @@ private void unsubscribe(NamespaceName nsName, String bundleRange,
String subscr
         }
     }
 
+    /**
+     * It validates that peer-clusters can't coexist in replication-clusters
+     * 
+     * @param clusterName:
+     *            given cluster whose peer-clusters can't be present into replication-cluster
list
+     * @param clusters:
+     *            replication-cluster list
+     */
+    private void validatePeerClusterConflict(String clusterName, Set<String> clusters)
{
+        try {
+            Optional<ClusterData> clusterData = clustersCache().get(path("clusters",
clusterName));
+            if (clusterData.isPresent()) {
+                LinkedHashSet<String> peerClusters = clusterData.get().getPeerClusterNames();
+                if (peerClusters != null && !peerClusters.isEmpty()) {
+                    SetView<String> conflictPeerClusters = Sets.intersection(peerClusters,
clusters);
+                    if (!conflictPeerClusters.isEmpty()) {
+                        log.warn("[{}] {}'s peer cluster can't be part of replication clusters
{}", clientAppId(),
 
 Review comment:
   Can you also log replication clusters?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message