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.
|
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.
|
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()
PreJoinAwareService
PostJoinAwareService.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 PreJoinAwareService
null
.public void onClusterVersionChange(Version newVersion)
ClusterVersionListener
ClusterStateManager#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 ClusterVersionListener
newVersion
- the new versionpublic void init(NodeEngine nodeEngine, Properties properties)
ManagedService
init
in interface ManagedService
nodeEngine
- the NodeEngine that this service belongs toproperties
- the Properties (can be used to pass settings to the service)public void reset()
ManagedService
TODO: what is the purpose of reset
reset
in interface ManagedService
public void shutdown(boolean terminate)
ManagedService
TODO: what is the purpose of the terminate variable
shutdown
in interface ManagedService
terminate
- true
to shut down this servicepublic void broadcastConfig(IdentifiedDataSerializable config)
ConfigurationService
broadcastConfig
in interface ConfigurationService
config
- 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)
ConfigurationService
findMultiMapConfig
in interface ConfigurationService
name
- name of the confignull
when requested MultiMap configuration does not existpublic ConcurrentMap<String,MultiMapConfig> getMultiMapConfigs()
ConfigurationService
getMultiMapConfigs
in interface ConfigurationService
public MapConfig findMapConfig(String name)
ConfigurationService
findMapConfig
in interface ConfigurationService
name
- name of the confignull
when requested Map configuration does not existpublic Map<String,MapConfig> getMapConfigs()
ConfigurationService
getMapConfigs
in interface ConfigurationService
public TopicConfig findTopicConfig(String name)
ConfigurationService
findTopicConfig
in interface ConfigurationService
name
- name of the confignull
when requested Topic configuration does not existpublic ConcurrentMap<String,TopicConfig> getTopicConfigs()
ConfigurationService
getTopicConfigs
in interface ConfigurationService
public CardinalityEstimatorConfig findCardinalityEstimatorConfig(String name)
ConfigurationService
findCardinalityEstimatorConfig
in interface ConfigurationService
name
- name of the confignull
when requested Cardinality Estimator configuration does not existpublic ConcurrentMap<String,CardinalityEstimatorConfig> getCardinalityEstimatorConfigs()
ConfigurationService
getCardinalityEstimatorConfigs
in interface ConfigurationService
public PNCounterConfig findPNCounterConfig(String name)
ConfigurationService
findPNCounterConfig
in interface ConfigurationService
name
- name of the confignull
when requested PN counter configuration does not existpublic ConcurrentMap<String,PNCounterConfig> getPNCounterConfigs()
ConfigurationService
getPNCounterConfigs
in interface ConfigurationService
public ExecutorConfig findExecutorConfig(String name)
ConfigurationService
findExecutorConfig
in interface ConfigurationService
name
- name of the confignull
when requested Executor configuration does not existpublic ConcurrentMap<String,ExecutorConfig> getExecutorConfigs()
ConfigurationService
getExecutorConfigs
in interface ConfigurationService
public ScheduledExecutorConfig findScheduledExecutorConfig(String name)
ConfigurationService
findScheduledExecutorConfig
in interface ConfigurationService
name
- name of the confignull
when requested Scheduled Executor configuration does not existpublic ConcurrentMap<String,ScheduledExecutorConfig> getScheduledExecutorConfigs()
ConfigurationService
getScheduledExecutorConfigs
in interface ConfigurationService
public DurableExecutorConfig findDurableExecutorConfig(String name)
ConfigurationService
findDurableExecutorConfig
in interface ConfigurationService
name
- name of the confignull
when requested Durable Executor configuration does not existpublic ConcurrentMap<String,DurableExecutorConfig> getDurableExecutorConfigs()
ConfigurationService
getDurableExecutorConfigs
in interface ConfigurationService
public SemaphoreConfig findSemaphoreConfig(String name)
ConfigurationService
findSemaphoreConfig
in interface ConfigurationService
name
- name of the confignull
when requested Semaphore configuration does not existpublic ConcurrentMap<String,SemaphoreConfig> getSemaphoreConfigs()
ConfigurationService
getSemaphoreConfigs
in interface ConfigurationService
public RingbufferConfig findRingbufferConfig(String name)
ConfigurationService
findRingbufferConfig
in interface ConfigurationService
name
- name of the confignull
when requested Ringbuffer configuration does not existpublic ConcurrentMap<String,RingbufferConfig> getRingbufferConfigs()
ConfigurationService
getRingbufferConfigs
in interface ConfigurationService
public AtomicLongConfig findAtomicLongConfig(String name)
ConfigurationService
findAtomicLongConfig
in interface ConfigurationService
null
when requested AtomicLong configuration does not existpublic Map<String,AtomicLongConfig> getAtomicLongConfigs()
ConfigurationService
getAtomicLongConfigs
in interface ConfigurationService
public AtomicReferenceConfig findAtomicReferenceConfig(String name)
ConfigurationService
findAtomicReferenceConfig
in interface ConfigurationService
null
when requested AtomicReference configuration does not existpublic CountDownLatchConfig findCountDownLatchConfig(String name)
ConfigurationService
findCountDownLatchConfig
in interface ConfigurationService
null
when requested CountDownLatch configuration does not existpublic Map<String,AtomicReferenceConfig> getAtomicReferenceConfigs()
ConfigurationService
getAtomicReferenceConfigs
in interface ConfigurationService
public Map<String,CountDownLatchConfig> getCountDownLatchConfigs()
ConfigurationService
getCountDownLatchConfigs
in interface ConfigurationService
public LockConfig findLockConfig(String name)
ConfigurationService
findLockConfig
in interface ConfigurationService
name
- name of the confignull
when requested Lock configuration does not existpublic Map<String,LockConfig> getLockConfigs()
ConfigurationService
getLockConfigs
in interface ConfigurationService
public ListConfig findListConfig(String name)
ConfigurationService
findListConfig
in interface ConfigurationService
name
- name of the confignull
when requested List configuration does not existpublic ConcurrentMap<String,ListConfig> getListConfigs()
ConfigurationService
getListConfigs
in interface ConfigurationService
public QueueConfig findQueueConfig(String name)
ConfigurationService
findQueueConfig
in interface ConfigurationService
name
- name of the confignull
when requested Queue configuration does not existpublic Map<String,QueueConfig> getQueueConfigs()
ConfigurationService
getQueueConfigs
in interface ConfigurationService
public SetConfig findSetConfig(String name)
ConfigurationService
findSetConfig
in interface ConfigurationService
name
- name of the confignull
when requested Set configuration does not existpublic ConcurrentMap<String,SetConfig> getSetConfigs()
ConfigurationService
getSetConfigs
in interface ConfigurationService
public ReplicatedMapConfig findReplicatedMapConfig(String name)
ConfigurationService
findReplicatedMapConfig
in interface ConfigurationService
name
- name of the confignull
when requested ReplicatedMap configuration does not existpublic ConcurrentMap<String,ReplicatedMapConfig> getReplicatedMapConfigs()
ConfigurationService
getReplicatedMapConfigs
in interface ConfigurationService
public ReliableTopicConfig findReliableTopicConfig(String name)
ConfigurationService
findReliableTopicConfig
in interface ConfigurationService
name
- name of the confignull
when requested Reliable Topic configuration does not existpublic ConcurrentMap<String,ReliableTopicConfig> getReliableTopicConfigs()
ConfigurationService
getReliableTopicConfigs
in interface ConfigurationService
public CacheSimpleConfig findCacheSimpleConfig(String name)
ConfigurationService
findCacheSimpleConfig
in interface ConfigurationService
name
- name of the confignull
when requested Cache configuration does not existpublic Map<String,CacheSimpleConfig> getCacheSimpleConfigs()
ConfigurationService
getCacheSimpleConfigs
in interface ConfigurationService
public EventJournalConfig findCacheEventJournalConfig(String name)
ConfigurationService
findCacheEventJournalConfig
in interface ConfigurationService
name
- name of the confignull
when requested CacheEventJournal configuration does not existpublic Map<String,EventJournalConfig> getCacheEventJournalConfigs()
ConfigurationService
getCacheEventJournalConfigs
in interface ConfigurationService
public EventJournalConfig findMapEventJournalConfig(String name)
ConfigurationService
findMapEventJournalConfig
in interface ConfigurationService
name
- name of the confignull
when requested MapEventJournal configuration does not existpublic Map<String,EventJournalConfig> getMapEventJournalConfigs()
ConfigurationService
getMapEventJournalConfigs
in interface ConfigurationService
public FlakeIdGeneratorConfig findFlakeIdGeneratorConfig(String baseName)
ConfigurationService
findFlakeIdGeneratorConfig
in interface ConfigurationService
baseName
- name of the confignull
when requested FlakeIdGenerator configuration does not existpublic Map<String,FlakeIdGeneratorConfig> getFlakeIdGeneratorConfigs()
ConfigurationService
getFlakeIdGeneratorConfigs
in interface ConfigurationService
public Runnable prepareMergeRunnable()
SplitBrainHandlerService
Runnable
, that will merge the clusters.prepareMergeRunnable
in interface SplitBrainHandlerService
Runnable
that will merge the clustersCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.