poorbarcode commented on code in PR #16758:
URL: https://github.com/apache/pulsar/pull/16758#discussion_r935781120
##########
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriter.java:
##########
@@ -272,23 +290,43 @@ private void doTrigFlush(boolean force, boolean
byScheduleThreads){
return;
}
if (force) {
+ if (metricsStats != null) {
Review Comment:
> We can add a default TxnLogBufferedWriterMetricsStatsDisabled
implementation to avoid many null checks.
Good Idea. In the complete design, we should have two implementations like
UML blow, one for enabling the batch feature, and another for disabled:

Sorry, I should have added some comments here.
I didn't want to support disabled metrics stat in the design, even if the
Txn Buffered Writer disabled the batch feature. This constructor without
`metricsStats` and "null checks" will be removed in the next PR. This is only
compatible to split the PR, making each PR has less code
--
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]