Technoboy- commented on a change in pull request #14141:
URL: https://github.com/apache/pulsar/pull/14141#discussion_r800408253
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/PersistentTopics.java
##########
@@ -228,15 +228,33 @@ public void createNonPartitionedTopic(
@ApiResponse(code = 406, message = "The number of partitions
should be more than 0"
+ " and less than or equal to
maxNumPartitionsPerPartitionedTopic"),
@ApiResponse(code = 409, message = "Partitioned topic does not
exist")})
- public void updatePartitionedTopic(@PathParam("property") String property,
@PathParam("cluster") String cluster,
+ public void updatePartitionedTopic(
+ @Suspended final AsyncResponse asyncResponse,
+ @PathParam("property") String property, @PathParam("cluster")
String cluster,
@PathParam("namespace") String namespace, @PathParam("topic")
@Encoded String encodedTopic,
@QueryParam("updateLocalTopicOnly") @DefaultValue("false") boolean
updateLocalTopicOnly,
@ApiParam(value = "Is authentication required to perform this
operation")
@QueryParam("authoritative") @DefaultValue("false") boolean
authoritative,
@QueryParam("force") @DefaultValue("false") boolean force,
int numPartitions) {
- validateTopicName(property, cluster, namespace, encodedTopic);
- internalUpdatePartitionedTopic(numPartitions, updateLocalTopicOnly,
authoritative, force);
+ try {
+ validateTopicName(property, cluster, namespace, encodedTopic);
+ internalUpdatePartitionedTopicAsync(numPartitions,
updateLocalTopicOnly, authoritative, force)
+ .thenAccept(__ ->
asyncResponse.resume(Response.noContent().build()))
+ .exceptionally(ex -> {
+ Throwable cause = ex.getCause();
Review comment:
ok.
--
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]