lhotari commented on code in PR #23785:
URL: https://github.com/apache/pulsar/pull/23785#discussion_r1905306191


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -3291,12 +3291,14 @@ private CompletableFuture<PartitionedTopicMetadata> 
createDefaultPartitionedTopi
                                                                                
         Optional<Policies> policies) {
         final int defaultNumPartitions = 
pulsar.getBrokerService().getDefaultNumPartitions(topicName, policies);
         final int maxPartitions = 
pulsar().getConfig().getMaxNumPartitionsPerPartitionedTopic();
+        final int systemTopicDefaultNumPartitions = 
pulsar.getConfiguration().getSystemTopicDefaultNumPartitions();
         checkArgument(defaultNumPartitions > 0,
                 "Default number of partitions should be more than 0");
         checkArgument(maxPartitions <= 0 || defaultNumPartitions <= 
maxPartitions,
                 "Number of partitions should be less than or equal to " + 
maxPartitions);
 
-        PartitionedTopicMetadata configMetadata = new 
PartitionedTopicMetadata(defaultNumPartitions);
+        PartitionedTopicMetadata configMetadata = new PartitionedTopicMetadata(
+                isSystemTopic(topicName) ? systemTopicDefaultNumPartitions : 
defaultNumPartitions);

Review Comment:
   Please move the logic to `getDefaultNumPartitions` method.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to