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


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/BlockUtils.java:
##########
@@ -249,4 +252,64 @@ public static void 
removeContainerFromDB(KeyValueContainerData containerData,
           containerData.getContainerID());
     }
   }
+
+  /**
+   * Dump container KV metadata to external files.
+   * @param containerData
+   * @param conf
+   * @throws StorageContainerException
+   */
+  public static void dumpKVContainerDataToFiles(
+      KeyValueContainerData containerData,
+      ConfigurationSource conf) throws IOException {
+    try (DBHandle db = getDB(containerData, conf)) {
+      Preconditions.checkState(db.getStore()
+          instanceof DatanodeStoreSchemaThreeImpl);
+
+      DatanodeStoreSchemaThreeImpl store = (DatanodeStoreSchemaThreeImpl)
+          db.getStore();
+      File metaDir = new File(containerData.getMetadataPath());
+      try {
+        store.dumpKVContainerData(containerData.getContainerID(), metaDir);

Review Comment:
   Could you link the document that this "SstFileWriter will reopen a fresh 
file each time" statement is explained?  If we provide the same dest dir, 
export a container, keep the dumped sst files, then export the container again, 
what the dest dir will look like?  For a dumped table, will there be 2 files, 
or just 1 file?



##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainer.java:
##########
@@ -216,8 +213,6 @@ public void testEmptyContainerImportExport() throws 
Exception {
 
   @Test
   public void testContainerImportExport() throws Exception {
-    assumeFalse(schemaVersion.equals(OzoneConsts.SCHEMA_V3));

Review Comment:
   OK.



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