ChenSammi commented on code in PR #3398:
URL: https://github.com/apache/ozone/pull/3398#discussion_r871131449


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreSchemaThreeImpl.java:
##########
@@ -88,4 +92,47 @@ public void removeKVContainerData(long containerID) throws 
IOException {
       getBatchHandler().commitBatchOperation(batch);
     }
   }
+
+  public void dumpKVContainerData(long containerID, File metaDir)
+      throws IOException {
+    String prefix = getContainerKeyPrefix(containerID);
+    getMetadataTable().dumpToFileWithPrefix(
+        getTableDumpFile(getMetadataTable(), metaDir), prefix);
+    getBlockDataTable().dumpToFileWithPrefix(
+        getTableDumpFile(getBlockDataTable(), metaDir), prefix);
+    getDeletedBlocksTable().dumpToFileWithPrefix(
+        getTableDumpFile(getDeletedBlocksTable(), metaDir), prefix);
+    getDeleteTransactionTable().dumpToFileWithPrefix(
+        getTableDumpFile(getDeleteTransactionTable(), metaDir),
+        prefix);
+  }
+
+  public void loadKVContainerData(File metaDir)
+      throws IOException {
+    getMetadataTable().loadFromFile(
+        getTableDumpFile(getMetadataTable(), metaDir));
+    getBlockDataTable().loadFromFile(
+        getTableDumpFile(getBlockDataTable(), metaDir));
+    getDeletedBlocksTable().loadFromFile(
+        getTableDumpFile(getDeletedBlocksTable(), metaDir));
+    getDeleteTransactionTable().loadFromFile(
+        getTableDumpFile(getDeleteTransactionTable(), metaDir));
+  }
+
+  public void cleanupAllDumpFiles(File metaDir)

Review Comment:
   Can we more this cleanupAllDumpFiles to BlockUtils.java, and make it a 
static function? 
   And rename it to deleteAllDumpFiles.



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