[GitHub] merlimat commented on issue #1506: Underscore `_` should be allowed as property name

2018-04-06 Thread GitBox
merlimat commented on issue #1506: Underscore `_` should be allowed as property 
name
URL: 
https://github.com/apache/incubator-pulsar/issues/1506#issuecomment-379410968
 
 
   Added test case in #1516


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] merlimat commented on issue #1506: Underscore `_` should be allowed as property name

2018-04-06 Thread GitBox
merlimat commented on issue #1506: Underscore `_` should be allowed as property 
name
URL: 
https://github.com/apache/incubator-pulsar/issues/1506#issuecomment-379309339
 
 
   @zubchenok Yes, I verified this is a problem in 1.22 : 
   
   ```
   $ bin/pulsar-admin properties create -r tests -c standalone test_prop
   $ bin/pulsar-admin namespaces create test_prop/standalone/my-ns
   Got exception: Invalid trailing chars in named entity: 
http://test_prop/standalone/my-ns
   java.lang.IllegalArgumentException: Invalid trailing chars in named entity: 
http://test_prop/standalone/my-ns
at 
org.apache.pulsar.common.naming.NamedEntity.checkURI(NamedEntity.java:43)
at 
org.apache.pulsar.common.naming.NamespaceName.validateNamespaceName(NamespaceName.java:164)
at 
org.apache.pulsar.common.naming.NamespaceName.(NamespaceName.java:78)
at 
org.apache.pulsar.common.naming.NamespaceName.(NamespaceName.java:34)
at 
org.apache.pulsar.common.naming.NamespaceName$1.load(NamespaceName.java:46)
at 
org.apache.pulsar.common.naming.NamespaceName$1.load(NamespaceName.java:43)
at 
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3628)
at 
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2336)
at 
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2295)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2208)
at com.google.common.cache.LocalCache.get(LocalCache.java:4053)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4057)
at 
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4986)
at 
org.apache.pulsar.common.naming.NamespaceName.get(NamespaceName.java:62)
at 
org.apache.pulsar.admin.cli.CliCommand.validateNamespace(CliCommand.java:43)
at 
org.apache.pulsar.admin.cli.CmdNamespaces$Create.run(CmdNamespaces.java:102)
at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:61)
at 
org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:141)
at 
org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:162)
   ```
   
   This is not happening anymore in master, so I'll add a quick test to ensure 
it stays the same.


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] merlimat commented on issue #1506: Underscore `_` should be allowed as property name

2018-04-05 Thread GitBox
merlimat commented on issue #1506: Underscore `_` should be allowed as property 
name
URL: 
https://github.com/apache/incubator-pulsar/issues/1506#issuecomment-379089364
 
 
   Cannot reproduce the issue in current master code: 
   
   ```java
   PropertyAdmin propertyAdmin = new PropertyAdmin(Sets.newHashSet("role1", 
"role2"), Sets.newHashSet("use"));
   admin.properties().createProperty("prop_xyz", propertyAdmin);
   
   admin.namespaces().createNamespace("prop_xyz/use/my-namespace");
   
   String topic = "persistent://prop_xyz/use/my-namespace/my-topic";
   
   Producer producer = pulsarClient.newProducer().topic(topic)
   .create();
   
   PersistentTopicStats stats = admin.persistentTopics().getStats(topic);
   assertEquals(stats.publishers.size(), 1);
   producer.close();
   ```
   
   the reason the pattern works is that `\w` already includes `_` as a matching 
character
   and when creating a property, I’ve check that the same format is performed. 
   
   @zubchenok Can you describe how you got the error?
   
   `NamedEntity.checkURI()` is not used anymore. Maybe this was a problem in 
1.22 release?


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