eolivelli commented on a change in pull request #10650: URL: https://github.com/apache/pulsar/pull/10650#discussion_r638715132
########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java ########## @@ -55,6 +55,55 @@ public void getCoordinatorStatus(@Suspended final AsyncResponse asyncResponse, internalGetCoordinatorStatus(asyncResponse, authoritative, coordinatorId); } + @GET + @Path("/transactionInBufferStats") + @ApiOperation(value = "Get transaction state in transaction buffer.") + @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have admin permission"), + @ApiResponse(code = 404, message = "Tenant or cluster or namespace or topic doesn't exist"), + @ApiResponse(code = 503, message = "This Broker is not configured " + + "with transactionCoordinatorEnabled=true."), + @ApiResponse(code = 307, message = "Topic don't owner by this broker!"), + @ApiResponse(code = 501, message = "Topic is not a persistent topic!"), + @ApiResponse(code = 409, message = "Concurrent modification")}) + public void getTransactionInBufferStats(@Suspended final AsyncResponse asyncResponse, + @QueryParam("authoritative") + @DefaultValue("false") boolean authoritative, + @QueryParam("mostSigBits") Review comment: isn't it a little bit awkward to to pass separately mostSigBits and leastSigBits in a REST API ? can we using a string representation ? do we have other examples in the REST API about splitting the TxID into the two parts ? ########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java ########## @@ -55,6 +55,55 @@ public void getCoordinatorStatus(@Suspended final AsyncResponse asyncResponse, internalGetCoordinatorStatus(asyncResponse, authoritative, coordinatorId); } + @GET + @Path("/transactionInBufferStats") + @ApiOperation(value = "Get transaction state in transaction buffer.") + @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have admin permission"), + @ApiResponse(code = 404, message = "Tenant or cluster or namespace or topic doesn't exist"), + @ApiResponse(code = 503, message = "This Broker is not configured " + + "with transactionCoordinatorEnabled=true."), + @ApiResponse(code = 307, message = "Topic don't owner by this broker!"), + @ApiResponse(code = 501, message = "Topic is not a persistent topic!"), Review comment: "Topic is not a persistent topic" 501 is kind of "internal server error", probably we should return something like "Not allowed" or "Bad request" ########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java ########## @@ -55,6 +55,55 @@ public void getCoordinatorStatus(@Suspended final AsyncResponse asyncResponse, internalGetCoordinatorStatus(asyncResponse, authoritative, coordinatorId); } + @GET + @Path("/transactionInBufferStats") + @ApiOperation(value = "Get transaction state in transaction buffer.") + @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have admin permission"), + @ApiResponse(code = 404, message = "Tenant or cluster or namespace or topic doesn't exist"), + @ApiResponse(code = 503, message = "This Broker is not configured " + + "with transactionCoordinatorEnabled=true."), + @ApiResponse(code = 307, message = "Topic don't owner by this broker!"), Review comment: what about "Topic is not owned by this broker" -- 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: us...@infra.apache.org