priyeshkaratha commented on code in PR #9272:
URL: https://github.com/apache/ozone/pull/9272#discussion_r2532866089


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMDeletedBlockTransactionStatusManager.java:
##########
@@ -415,6 +450,76 @@ private boolean alreadyExecuted(DatanodeID dnId, long 
txId) {
         .contains(dnId);
   }
 
+  @VisibleForTesting
+  public void addTransactions(ArrayList<DeletedBlocksTransaction> txList) 
throws IOException {
+    if (txList.isEmpty()) {
+      return;
+    }
+    if 
(VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION)
 &&
+        !disableDataDistributionForTest) {
+      for (DeletedBlocksTransaction tx: txList) {
+        if (tx.hasTotalBlockSize()) {
+          if (!isFirstTxIdForDataDistributionSet) {
+            // set the first transaction ID for data distribution
+            isFirstTxIdForDataDistributionSet = true;
+            firstTxIdForDataDistribution = tx.getTxID();
+          }
+          incrDeletedBlocksSummary(tx);
+        }
+      }
+      deletedBlockLogStateManager.addTransactionsToDB(txList, getSummary());
+      return;
+    }
+    deletedBlockLogStateManager.addTransactionsToDB(txList);
+  }
+
+  private void incrDeletedBlocksSummary(DeletedBlocksTransaction tx) {
+    totalTxCount.addAndGet(1);
+    totalBlockCount.addAndGet(tx.getLocalIDCount());
+    totalBlocksSize.addAndGet(tx.getTotalBlockSize());
+    totalReplicatedBlocksSize.addAndGet(tx.getTotalBlockReplicatedSize());
+  }
+
+  @VisibleForTesting
+  public void removeTransactions(ArrayList<Long> txIDs) throws IOException {
+    if (txIDs.isEmpty()) {
+      return;
+    }
+    if 
(VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION)
 &&
+        !disableDataDistributionForTest) {
+      ArrayList<Long> txToQueryList = new ArrayList<>();
+      for (Long txID: txIDs) {
+        if (txID >= firstTxIdForDataDistribution) {

Review Comment:
   Removed check with firstTxIdForDataDistribution since firstTxId is removed 
from proto. 



-- 
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]

Reply via email to