1996fanrui commented on code in PR #27069:
URL: https://github.com/apache/flink/pull/27069#discussion_r2394819242
##########
flink-core/src/main/java/org/apache/flink/api/common/state/KeyedStateStore.java:
##########
@@ -338,4 +338,13 @@ org.apache.flink.api.common.state.v2.AggregatingState<IN,
OUT> getAggregatingSta
org.apache.flink.api.common.state.v2.AggregatingStateDescriptor<
IN, ACC, OUT>
stateProperties);
+
+ /**
+ * @return fixed lower-case string identifying the type of the underlying
state backend, e.g.
+ * rocksdb, hashmap, forst, batch, or unknown.
+ */
+ @Experimental
+ default String getBackendTypeIdentifier() {
+ return "unknown";
Review Comment:
nit: How about removing the default implementation? This would prevent
subclasses from forgetting to override `getBackendTypeIdentifier`.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapKeyedStateBackend.java:
##########
@@ -406,6 +406,11 @@ public <N> Stream<Tuple2<K, N>>
getKeysAndNamespaces(String state) {
return table.getKeysAndNamespaces();
}
+ @Override
+ public String getBackendTypeIdentifier() {
+ return "hashmap";
Review Comment:
How about re-using `StateBackendLoader#HASHMAP_STATE_BACKEND_NAME`?
`ROCKSDB_STATE_BACKEND_NAME` and `FORST_STATE_BACKEND_NAME` are similar, and
caller could reuse these static field as well.
--
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]