public class ClusterWideConfigurationService extends Object implements PreJoinAwareService, CoreService, ClusterVersionListener, ManagedService, ConfigurationService, SplitBrainHandlerService
| Modifier and Type | Class and Description |
|---|---|
static class |
ClusterWideConfigurationService.Merger |
| Modifier and Type | Field and Description |
|---|---|
static int |
CONFIG_PUBLISH_MAX_ATTEMPT_COUNT |
static String |
SERVICE_NAME |
| Constructor and Description |
|---|
ClusterWideConfigurationService(NodeEngine nodeEngine,
DynamicConfigListener dynamicConfigListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcastConfig(IdentifiedDataSerializable config)
Registers a dynamic configurations to all cluster members.
|
ICompletableFuture<Object> |
broadcastConfigAsync(IdentifiedDataSerializable config) |
AtomicLongConfig |
findAtomicLongConfig(String name)
Finds existing AtomicLong config.
|
AtomicReferenceConfig |
findAtomicReferenceConfig(String name)
Finds existing AtomicReference config.
|
EventJournalConfig |
findCacheEventJournalConfig(String name)
Finds existing CacheEventJournal config.
|
CacheSimpleConfig |
findCacheSimpleConfig(String name)
Finds existing Cache config.
|
CardinalityEstimatorConfig |
findCardinalityEstimatorConfig(String name)
Finds existing Cardinality Estimator config.
|
CountDownLatchConfig |
findCountDownLatchConfig(String name)
Finds existing CountDownLatch config.
|
DurableExecutorConfig |
findDurableExecutorConfig(String name)
Finds existing Durable Executor config.
|
ExecutorConfig |
findExecutorConfig(String name)
Finds existing Executor config.
|
FlakeIdGeneratorConfig |
findFlakeIdGeneratorConfig(String baseName)
Finds existing FlakeIdGeneratorConfig config.
|
ListConfig |
findListConfig(String name)
Finds existing List config.
|
LockConfig |
findLockConfig(String name)
Finds existing Lock config.
|
MapConfig |
findMapConfig(String name)
Finds existing Map config.
|
EventJournalConfig |
findMapEventJournalConfig(String name)
Finds existing MapEventJournal config.
|
MerkleTreeConfig |
findMapMerkleTreeConfig(String name)
Finds an existing map
MerkleTreeConfig. |
MultiMapConfig |
findMultiMapConfig(String name)
Finds existing Multimap config.
|
PNCounterConfig |
findPNCounterConfig(String name)
Finds existing PN counter config.
|
QueueConfig |
findQueueConfig(String name)
Finds existing Queue config.
|
ReliableTopicConfig |
findReliableTopicConfig(String name)
Finds existing Reliable Topic config.
|
ReplicatedMapConfig |
findReplicatedMapConfig(String name)
Finds existing ReplicatedMap config.
|
RingbufferConfig |
findRingbufferConfig(String name)
Finds existing Ringbuffer config.
|
ScheduledExecutorConfig |
findScheduledExecutorConfig(String name)
Finds existing Scheduled Executor config.
|
SemaphoreConfig |
findSemaphoreConfig(String name)
Finds existing Semaphore config.
|
SetConfig |
findSetConfig(String name)
Finds existing Set config.
|
TopicConfig |
findTopicConfig(String name)
Finds existing Topic config.
|
Map<String,AtomicLongConfig> |
getAtomicLongConfigs()
Returns all registered AtomicLong configurations.
|
Map<String,AtomicReferenceConfig> |
getAtomicReferenceConfigs()
Returns all registered AtomicReference configurations.
|
Map<String,EventJournalConfig> |
getCacheEventJournalConfigs()
Returns all registered CacheEventJournal configurations.
|
Map<String,CacheSimpleConfig> |
getCacheSimpleConfigs()
Returns all registered cache configurations.
|
ConcurrentMap<String,CardinalityEstimatorConfig> |
getCardinalityEstimatorConfigs()
Returns all registered cardinality estimator configurations.
|
Map<String,CountDownLatchConfig> |
getCountDownLatchConfigs()
Returns all registered CountDownLatchConfig configurations.
|
ConcurrentMap<String,DurableExecutorConfig> |
getDurableExecutorConfigs()
Returns all registered durable executor configurations.
|
ConcurrentMap<String,ExecutorConfig> |
getExecutorConfigs()
Returns all registered executor configurations.
|
Map<String,FlakeIdGeneratorConfig> |
getFlakeIdGeneratorConfigs()
Returns all registered FlakeIdGenerator configurations.
|
ConcurrentMap<String,ListConfig> |
getListConfigs()
Returns all registered list configurations.
|
Map<String,LockConfig> |
getLockConfigs()
Returns all registered lock configurations.
|
Map<String,MapConfig> |
getMapConfigs()
Returns all registered map configurations.
|
Map<String,EventJournalConfig> |
getMapEventJournalConfigs()
Returns all registered MapEventJournal configurations.
|
Map<String,MerkleTreeConfig> |
getMapMerkleTreeConfigs()
Returns a map of all registered IMap
MerkleTreeConfigs. |
ConcurrentMap<String,MultiMapConfig> |
getMultiMapConfigs()
Returns all registered multimap configurations.
|
ConcurrentMap<String,PNCounterConfig> |
getPNCounterConfigs()
Returns all registered PN counter configurations.
|
Operation |
getPreJoinOperation()
An operation to be executed on the joining member before it is set as joined.
|
Map<String,QueueConfig> |
getQueueConfigs()
Returns all registered queue configurations.
|
ConcurrentMap<String,ReliableTopicConfig> |
getReliableTopicConfigs()
Returns all registered reliable topic configurations.
|
ConcurrentMap<String,ReplicatedMapConfig> |
getReplicatedMapConfigs()
Returns all registered replicated map configurations.
|
ConcurrentMap<String,RingbufferConfig> |
getRingbufferConfigs()
Returns all registered ringbuffer configurations.
|
ConcurrentMap<String,ScheduledExecutorConfig> |
getScheduledExecutorConfigs()
Returns all registered scheduled executor configurations.
|
ConcurrentMap<String,SemaphoreConfig> |
getSemaphoreConfigs()
Returns all registered semaphore configurations.
|
ConcurrentMap<String,SetConfig> |
getSetConfigs()
Returns all registered set configurations.
|
ConcurrentMap<String,TopicConfig> |
getTopicConfigs()
Returns all registered topic configurations.
|
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this service.
|
void |
onClusterVersionChange(Version newVersion)
Invoked on registered listeners after the new cluster version has been applied.
|
Runnable |
prepareMergeRunnable()
When the two separate clusters merge (resolve a split-brain), this method is called to return
a
Runnable, that will merge the clusters. |
void |
registerConfigLocally(IdentifiedDataSerializable newConfig,
ConfigCheckMode configCheckMode)
Register a dynamic configuration in a local member.
|
void |
reset()
Resets this service back to its initial state.
|
void |
shutdown(boolean terminate)
Shuts down this service.
|
public static final String SERVICE_NAME
public static final int CONFIG_PUBLISH_MAX_ATTEMPT_COUNT
public ClusterWideConfigurationService(NodeEngine nodeEngine, DynamicConfigListener dynamicConfigListener)
public Operation getPreJoinOperation()
PreJoinAwareServicePostJoinAwareService.getPostJoinOperation()s, no partition locks, no key-based locks, no service level
locks, no database interaction are allowed. Additionally, a pre-join operation is executed while the cluster
lock is being held on the joining member, so it is important that the operation finishes quickly and does not
interact with other locks.
The Operation.getPartitionId() method should return a negative value.
This means that the operations should not implement PartitionAwareOperation.
Pre join operations should return response, which may also be a null response.
getPreJoinOperation in interface PreJoinAwareServicenull.public void onClusterVersionChange(Version newVersion)
ClusterVersionListenerClusterStateManager#version has been updated and while the cluster service lock
ClusterServiceImpl#lock is still locked, as part of the commit phase of the transaction changing
the cluster version. Unhandled exceptions from listeners implementation will break the new version commit and a slow
implementation will stall the system and may cause a transaction timeout.
If new cluster version is null and property
GroupProperty.INIT_CLUSTER_VERSION is set, the version set by this property
will be provided as argument to the listener. If neither are set, running node's codebase version will be used.onClusterVersionChange in interface ClusterVersionListenernewVersion - the new versionpublic void init(NodeEngine nodeEngine, Properties properties)
ManagedServiceinit in interface ManagedServicenodeEngine - the NodeEngine that this service belongs toproperties - the Properties (can be used to pass settings to the service)public void reset()
ManagedServiceTODO: what is the purpose of reset
reset in interface ManagedServicepublic void shutdown(boolean terminate)
ManagedServiceTODO: what is the purpose of the terminate variable
shutdown in interface ManagedServiceterminate - true to shut down this servicepublic void broadcastConfig(IdentifiedDataSerializable config)
ConfigurationServicebroadcastConfig in interface ConfigurationServiceconfig - configuration to registerpublic ICompletableFuture<Object> broadcastConfigAsync(IdentifiedDataSerializable config)
public void registerConfigLocally(IdentifiedDataSerializable newConfig, ConfigCheckMode configCheckMode)
newConfig - Configuration to register.configCheckMode - behaviour when a config is detectedUnsupportedOperationException - when given configuration type is not supportedConfigurationException - when conflict is detected and configCheckMode is on THROW_EXCEPTIONpublic MultiMapConfig findMultiMapConfig(String name)
ConfigurationServicefindMultiMapConfig in interface ConfigurationServicename - name of the confignull when requested MultiMap configuration does not existpublic ConcurrentMap<String,MultiMapConfig> getMultiMapConfigs()
ConfigurationServicegetMultiMapConfigs in interface ConfigurationServicepublic MapConfig findMapConfig(String name)
ConfigurationServicefindMapConfig in interface ConfigurationServicename - name of the confignull when requested Map configuration does not existpublic Map<String,MapConfig> getMapConfigs()
ConfigurationServicegetMapConfigs in interface ConfigurationServicepublic TopicConfig findTopicConfig(String name)
ConfigurationServicefindTopicConfig in interface ConfigurationServicename - name of the confignull when requested Topic configuration does not existpublic ConcurrentMap<String,TopicConfig> getTopicConfigs()
ConfigurationServicegetTopicConfigs in interface ConfigurationServicepublic CardinalityEstimatorConfig findCardinalityEstimatorConfig(String name)
ConfigurationServicefindCardinalityEstimatorConfig in interface ConfigurationServicename - name of the confignull when requested Cardinality Estimator configuration does not existpublic ConcurrentMap<String,CardinalityEstimatorConfig> getCardinalityEstimatorConfigs()
ConfigurationServicegetCardinalityEstimatorConfigs in interface ConfigurationServicepublic PNCounterConfig findPNCounterConfig(String name)
ConfigurationServicefindPNCounterConfig in interface ConfigurationServicename - name of the confignull when requested PN counter configuration does not existpublic ConcurrentMap<String,PNCounterConfig> getPNCounterConfigs()
ConfigurationServicegetPNCounterConfigs in interface ConfigurationServicepublic ExecutorConfig findExecutorConfig(String name)
ConfigurationServicefindExecutorConfig in interface ConfigurationServicename - name of the confignull when requested Executor configuration does not existpublic ConcurrentMap<String,ExecutorConfig> getExecutorConfigs()
ConfigurationServicegetExecutorConfigs in interface ConfigurationServicepublic ScheduledExecutorConfig findScheduledExecutorConfig(String name)
ConfigurationServicefindScheduledExecutorConfig in interface ConfigurationServicename - name of the confignull when requested Scheduled Executor configuration does not existpublic ConcurrentMap<String,ScheduledExecutorConfig> getScheduledExecutorConfigs()
ConfigurationServicegetScheduledExecutorConfigs in interface ConfigurationServicepublic DurableExecutorConfig findDurableExecutorConfig(String name)
ConfigurationServicefindDurableExecutorConfig in interface ConfigurationServicename - name of the confignull when requested Durable Executor configuration does not existpublic ConcurrentMap<String,DurableExecutorConfig> getDurableExecutorConfigs()
ConfigurationServicegetDurableExecutorConfigs in interface ConfigurationServicepublic SemaphoreConfig findSemaphoreConfig(String name)
ConfigurationServicefindSemaphoreConfig in interface ConfigurationServicename - name of the confignull when requested Semaphore configuration does not existpublic ConcurrentMap<String,SemaphoreConfig> getSemaphoreConfigs()
ConfigurationServicegetSemaphoreConfigs in interface ConfigurationServicepublic RingbufferConfig findRingbufferConfig(String name)
ConfigurationServicefindRingbufferConfig in interface ConfigurationServicename - name of the confignull when requested Ringbuffer configuration does not existpublic ConcurrentMap<String,RingbufferConfig> getRingbufferConfigs()
ConfigurationServicegetRingbufferConfigs in interface ConfigurationServicepublic AtomicLongConfig findAtomicLongConfig(String name)
ConfigurationServicefindAtomicLongConfig in interface ConfigurationServicenull when requested AtomicLong configuration does not existpublic Map<String,AtomicLongConfig> getAtomicLongConfigs()
ConfigurationServicegetAtomicLongConfigs in interface ConfigurationServicepublic AtomicReferenceConfig findAtomicReferenceConfig(String name)
ConfigurationServicefindAtomicReferenceConfig in interface ConfigurationServicenull when requested AtomicReference configuration does not existpublic CountDownLatchConfig findCountDownLatchConfig(String name)
ConfigurationServicefindCountDownLatchConfig in interface ConfigurationServicenull when requested CountDownLatch configuration does not existpublic Map<String,AtomicReferenceConfig> getAtomicReferenceConfigs()
ConfigurationServicegetAtomicReferenceConfigs in interface ConfigurationServicepublic Map<String,CountDownLatchConfig> getCountDownLatchConfigs()
ConfigurationServicegetCountDownLatchConfigs in interface ConfigurationServicepublic LockConfig findLockConfig(String name)
ConfigurationServicefindLockConfig in interface ConfigurationServicename - name of the confignull when requested Lock configuration does not existpublic Map<String,LockConfig> getLockConfigs()
ConfigurationServicegetLockConfigs in interface ConfigurationServicepublic ListConfig findListConfig(String name)
ConfigurationServicefindListConfig in interface ConfigurationServicename - name of the confignull when requested List configuration does not existpublic ConcurrentMap<String,ListConfig> getListConfigs()
ConfigurationServicegetListConfigs in interface ConfigurationServicepublic QueueConfig findQueueConfig(String name)
ConfigurationServicefindQueueConfig in interface ConfigurationServicename - name of the confignull when requested Queue configuration does not existpublic Map<String,QueueConfig> getQueueConfigs()
ConfigurationServicegetQueueConfigs in interface ConfigurationServicepublic SetConfig findSetConfig(String name)
ConfigurationServicefindSetConfig in interface ConfigurationServicename - name of the confignull when requested Set configuration does not existpublic ConcurrentMap<String,SetConfig> getSetConfigs()
ConfigurationServicegetSetConfigs in interface ConfigurationServicepublic ReplicatedMapConfig findReplicatedMapConfig(String name)
ConfigurationServicefindReplicatedMapConfig in interface ConfigurationServicename - name of the confignull when requested ReplicatedMap configuration does not existpublic ConcurrentMap<String,ReplicatedMapConfig> getReplicatedMapConfigs()
ConfigurationServicegetReplicatedMapConfigs in interface ConfigurationServicepublic ReliableTopicConfig findReliableTopicConfig(String name)
ConfigurationServicefindReliableTopicConfig in interface ConfigurationServicename - name of the confignull when requested Reliable Topic configuration does not existpublic ConcurrentMap<String,ReliableTopicConfig> getReliableTopicConfigs()
ConfigurationServicegetReliableTopicConfigs in interface ConfigurationServicepublic CacheSimpleConfig findCacheSimpleConfig(String name)
ConfigurationServicefindCacheSimpleConfig in interface ConfigurationServicename - name of the confignull when requested Cache configuration does not existpublic Map<String,CacheSimpleConfig> getCacheSimpleConfigs()
ConfigurationServicegetCacheSimpleConfigs in interface ConfigurationServicepublic EventJournalConfig findCacheEventJournalConfig(String name)
ConfigurationServicefindCacheEventJournalConfig in interface ConfigurationServicename - name of the confignull when requested CacheEventJournal configuration does not existpublic Map<String,EventJournalConfig> getCacheEventJournalConfigs()
ConfigurationServicegetCacheEventJournalConfigs in interface ConfigurationServicepublic EventJournalConfig findMapEventJournalConfig(String name)
ConfigurationServicefindMapEventJournalConfig in interface ConfigurationServicename - name of the confignull when requested MapEventJournal configuration does not existpublic Map<String,EventJournalConfig> getMapEventJournalConfigs()
ConfigurationServicegetMapEventJournalConfigs in interface ConfigurationServicepublic MerkleTreeConfig findMapMerkleTreeConfig(String name)
ConfigurationServiceMerkleTreeConfig.findMapMerkleTreeConfig in interface ConfigurationServicename - name of the configMerkleTreeConfig or null when the requested
configuration does not existpublic Map<String,MerkleTreeConfig> getMapMerkleTreeConfigs()
ConfigurationServiceMerkleTreeConfigs.getMapMerkleTreeConfigs in interface ConfigurationServiceMerkleTreeConfigspublic FlakeIdGeneratorConfig findFlakeIdGeneratorConfig(String baseName)
ConfigurationServicefindFlakeIdGeneratorConfig in interface ConfigurationServicebaseName - name of the confignull when requested FlakeIdGenerator configuration does not existpublic Map<String,FlakeIdGeneratorConfig> getFlakeIdGeneratorConfigs()
ConfigurationServicegetFlakeIdGeneratorConfigs in interface ConfigurationServicepublic Runnable prepareMergeRunnable()
SplitBrainHandlerServiceRunnable, that will merge the clusters.prepareMergeRunnable in interface SplitBrainHandlerServiceRunnable that will merge the clustersCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.