Package io.camunda.zeebe.dynamic.config
Interface ClusterConfigurationInitializer
- All Known Implementing Classes:
ClusterConfigurationInitializer.FileInitializer,ClusterConfigurationInitializer.GossipInitializer,ClusterConfigurationInitializer.StaticInitializer,ClusterConfigurationInitializer.SyncInitializer
public interface ClusterConfigurationInitializer
Initializes configuration using different strategies.
When the local configuration is empty, the coordinator queries cluster members in the static
configuration for the current configuration. See When the local configuration is empty, a non-coordinating member waits until it receives a
valid configuration from the coordinator via gossip. See After initialization, the configuration can be modified using
Initialization Process
Each member is configured with a static configuration with initial set of cluster members and partition distribution.Both coordinator and other members first check the local persisted configuration to determine
the configuration. If one exists, that is used to initialize the configuration. See ClusterConfigurationInitializer.FileInitializer. On bootstrap of the cluster, the local persisted configuration is empty.
ClusterConfigurationInitializer.SyncInitializer. If any member
replies with a valid configuration, coordinator uses that one. If any member replies with an
uninitialized configuration, coordinator generates a new configuration from the provided
static configuration. See ClusterConfigurationInitializer.StaticInitializer.
ClusterConfigurationInitializer.GossipInitializer.
ClusterConfigurationModifier. For example, ExporterStateInitializer overwrites the
local member's state to keep it in sync with the statically configured exporters.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classInitialized configuration from the locally persisted configurationstatic classInitializes local configuration from the configuration received from other members via gossip.static interfacestatic classInitialized configuration from the given static partition distributionstatic classInitializes configuration by sending sync requests to other members. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault ClusterConfigurationInitializerandThen(ClusterConfigurationModifier modifier) Chain a modifier that updates the configuration after it is initialized.Initializes the cluster configuration.default ClusterConfigurationInitializerChain initializers in oder.default ClusterConfigurationInitializerrecover(Class<? extends ClusterConfigurationInitializer.InitializerError> exception, ClusterConfigurationInitializer recovery) If this initializer completed exceptionally with the given exception, the recovery initializer is used instead.
-
Field Details
-
LOG
static final org.slf4j.Logger LOG
-
-
Method Details
-
initialize
ActorFuture<ClusterConfiguration> initialize()Initializes the cluster configuration.- Returns:
- a future that completes with a configuration which can be initialized or uninitialized
-
orThen
Chain initializers in oder. If this initializer returns an uninitialized configuration, the provided initializer is tried instead. If this initializer completes exceptionally, the exceptions propagates. Seerecover(Class, ClusterConfigurationInitializer)to handle exceptions.- Parameters:
after- the next initializer used to initialize configuration if the current one did not succeed with an initialized configuration.- Returns:
- a chained ClusterConfigurationInitializer
-
andThen
Chain a modifier that updates the configuration after it is initialized.- Parameters:
modifier- a modifier that updates the configuration- Returns:
- the chained initializer
-
recover
default ClusterConfigurationInitializer recover(Class<? extends ClusterConfigurationInitializer.InitializerError> exception, ClusterConfigurationInitializer recovery) If this initializer completed exceptionally with the given exception, the recovery initializer is used instead. If this initializer completed exceptionally with a different exception, the recovery is not used and the exception is propagated.- Parameters:
exception- The class of the exceptions to recover from. If the exception is assignable from the given class, the recovery initializer is used.recovery- A regularClusterConfigurationInitializer.- Returns:
- a
ClusterConfigurationInitializerthat can be used for further chaining withorThen(ClusterConfigurationInitializer).
-