Galsza commented on code in PR #8173:
URL: https://github.com/apache/ozone/pull/8173#discussion_r2025074878


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBProfile.java:
##########
@@ -44,51 +49,98 @@ public String toString() {
     }
 
     @Override
-    public ManagedColumnFamilyOptions getColumnFamilyOptions() {
-      // Write Buffer Size -- set to 128 MB
-      final long writeBufferSize = toLong(StorageUnit.MB.toBytes(128));
+    public ManagedDBOptions getDBOptions(Path dbPath) {
+      ManagedDBOptions option = null;
+      try {
+        if (dbPath != null) {
+          option = DBConfigFromFile.readDBOptionsFromFile(dbPath);
+        }
+      } catch (IOException ex) {
+        LOG.error("Unable to read RocksDB DBOptions from {}, exception {}", 
dbPath, ex);
+      }
+      if (option != null) {
+        LOG.info("Using RocksDB DBOptions from {}.ini file", dbPath);
+      } else {
+        final int maxBackgroundCompactions = 4;
+        final int maxBackgroundFlushes = 2;
+        final long bytesPerSync = toLong(StorageUnit.MB.toBytes(1.00));
+        final boolean createIfMissing = true;
+        final boolean createMissingColumnFamilies = true;
+        ManagedDBOptions dbOptions = new ManagedDBOptions();
+        dbOptions
+            .setIncreaseParallelism(Runtime.getRuntime().availableProcessors())
+            .setMaxBackgroundCompactions(maxBackgroundCompactions)
+            .setMaxBackgroundFlushes(maxBackgroundFlushes)
+            .setBytesPerSync(bytesPerSync)
+            .setCreateIfMissing(createIfMissing)
+            .setCreateMissingColumnFamilies(createMissingColumnFamilies);
+        return dbOptions;
+      }
+      return option;
+    }
+
+    @Override
+    public ManagedColumnFamilyOptions getColumnFamilyOptions(Path dbPath, 
String cfName) {
+      ManagedColumnFamilyOptions option = null;
+      if (Objects.isNull(dbPath)) {

Review Comment:
   The default value for this configuration is empty. In that case it tries 
first reading that as a file, which will obviously fail, and then does a 
fallback which tries the same functionality as before this pull request. So if 
it's a simple db name it tries searching for it on the env variable provided or 
in the OZONE_CONFIG_DIR.



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to