You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by eo...@apache.org on 2021/05/13 07:46:06 UTC

[pulsar] 12/46: Update "sample" tenant on standalone to stop using old property/cluster/namespace naming convention.

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch 2.7.2_ds_tmp
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit e03a65fb59f441703a1f350f1ef8c80e8c39b52a
Author: Chris Bartholomew <c_...@yahoo.com>
AuthorDate: Sat Feb 15 15:55:49 2020 -0500

    Update "sample" tenant on standalone to stop using old property/cluster/namespace naming convention.
    
    (cherry picked from commit dbe1feeb3940691ece94f39f17463d4733f56995)
---
 .../src/main/java/org/apache/pulsar/PulsarStandalone.java      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
index d5ec2eb..a8210bb 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
@@ -392,9 +392,9 @@ public class PulsarStandalone implements AutoCloseable {
 
     private void createSampleNameSpace(ClusterData clusterData, String cluster) {
         // Create a sample namespace
-        final String property = "sample";
+        final String tenant = "sample";
         final String globalCluster = "global";
-        final String namespace = property + "/" + cluster + "/ns1";
+        final String namespace = tenant + "/ns1";
         try {
             if (!admin.clusters().getClusters().contains(cluster)) {
                 admin.clusters().createCluster(cluster, clusterData);
@@ -407,12 +407,12 @@ public class PulsarStandalone implements AutoCloseable {
                 admin.clusters().createCluster(globalCluster, new ClusterData(null, null));
             }
 
-            if (!admin.tenants().getTenants().contains(property)) {
-                admin.tenants().createTenant(property,
+            if (!admin.tenants().getTenants().contains(tenant)) {
+                admin.tenants().createTenant(tenant,
                         new TenantInfo(Sets.newHashSet(config.getSuperUserRoles()), Sets.newHashSet(cluster)));
             }
 
-            if (!admin.namespaces().getNamespaces(property).contains(namespace)) {
+            if (!admin.namespaces().getNamespaces(tenant).contains(namespace)) {
                 admin.namespaces().createNamespace(namespace);
             }
         } catch (PulsarAdminException e) {