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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogStateManagerImpl.java:
##########
@@ -181,6 +210,31 @@ public int 
resetRetryCountOfTransactionInDB(ArrayList<Long> txIDs)
     return 0;
   }
 
+  @Override
+  public ArrayList<DeletedBlocksTransaction> 
getTransactionsFromDB(ArrayList<Long> txIDs) throws IOException {

Review Comment:
   No call of this api is found, unused method to be removed



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMDeletedBlockTransactionStatusManager.java:
##########
@@ -545,4 +638,93 @@ public void removeTransactionFromDNsCommitMap(List<Long> 
txIds) {
   public void removeTransactionFromDNsRetryCountMap(List<Long> txIds) {
     txIds.forEach(transactionToRetryCountMap::remove);
   }
+  
+  public void reinitialize(Table<String, ByteString> configTable) throws 
IOException {
+    // DB onFlush() will be called before reinitialization.
+    this.statefulConfigTable = configTable;
+    this.initDataDistributionData();
+  }
+
+  @VisibleForTesting
+  public Map<Long, TxBlockInfo> getTxSizeMap() {
+    return txSizeMap;
+  }
+
+  @VisibleForTesting
+  public static void setDisableDataDistributionForTest(boolean disabled) {
+    disableDataDistributionForTest = disabled;
+  }
+
+  @Nullable
+  public DeletedBlocksTransactionSummary getTransactionSummary() {
+    if 
(!VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION))
 {

Review Comment:
   STORAGE_SPACE_DISTRIBUTION here also not required, by default will be 0 if 
not finalized, this is redundant check.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHADBTransactionBufferImpl.java:
##########
@@ -54,6 +54,7 @@ public class SCMHADBTransactionBufferImpl implements 
SCMHADBTransactionBuffer {
   private final AtomicLong txFlushPending = new AtomicLong(0);
   private long lastSnapshotTimeMs = 0;
   private final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
+  private boolean autoFlushEnabled = true;

Review Comment:
   This flag is of no meaning now, can be removed



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMDeletedBlockTransactionStatusManager.java:
##########
@@ -545,4 +638,93 @@ public void removeTransactionFromDNsCommitMap(List<Long> 
txIds) {
   public void removeTransactionFromDNsRetryCountMap(List<Long> txIds) {
     txIds.forEach(transactionToRetryCountMap::remove);
   }
+  
+  public void reinitialize(Table<String, ByteString> configTable) throws 
IOException {
+    // DB onFlush() will be called before reinitialization.
+    this.statefulConfigTable = configTable;
+    this.initDataDistributionData();
+  }
+
+  @VisibleForTesting
+  public Map<Long, TxBlockInfo> getTxSizeMap() {
+    return txSizeMap;
+  }
+
+  @VisibleForTesting
+  public static void setDisableDataDistributionForTest(boolean disabled) {
+    disableDataDistributionForTest = disabled;
+  }
+
+  @Nullable
+  public DeletedBlocksTransactionSummary getTransactionSummary() {
+    if 
(!VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION))
 {
+      return null;
+    }
+    return DeletedBlocksTransactionSummary.newBuilder()
+        .setTotalTransactionCount(totalTxCount.get())
+        .setTotalBlockCount(totalBlockCount.get())
+        .setTotalBlockSize(totalBlocksSize.get())
+        .setTotalBlockReplicatedSize(totalReplicatedBlocksSize.get())
+        .build();
+  }
+
+  private void initDataDistributionData() throws IOException {
+    if 
(VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION))
 {

Review Comment:
   STORAGE_SPACE_DISTRIBUTION check may not be required, it will not be 
available before finalize and on first startup for new version,



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