You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/02 08:57:28 UTC

[GitHub] [hadoop-ozone] bshashikant commented on a change in pull request #709: HDDS-3244. Improve write efficiency by opening RocksDB only once

bshashikant commented on a change in pull request #709: HDDS-3244. Improve write efficiency by opening RocksDB only once
URL: https://github.com/apache/hadoop-ozone/pull/709#discussion_r402156482
 
 

 ##########
 File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java
 ##########
 @@ -73,14 +73,13 @@ public static void createContainerMetaData(File containerMetaDataPath, File
       throw new IOException("Unable to create directory for metadata storage." +
           " Path: " + containerMetaDataPath);
     }
+
     MetadataStore store = MetadataStoreBuilder.newBuilder().setConf(conf)
         .setCreateIfMissing(true).setDbFile(dbFile).build();
-
-    // we close since the SCM pre-creates containers.
-    // we will open and put Db handle into a cache when keys are being created
-    // in a container.
-
-    store.close();
+    ReferenceCountedDB db =
+        new ReferenceCountedDB(store, dbFile.getAbsolutePath());
+    //add db handler into cache
+    BlockUtils.addDB(db, dbFile.getAbsolutePath(), conf);
 
 Review comment:
   I think its better to update the cache only at the end of function "createContainerMetaData" so that even if the chunk dir creation fails, we it won't be added to the container cache.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org