Xushaohong commented on code in PR #3615:
URL: https://github.com/apache/ozone/pull/3615#discussion_r936517395
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImpl.java:
##########
@@ -181,6 +182,25 @@ public void incrementCount(List<Long> txIDs)
}
}
+ /**
+ * {@inheritDoc}
+ *
+ */
+ @Override
+ public int resetCount(List<Long> txIDs) throws IOException, TimeoutException
{
+ lock.lock();
+ try {
+ if (txIDs == null || txIDs.isEmpty()) {
+ txIDs = getFailedTransactions().stream()
+ .map(DeletedBlocksTransaction::getTxID)
+ .collect(Collectors.toList());
+ }
+ return deletedBlockLogStateManager.resetRetryCountOfTransactionInDB(
+ new ArrayList<>(new HashSet<>(txIDs)));
Review Comment:
> resetRetryCountOfTransactionInDB can take List as input. Then we dont need
the conversions.
Here the first conversion to ArrayList is essential, coz the list itself is
an interface and cannot be instantiated when triggering @Replicate method, the
argument needs to be instantiated.
The second conversion is to eliminate the duplicate txns, this also helps
reduce further processes and data transfer if send too much same txId. I think
it also meaningful.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]