[
https://issues.apache.org/jira/browse/FLINK-14793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Flink Jira Bot updated FLINK-14793:
-----------------------------------
Labels: auto-deprioritized-major auto-deprioritized-minor (was:
auto-deprioritized-major stale-minor)
Priority: Not a Priority (was: Minor)
This issue was labeled "stale-minor" 7 days ago and has not received any
updates so it is being deprioritized. If this ticket is actually Minor, please
raise the priority and ask a committer to assign you the issue or revive the
public discussion.
> Add SPI interface to discovery state backend and establish well-known names
> ---------------------------------------------------------------------------
>
> Key: FLINK-14793
> URL: https://issues.apache.org/jira/browse/FLINK-14793
> Project: Flink
> Issue Type: New Feature
> Components: Runtime / State Backends
> Reporter: Kezhu Wang
> Priority: Not a Priority
> Labels: auto-deprioritized-major, auto-deprioritized-minor
>
> Currently, {{StateBackendLoader.loadStateBackendFromConfig}} uses hybrid of
> hardcoded state backend name and class path to construct
> {{StateBackendFactory}}.
> I think we can provide a SPI interface, say \{{StateBackendProvider}}, to
> accomplish this.
> {code:title=StateBackendProvider.java}
> /**
> * SPI interface for {@link StateBackend} discovery and naming.
> *
> * @param <T> StateBackend
> */
> @PublicEvolving
> public interface StateBackendProvider<T extends StateBackend> extends
> StateBackendFactory<T> {
> /**
> * Name of provided {@link StateBackend}.
> *
> * @return name of provided {@link StateBackend}
> */
> @Nonnull
> String name();
> /**
> * Aliases for provided {@link StateBackend}. Implementations can use
> this for deprecated names.
> *
> * @return aliases for provided {@link StateBackend}
> */
> default Set<String> aliases() {
> return Collections.emptySet();
> }
> }
> {code}
> With above spi, we gain several benefits over current hardcode and class path
> approach:
> * Explicit and established state backend naming and discovery instead of
> hardcoded. We can know exactly which state backends are avaiable and whether
> they are provided by user jars or not.
> * In state backend configuration, we can simply use established state
> backend name while not tied to fragile class path which is easily refactored
> out without great caution. These established state backend names could be
> flink community level, such as `jobmanager`, `filesystem` and `rocksdb`, and
> corporation level, such as `corporation-a.product.state-backend-basename`.
> Together with FLINK-14790, we can switch among state backends without
> knowledge of concrete implementation of target state backends in source code
> level.
> * More compatible with java module shipped in java 9 and above.
> Discovery of state backend can be restricted in {{StateBackendLoader}}, and
> we can fallback to class path approach if no matching state backend found in
> discovered state backends.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)