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)
Register a dynamic configurations to all cluster members.
|
ICompletableFuture<Object> |
broadcastConfigAsync(IdentifiedDataSerializable config) |
EventJournalConfig |
findCacheEventJournalConfig(String name) |
CacheSimpleConfig |
findCacheSimpleConfig(String name)
Find existing Cache Config
|
CardinalityEstimatorConfig |
findCardinalityEstimatorConfig(String name)
Find existing Cardinality Estimator Config
|
DurableExecutorConfig |
findDurableExecutorConfig(String name)
Find existing Durable Executor Config
|
ExecutorConfig |
findExecutorConfig(String name)
Find existing Executor Config
|
ListConfig |
findListConfig(String name)
Find existing List Config
|
LockConfig |
findLockConfig(String name)
Find existing Lock Config
|
MapConfig |
findMapConfig(String name)
Find existing Map Config
|
EventJournalConfig |
findMapEventJournalConfig(String name) |
MultiMapConfig |
findMultiMapConfig(String name)
Find existing Multimap Config
|
QueueConfig |
findQueueConfig(String name)
Find existing Queue Config
|
ReliableTopicConfig |
findReliableTopicConfig(String name)
Find existing Reliable Topic Config
|
ReplicatedMapConfig |
findReplicatedMapConfig(String name)
Find existing Replicated Map Config
|
RingbufferConfig |
findRingbufferConfig(String name)
Find existing Ringbuffer Config
|
ScheduledExecutorConfig |
findScheduledExecutorConfig(String name)
Find existing Scheduled Executor Config
|
SemaphoreConfig |
findSemaphoreConfig(String name)
Find existing Semaphore Config
|
SetConfig |
findSetConfig(String name)
Find existing Set Config
|
TopicConfig |
findTopicConfig(String name)
Find existing Topic Config
|
Map<String,EventJournalConfig> |
getCacheEventJournalConfigs() |
Map<String,CacheSimpleConfig> |
getCacheSimpleConfigs()
Return all registered cache configurations.
|
ConcurrentMap<String,CardinalityEstimatorConfig> |
getCardinalityEstimatorConfigs()
Return all registered cardinality estimator configurations.
|
ConcurrentMap<String,DurableExecutorConfig> |
getDurableExecutorConfigs()
Return all registered durable executor configurations.
|
ConcurrentMap<String,ExecutorConfig> |
getExecutorConfigs()
Return all registered executor configurations.
|
ConcurrentMap<String,ListConfig> |
getListConfigs()
Return all registered list configurations.
|
Map<String,LockConfig> |
getLockConfigs()
Return all registered lock configurations.
|
Map<String,MapConfig> |
getMapConfigs()
Return all registered map configurations.
|
Map<String,EventJournalConfig> |
getMapEventJournalConfigs() |
ConcurrentMap<String,MultiMapConfig> |
getMultiMapConfigs()
Return all registered multimap configurations.
|
Operation |
getPreJoinOperation()
An operation to be executed on the joining member before it is set as joined.
|
Map<String,QueueConfig> |
getQueueConfigs()
Return all registered queue configurations.
|
ConcurrentMap<String,ReliableTopicConfig> |
getReliableTopicConfigs()
Return all registered reliable topic configurations.
|
ConcurrentMap<String,ReplicatedMapConfig> |
getReplicatedMapConfigs()
Return all registered replicated map configurations.
|
ConcurrentMap<String,RingbufferConfig> |
getRingbufferConfigs()
Return all registered ringbuffer configurations.
|
ConcurrentMap<String,ScheduledExecutorConfig> |
getScheduledExecutorConfigs()
Return all registered scheduled executor configurations.
|
ConcurrentMap<String,SemaphoreConfig> |
getSemaphoreConfigs()
Return all registered semaphore configurations.
|
ConcurrentMap<String,SetConfig> |
getSetConfigs()
Return all registered set configurations.
|
ConcurrentMap<String,TopicConfig> |
getTopicConfigs()
Return all registered topic configurations.
|
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this ManagedService
|
void |
onClusterVersionChange(Version newVersion)
Invoked on registered listeners after the new cluster version has been applied.
|
Runnable |
prepareMergeRunnable()
When the 2 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()
reset this ManagedService back to initial state.
|
void |
shutdown(boolean terminate)
Shuts down this ManagedService.
|
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 ManagedService belongs to.properties
- the Properties. Can be used to pass settings to the service.public void reset()
ManagedService
reset
in interface ManagedService
public void shutdown(boolean terminate)
ManagedService
shutdown
in interface ManagedService
terminate
- true to shut down the ManagedServicepublic 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
public ConcurrentMap<String,MultiMapConfig> getMultiMapConfigs()
ConfigurationService
getMultiMapConfigs
in interface ConfigurationService
public MapConfig findMapConfig(String name)
ConfigurationService
findMapConfig
in interface ConfigurationService
public Map<String,MapConfig> getMapConfigs()
ConfigurationService
getMapConfigs
in interface ConfigurationService
public TopicConfig findTopicConfig(String name)
ConfigurationService
findTopicConfig
in interface ConfigurationService
public ConcurrentMap<String,TopicConfig> getTopicConfigs()
ConfigurationService
getTopicConfigs
in interface ConfigurationService
public CardinalityEstimatorConfig findCardinalityEstimatorConfig(String name)
ConfigurationService
findCardinalityEstimatorConfig
in interface ConfigurationService
public ConcurrentMap<String,CardinalityEstimatorConfig> getCardinalityEstimatorConfigs()
ConfigurationService
getCardinalityEstimatorConfigs
in interface ConfigurationService
public ExecutorConfig findExecutorConfig(String name)
ConfigurationService
findExecutorConfig
in interface ConfigurationService
public ConcurrentMap<String,ExecutorConfig> getExecutorConfigs()
ConfigurationService
getExecutorConfigs
in interface ConfigurationService
public ScheduledExecutorConfig findScheduledExecutorConfig(String name)
ConfigurationService
findScheduledExecutorConfig
in interface ConfigurationService
public ConcurrentMap<String,ScheduledExecutorConfig> getScheduledExecutorConfigs()
ConfigurationService
getScheduledExecutorConfigs
in interface ConfigurationService
public DurableExecutorConfig findDurableExecutorConfig(String name)
ConfigurationService
findDurableExecutorConfig
in interface ConfigurationService
public ConcurrentMap<String,DurableExecutorConfig> getDurableExecutorConfigs()
ConfigurationService
getDurableExecutorConfigs
in interface ConfigurationService
public SemaphoreConfig findSemaphoreConfig(String name)
ConfigurationService
findSemaphoreConfig
in interface ConfigurationService
public ConcurrentMap<String,SemaphoreConfig> getSemaphoreConfigs()
ConfigurationService
getSemaphoreConfigs
in interface ConfigurationService
public RingbufferConfig findRingbufferConfig(String name)
ConfigurationService
findRingbufferConfig
in interface ConfigurationService
public ConcurrentMap<String,RingbufferConfig> getRingbufferConfigs()
ConfigurationService
getRingbufferConfigs
in interface ConfigurationService
public LockConfig findLockConfig(String name)
ConfigurationService
findLockConfig
in interface ConfigurationService
public Map<String,LockConfig> getLockConfigs()
ConfigurationService
getLockConfigs
in interface ConfigurationService
public ListConfig findListConfig(String name)
ConfigurationService
findListConfig
in interface ConfigurationService
public ConcurrentMap<String,ListConfig> getListConfigs()
ConfigurationService
getListConfigs
in interface ConfigurationService
public QueueConfig findQueueConfig(String name)
ConfigurationService
findQueueConfig
in interface ConfigurationService
public Map<String,QueueConfig> getQueueConfigs()
ConfigurationService
getQueueConfigs
in interface ConfigurationService
public SetConfig findSetConfig(String name)
ConfigurationService
findSetConfig
in interface ConfigurationService
public ConcurrentMap<String,SetConfig> getSetConfigs()
ConfigurationService
getSetConfigs
in interface ConfigurationService
public ReplicatedMapConfig findReplicatedMapConfig(String name)
ConfigurationService
findReplicatedMapConfig
in interface ConfigurationService
public ConcurrentMap<String,ReplicatedMapConfig> getReplicatedMapConfigs()
ConfigurationService
getReplicatedMapConfigs
in interface ConfigurationService
public ReliableTopicConfig findReliableTopicConfig(String name)
ConfigurationService
findReliableTopicConfig
in interface ConfigurationService
public ConcurrentMap<String,ReliableTopicConfig> getReliableTopicConfigs()
ConfigurationService
getReliableTopicConfigs
in interface ConfigurationService
public CacheSimpleConfig findCacheSimpleConfig(String name)
ConfigurationService
findCacheSimpleConfig
in interface ConfigurationService
public Map<String,CacheSimpleConfig> getCacheSimpleConfigs()
ConfigurationService
getCacheSimpleConfigs
in interface ConfigurationService
public EventJournalConfig findCacheEventJournalConfig(String name)
findCacheEventJournalConfig
in interface ConfigurationService
public Map<String,EventJournalConfig> getCacheEventJournalConfigs()
getCacheEventJournalConfigs
in interface ConfigurationService
public EventJournalConfig findMapEventJournalConfig(String name)
findMapEventJournalConfig
in interface ConfigurationService
public Map<String,EventJournalConfig> getMapEventJournalConfigs()
getMapEventJournalConfigs
in interface ConfigurationService
public Runnable prepareMergeRunnable()
SplitBrainHandlerService
prepareMergeRunnable
in interface SplitBrainHandlerService
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.