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



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/StateBackendLoader.java
##########
@@ -233,6 +236,27 @@ public static StateBackend 
fromApplicationOrConfigOrDefault(
                return backend;
        }
 
+       /**
+        * Checks whether state backend uses managed memory, without having to 
deserialize or load the state backend.
+        * @param config Cluster configuration.
+        * @param fromApplicationStateBackendName Class name of 
application-defined state backend, or null if not defined.
+        * @return Whether the state backend uses managed memory.
+        */
+       public static boolean 
stateBackendFraomApplicationOrConfigOrDefaultUseManagedMemory(
+                       Configuration config,
+                       @Nullable String fromApplicationStateBackendName) {
+
+               checkNotNull(config, "config");
+
+               if (fromApplicationStateBackendName != null) {
+                       return Objects.equals(fromApplicationStateBackendName, 
ROCKSDB_STATE_BACKEND_CLASS_NAME);
+               }
+
+               final String stateBackendFactory = 
config.getString(CheckpointingOptions.STATE_BACKEND);
+               return Objects.equals(stateBackendFactory, 
ROCKSDB_STATE_BACKEND_NAME) ||

Review comment:
       This method actually checks whether the state backend is 
`RocksDBStateBackend`, however, considering that state backend is pluginable 
and any users could implement their own state backend, we should better make 
this extensible instead of limit this feature only to RocksDB.

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/StateBackendLoader.java
##########
@@ -233,6 +236,27 @@ public static StateBackend 
fromApplicationOrConfigOrDefault(
                return backend;
        }
 
+       /**
+        * Checks whether state backend uses managed memory, without having to 
deserialize or load the state backend.
+        * @param config Cluster configuration.
+        * @param fromApplicationStateBackendName Class name of 
application-defined state backend, or null if not defined.
+        * @return Whether the state backend uses managed memory.
+        */
+       public static boolean 
stateBackendFraomApplicationOrConfigOrDefaultUseManagedMemory(

Review comment:
       typo `Fraom` --> `From`




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to