public class ClusterWideConfigurationService extends Object implements MigrationAwareService, 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 |
beforeMigration(PartitionMigrationEvent event)
Called before migration process starts, on both source and destination members.
|
void |
broadcastConfig(IdentifiedDataSerializable config)
Register a dynamic configurations to all cluster members.
|
void |
commitMigration(PartitionMigrationEvent event)
Commits the migration process for this service, on both source and destination members.
|
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.
|
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.
|
Operation |
prepareReplicationOperation(PartitionReplicationEvent event)
Returns an operation to replicate service data and/or state for a specific partition replica
on another cluster member.
|
void |
registerConfigLocally(IdentifiedDataSerializable newConfig,
ConfigCheckMode configCheckMode)
Register a dynamic configuration in a local member.
|
void |
reset()
reset this ManagedService back to initial state.
|
void |
rollbackMigration(PartitionMigrationEvent event)
Rollback the migration process for this service, on both source and destination members.
|
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 prepareReplicationOperation(PartitionReplicationEvent event)
MigrationAwareServiceThis method will be called on source member whenever partitioning system requires to copy/replicate a partition replica. Returned operation will be executed on destination member. If operation fails by throwing exception, migration process will fail and will be rolled back.
Returning null is allowed and means service does not have anything to replicate.
prepareReplicationOperation in interface MigrationAwareServiceevent - replicationpublic void beforeMigration(PartitionMigrationEvent event)
MigrationAwareServiceService can take actions required before migration. Migration process will block until this method returns. If this method fails by throwing an exception, migration process for specific partition will fail and will be rolled back.
beforeMigration in interface MigrationAwareServiceevent - migration eventpublic void commitMigration(PartitionMigrationEvent event)
MigrationAwareServiceCommit is not expected to fail at this point, all exceptions will be suppressed and logged.
commitMigration in interface MigrationAwareServiceevent - migration eventpublic void rollbackMigration(PartitionMigrationEvent event)
MigrationAwareServiceRollback is not expected to fail at this point, all exceptions will be suppressed and logged.
rollbackMigration in interface MigrationAwareServiceevent - migration eventpublic 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 ManagedService belongs to.properties - the Properties. Can be used to pass settings to the service.public void reset()
ManagedServicereset in interface ManagedServicepublic void shutdown(boolean terminate)
ManagedServiceshutdown in interface ManagedServiceterminate - true to shut down the ManagedServicepublic void broadcastConfig(IdentifiedDataSerializable config)
ConfigurationServicebroadcastConfig in interface ConfigurationServiceconfig - Configuration to registerpublic 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 ConfigurationServicepublic ConcurrentMap<String,MultiMapConfig> getMultiMapConfigs()
ConfigurationServicegetMultiMapConfigs in interface ConfigurationServicepublic MapConfig findMapConfig(String name)
ConfigurationServicefindMapConfig in interface ConfigurationServicepublic Map<String,MapConfig> getMapConfigs()
ConfigurationServicegetMapConfigs in interface ConfigurationServicepublic TopicConfig findTopicConfig(String name)
ConfigurationServicefindTopicConfig in interface ConfigurationServicepublic ConcurrentMap<String,TopicConfig> getTopicConfigs()
ConfigurationServicegetTopicConfigs in interface ConfigurationServicepublic CardinalityEstimatorConfig findCardinalityEstimatorConfig(String name)
ConfigurationServicefindCardinalityEstimatorConfig in interface ConfigurationServicepublic ConcurrentMap<String,CardinalityEstimatorConfig> getCardinalityEstimatorConfigs()
ConfigurationServicegetCardinalityEstimatorConfigs in interface ConfigurationServicepublic ExecutorConfig findExecutorConfig(String name)
ConfigurationServicefindExecutorConfig in interface ConfigurationServicepublic ConcurrentMap<String,ExecutorConfig> getExecutorConfigs()
ConfigurationServicegetExecutorConfigs in interface ConfigurationServicepublic ScheduledExecutorConfig findScheduledExecutorConfig(String name)
ConfigurationServicefindScheduledExecutorConfig in interface ConfigurationServicepublic ConcurrentMap<String,ScheduledExecutorConfig> getScheduledExecutorConfigs()
ConfigurationServicegetScheduledExecutorConfigs in interface ConfigurationServicepublic DurableExecutorConfig findDurableExecutorConfig(String name)
ConfigurationServicefindDurableExecutorConfig in interface ConfigurationServicepublic ConcurrentMap<String,DurableExecutorConfig> getDurableExecutorConfigs()
ConfigurationServicegetDurableExecutorConfigs in interface ConfigurationServicepublic SemaphoreConfig findSemaphoreConfig(String name)
ConfigurationServicefindSemaphoreConfig in interface ConfigurationServicepublic ConcurrentMap<String,SemaphoreConfig> getSemaphoreConfigs()
ConfigurationServicegetSemaphoreConfigs in interface ConfigurationServicepublic RingbufferConfig findRingbufferConfig(String name)
ConfigurationServicefindRingbufferConfig in interface ConfigurationServicepublic ConcurrentMap<String,RingbufferConfig> getRingbufferConfigs()
ConfigurationServicegetRingbufferConfigs in interface ConfigurationServicepublic LockConfig findLockConfig(String name)
ConfigurationServicefindLockConfig in interface ConfigurationServicepublic Map<String,LockConfig> getLockConfigs()
ConfigurationServicegetLockConfigs in interface ConfigurationServicepublic ListConfig findListConfig(String name)
ConfigurationServicefindListConfig in interface ConfigurationServicepublic ConcurrentMap<String,ListConfig> getListConfigs()
ConfigurationServicegetListConfigs in interface ConfigurationServicepublic QueueConfig findQueueConfig(String name)
ConfigurationServicefindQueueConfig in interface ConfigurationServicepublic Map<String,QueueConfig> getQueueConfigs()
ConfigurationServicegetQueueConfigs in interface ConfigurationServicepublic SetConfig findSetConfig(String name)
ConfigurationServicefindSetConfig in interface ConfigurationServicepublic ConcurrentMap<String,SetConfig> getSetConfigs()
ConfigurationServicegetSetConfigs in interface ConfigurationServicepublic ReplicatedMapConfig findReplicatedMapConfig(String name)
ConfigurationServicefindReplicatedMapConfig in interface ConfigurationServicepublic ConcurrentMap<String,ReplicatedMapConfig> getReplicatedMapConfigs()
ConfigurationServicegetReplicatedMapConfigs in interface ConfigurationServicepublic ReliableTopicConfig findReliableTopicConfig(String name)
ConfigurationServicefindReliableTopicConfig in interface ConfigurationServicepublic ConcurrentMap<String,ReliableTopicConfig> getReliableTopicConfigs()
ConfigurationServicegetReliableTopicConfigs in interface ConfigurationServicepublic CacheSimpleConfig findCacheSimpleConfig(String name)
ConfigurationServicefindCacheSimpleConfig in interface ConfigurationServicepublic Map<String,CacheSimpleConfig> getCacheSimpleConfigs()
ConfigurationServicegetCacheSimpleConfigs in interface ConfigurationServicepublic EventJournalConfig findCacheEventJournalConfig(String name)
findCacheEventJournalConfig in interface ConfigurationServicepublic Map<String,EventJournalConfig> getCacheEventJournalConfigs()
getCacheEventJournalConfigs in interface ConfigurationServicepublic EventJournalConfig findMapEventJournalConfig(String name)
findMapEventJournalConfig in interface ConfigurationServicepublic Map<String,EventJournalConfig> getMapEventJournalConfigs()
getMapEventJournalConfigs in interface ConfigurationServicepublic Runnable prepareMergeRunnable()
SplitBrainHandlerServiceprepareMergeRunnable in interface SplitBrainHandlerServiceCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.