[GitHub] sijie commented on a change in pull request #1535: Issue #1536: Introduce Short Topic Name

2018-04-12 Thread GitBox
sijie commented on a change in pull request #1535: Issue #1536: Introduce Short 
Topic Name
URL: https://github.com/apache/incubator-pulsar/pull/1535#discussion_r181198970
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java
 ##
 @@ -240,6 +242,22 @@ void start() throws Exception {
 log.info(e.getMessage());
 }
 
+// Create a public tenant and default namespace
+final String publicTenant = TopicName.PUBLIC_PROPERTY;
+final String defaultNamespace = TopicName.PUBLIC_PROPERTY + "/" + 
TopicName.DEFAULT_NAMESPACE;
+try {
+if (!admin.properties().getProperties().contains(publicTenant)) {
+admin.properties().createProperty(
+publicTenant,
+new 
PropertyAdmin(Sets.newHashSet(config.getSuperUserRoles()), 
Sets.newHashSet(cluster)));
+}
+if 
(!admin.namespaces().getNamespaces(publicTenant).contains(defaultNamespace)) {
+admin.namespaces().createNamespace(defaultNamespace);
 
 Review comment:
   done


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] sijie commented on a change in pull request #1535: Issue #1536: Introduce Short Topic Name

2018-04-12 Thread GitBox
sijie commented on a change in pull request #1535: Issue #1536: Introduce Short 
Topic Name
URL: https://github.com/apache/incubator-pulsar/pull/1535#discussion_r181195826
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
 ##
 @@ -143,8 +149,54 @@ public static void main(String[] args) throws Exception {
 // Ignore
 }
 
+// Create public tenant
+PropertyAdmin publicProperty = new PropertyAdmin();
+byte[] publicPropertyDataJson = 
ObjectMapperFactory.getThreadLocal().writeValueAsBytes(publicProperty);
 
 Review comment:
   created a public/default namespace at standalone


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:
us...@infra.apache.org


With regards,
Apache Git Services