azagrebin commented on a change in pull request #8479: [FLINK-11193][State
Backends]Use user passed configuration overriding default configuration loading
from file
URL: https://github.com/apache/flink/pull/8479#discussion_r321243716
##########
File path:
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java
##########
@@ -314,10 +315,12 @@ private RocksDBStateBackend(RocksDBStateBackend
original, Configuration config,
this.enableTtlCompactionFilter =
original.enableTtlCompactionFilter
.resolveUndefined(config.getBoolean(TTL_COMPACT_FILTER_ENABLED));
- final String priorityQueueTypeString =
config.getString(TIMER_SERVICE_FACTORY);
-
- this.priorityQueueStateType = priorityQueueTypeString.length()
> 0 ?
-
PriorityQueueStateType.valueOf(priorityQueueTypeString.toUpperCase()) :
original.priorityQueueStateType;
+ if (original.priorityQueueStateType ==
PriorityQueueStateType.UNDEFINED) {
+ String priorityQueueTypeString =
config.getString(TIMER_SERVICE_FACTORY);
+ this.priorityQueueStateType =
PriorityQueueStateType.valueOf(priorityQueueTypeString.toUpperCase());
Review comment:
I think introducing `UNDEFINED` makes sense in general but I am wondering if
making it @Nullable and leaving initialized by `null` is actually simpler in
this case. If we use `UNDEFINED`, I think we also have to check here explicitly
and then test it that if user configures `UNDEFINED` then she gets an error at
once.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services