poorbarcode commented on code in PR #19631:
URL: https://github.com/apache/pulsar/pull/19631#discussion_r1226210982
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/SnapshotSegmentAbortedTxnProcessorImpl.java:
##########
@@ -384,8 +385,12 @@ public CompletableFuture<Void> clearAbortedTxnSnapshot() {
}
@Override
- public long getLastSnapshotTimestamps() {
- return this.lastSnapshotTimestamps;
+ public void getSnapshotStats(TransactionBufferStats stats) {
+ stats.lastSnapshotTimestamps = this.lastSnapshotTimestamps;
+ TransactionBufferStats.SnapshotStats snapshotStats = new
TransactionBufferStats.SnapshotStats();
+ snapshotStats.segmentsSize = this.indexes.size();
+ snapshotStats.unsealedAbortTxnIDs = this.unsealedTxnIds.size();
+ stats.snapshotStats = snapshotStats;
Review Comment:
> In my view, this particular call is only retrieving data at the
lastSnapshotTimestamps timestamp. If the user has an expected result, they can
make multiple admin calls for that purpose.
If users knew the correct value, they do not need this API anymore, right?
--
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]