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 2020/12/24 01:12:03 UTC

[GitHub] [pulsar] hangc0276 commented on a change in pull request #9042: support namespace policy for maxTopicsPerNamespace limit

hangc0276 commented on a change in pull request #9042:
URL: https://github.com/apache/pulsar/pull/9042#discussion_r548338780



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -811,9 +811,14 @@ protected boolean isNamespaceReplicated(NamespaceName namespaceName) {
     }
 
     protected void internalCreatePartitionedTopic(AsyncResponse asyncResponse, int numPartitions) {
-        final int maxTopicsPerNamespace = pulsar().getConfig().getMaxTopicsPerNamespace();
-        if (maxTopicsPerNamespace > 0) {
-            try {
+        Integer maxTopicsPerNamespace;
+        try {
+            maxTopicsPerNamespace = getNamespacePolicies(namespaceName).max_topics_per_namespace;
+            if (maxTopicsPerNamespace == null || maxTopicsPerNamespace < 0) {

Review comment:
       OK, `maxTopicsPerNamespace` is get from namespace policy, it must be greater than 0, i update the code.




----------------------------------------------------------------
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.

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