Myasuka commented on a change in pull request #17833:
URL: https://github.com/apache/flink/pull/17833#discussion_r772331229



##########
File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBResourceContainer.java
##########
@@ -371,4 +374,30 @@ private ColumnFamilyOptions 
setColumnFamilyOptionsFromConfigurableOptions(
 
         return currentOptions.setTableFormatConfig(blockBasedTableConfig);
     }
+
+    /**
+     * Get the Flink log directory, under which the default log directory of 
RocksDB is. Finds the
+     * Flink log directory using log.file Java property that is set during 
startup.
+     */
+    private static String getFlinkLogDir() {

Review comment:
       Why this method has to be static?

##########
File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBResourceContainer.java
##########
@@ -297,7 +298,9 @@ private DBOptions 
setDBOptionsFromConfigurableOptions(DBOptions currentOptions)
         
currentOptions.setInfoLogLevel(internalGetOption(RocksDBConfigurableOptions.LOG_LEVEL));
 
         String logDir = internalGetOption(RocksDBConfigurableOptions.LOG_DIR);
-        if (logDir != null && !logDir.isEmpty()) {
+        if (logDir == null || logDir.isEmpty()) {
+            currentOptions.setDbLogDir(getFlinkLogDir());

Review comment:
       I think this method forgets to handle the case that `getFlinkLogDir` 
return `null`.




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


Reply via email to