ConcurrencyPractitioner commented on a change in pull request #3625: [Issue 
#3436][pulsar-broker] Creating REST Endpoint for non-partitioned topic creation
URL: https://github.com/apache/pulsar/pull/3625#discussion_r258569854
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
 ##########
 @@ -140,6 +140,23 @@ public void createPartitionedTopic(@PathParam("tenant") 
String tenant, @PathPara
         internalCreatePartitionedTopic(numPartitions, authoritative);
     }
 
+    @PUT
+    @Path("/{tenant}/{namespace}/{topic}")
+    @ApiOperation(value="Create a non-partitioned topic.", notes = "This is 
the only REST endpoint from which non-partitioned topics could be created.")
+    @ApiResponses(value = {
+        @ApiResponse(code = 403, message = "Don't have admin permission"),
+        @ApiResponse(code = 409, message = "Partitioned topic already exist"),
+        @ApiResponse(code = 412, message = "Failed Reason : Name is invalid or 
Namespace does not have any clusters configured"),
+        @ApiResponse(code = 503, message = "Failed to validate global cluster 
configuration")
+    })
+    public void createNonPartitionedTopic(@PathParam("tenant") String tenant, 
@PathParam("namespace") String namespace,
+            @PathParam("topic") @Encoded String encodedTopic, 
+            @QueryParam("authoritative") @DefaultValue("false") boolean 
authoritative) {
+       validateGlobalNamespaceOwnership(tenant,namespace);
+        validatePartitionedTopicName(tenant, namespace, encodedTopic);
 
 Review comment:
   Yeah, good point.

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

Reply via email to