public class EnterpriseWanReplicationService extends Object implements com.hazelcast.wan.WanReplicationService, com.hazelcast.spi.FragmentedMigrationAwareService, com.hazelcast.spi.PostJoinAwareService, com.hazelcast.spi.LiveOperationsTracker, com.hazelcast.spi.ManagedService
| Constructor and Description |
|---|
EnterpriseWanReplicationService(com.hazelcast.instance.Node node) |
| Modifier and Type | Method and Description |
|---|---|
com.hazelcast.wan.AddWanConfigResult |
addWanReplicationConfig(com.hazelcast.config.WanReplicationConfig wanConfig) |
void |
addWanReplicationConfigLocally(com.hazelcast.config.WanReplicationConfig wanConfig) |
void |
appendWanReplicationConfig(com.hazelcast.config.WanReplicationConfig newConfig)
Appends the provided
WanReplicationConfig to the configuration of
this member. |
void |
beforeMigration(com.hazelcast.spi.PartitionMigrationEvent event) |
void |
checkWanReplicationQueues(String name) |
void |
clearQueues(String wanReplicationName,
String wanPublisherId) |
void |
commitMigration(com.hazelcast.spi.PartitionMigrationEvent event) |
void |
consistencyCheck(String wanReplicationName,
String wanPublisherId,
String mapName) |
Collection<com.hazelcast.spi.ServiceNamespace> |
getAllServiceNamespaces(com.hazelcast.spi.PartitionReplicationEvent event) |
WanReplicationEndpoint |
getEndpointOrFail(String wanReplicationName,
String wanPublisherId)
Returns a WAN replication configured under a WAN replication config with
the name
wanReplicationName and with a WAN publisher ID of
wanPublisherId or throws a InvalidConfigurationException
if there is no configuration for the given parameters. |
WanReplicationEndpoint |
getEndpointOrNull(String wanReplicationName,
String wanPublisherId)
Returns a WAN replication configured under a WAN replication config with
the name
wanReplicationName and with a WAN publisher ID of
wanPublisherId or null if there is no configuration for
the given parameters. |
com.hazelcast.spi.Operation |
getPostJoinOperation() |
static String |
getPublisherIdOrGroupName(com.hazelcast.config.WanPublisherConfig publisherConfig)
Returns the publisher ID for the given WAN publisher configuration which
is then used for identifying the WAN publisher in a WAN replication
scheme.
|
com.hazelcast.wan.impl.DistributedServiceWanEventCounters |
getReceivedEventCounters(String serviceName) |
com.hazelcast.wan.impl.DistributedServiceWanEventCounters |
getSentEventCounters(String wanReplicationName,
String wanPublisherId,
String serviceName) |
Map<String,com.hazelcast.monitor.LocalWanStats> |
getStats()
Returns map from WAN replication config name to
LocalWanStats. |
WanSyncManager |
getSyncManager()
Returns the manager for WAN sync events.
|
com.hazelcast.wan.WanReplicationPublisher |
getWanReplicationPublisher(String name) |
com.hazelcast.monitor.WanSyncState |
getWanSyncState() |
void |
handleEvent(com.hazelcast.nio.serialization.Data data,
WanOperation wanOperation)
Processes the replication event sent from the source cluster.
|
void |
handleEvent(com.hazelcast.wan.WanReplicationEvent event) |
void |
init(com.hazelcast.spi.NodeEngine nodeEngine,
Properties properties) |
void |
initializeCustomConsumers()
Constructs and initializes all WAN consumers defined in the WAN
configuration
|
boolean |
isKnownServiceNamespace(com.hazelcast.spi.ServiceNamespace namespace) |
void |
pause(String wanReplicationName,
String wanPublisherId) |
void |
populate(com.hazelcast.spi.LiveOperations liveOperations) |
com.hazelcast.spi.Operation |
prepareReplicationOperation(com.hazelcast.spi.PartitionReplicationEvent event) |
com.hazelcast.spi.Operation |
prepareReplicationOperation(com.hazelcast.spi.PartitionReplicationEvent event,
Collection<com.hazelcast.spi.ServiceNamespace> namespaces) |
void |
publishAntiEntropyEvent(String wanReplicationName,
String wanPublisherId,
WanAntiEntropyEvent event)
Publishes an anti-entropy event for the given
wanReplicationName
and wanPublisherId. |
void |
removeWanEventCounters(String serviceName,
String dataStructureName) |
void |
reset() |
void |
resume(String wanReplicationName,
String wanPublisherId) |
void |
rollbackMigration(com.hazelcast.spi.PartitionMigrationEvent event) |
void |
shutdown() |
void |
shutdown(boolean terminate) |
void |
stop(String wanReplicationName,
String wanPublisherId) |
void |
syncAllMaps(String wanReplicationName,
String wanPublisherId) |
void |
syncMap(String wanReplicationName,
String wanPublisherId,
String mapName) |
public EnterpriseWanReplicationService(com.hazelcast.instance.Node node)
public WanReplicationEndpoint getEndpointOrNull(String wanReplicationName, String wanPublisherId)
wanReplicationName and with a WAN publisher ID of
wanPublisherId or null if there is no configuration for
the given parameters.wanReplicationName - the name of the WanReplicationConfigwanPublisherId - the publisher IDnull if there is no configuration for the
given parametersWanReplicationConfig.getName(),
WanPublisherConfig.getGroupName(),
WanPublisherConfig.getPublisherId()public WanReplicationEndpoint getEndpointOrFail(String wanReplicationName, String wanPublisherId)
wanReplicationName and with a WAN publisher ID of
wanPublisherId or throws a InvalidConfigurationException
if there is no configuration for the given parameters.wanReplicationName - the name of the WanReplicationConfigwanPublisherId - the publisher IDcom.hazelcast.config.InvalidConfigurationException - if there is no replication config
with the name wanReplicationName
and publisher ID wanPublisherIdWanReplicationConfig.getName(),
WanPublisherConfig.getGroupName(),
WanPublisherConfig.getPublisherId()public void handleEvent(com.hazelcast.nio.serialization.Data data,
WanOperation wanOperation)
data - the serialized event, can be of type
WanReplicationEvent or
BatchWanReplicationEventwanOperation - the operation sent by the source clusterpublic void appendWanReplicationConfig(com.hazelcast.config.WanReplicationConfig newConfig)
WanReplicationConfig to the configuration of
this member. If there is no WAN replication config with the same name/scheme,
the provided config will be used. If there is an existing WAN replication
config with the same name, any publishers with publisher IDs that are
present in the provided newConfig but not present in the existing
config will be added (appended).
If the existing config contains all of the publishers from the provided
config, no change is done to the existing config.
This method is thread-safe and may be called concurrently.newConfig - the WAN configuration to addWanPublisherConfig.getPublisherId()public void publishAntiEntropyEvent(String wanReplicationName, String wanPublisherId, WanAntiEntropyEvent event)
wanReplicationName
and wanPublisherId.
This method does not wait for the event processing to complete.wanReplicationName - the WAN replication config namewanPublisherId - the publisher ID in the WAN replication configevent - the WAN anti-entropy eventcom.hazelcast.config.InvalidConfigurationException - if there is no replication config
with the wanReplicationName
and wanPublisherIdpublic WanSyncManager getSyncManager()
public void initializeCustomConsumers()
WanReplicationConsumerpublic void handleEvent(com.hazelcast.wan.WanReplicationEvent event)
public com.hazelcast.wan.WanReplicationPublisher getWanReplicationPublisher(String name)
getWanReplicationPublisher in interface com.hazelcast.wan.WanReplicationServicepublic Map<String,com.hazelcast.monitor.LocalWanStats> getStats()
LocalWanStats.getStats in interface com.hazelcast.spi.StatisticsAwareService<com.hazelcast.monitor.LocalWanStats>public static String getPublisherIdOrGroupName(com.hazelcast.config.WanPublisherConfig publisherConfig)
publisherConfig - the WAN replication publisher configurationpublic com.hazelcast.monitor.WanSyncState getWanSyncState()
getWanSyncState in interface com.hazelcast.wan.WanReplicationServicepublic com.hazelcast.wan.impl.DistributedServiceWanEventCounters getReceivedEventCounters(String serviceName)
getReceivedEventCounters in interface com.hazelcast.wan.WanReplicationServicepublic com.hazelcast.wan.impl.DistributedServiceWanEventCounters getSentEventCounters(String wanReplicationName, String wanPublisherId, String serviceName)
getSentEventCounters in interface com.hazelcast.wan.WanReplicationServicepublic void removeWanEventCounters(String serviceName, String dataStructureName)
removeWanEventCounters in interface com.hazelcast.wan.WanReplicationServicepublic com.hazelcast.spi.Operation getPostJoinOperation()
getPostJoinOperation in interface com.hazelcast.spi.PostJoinAwareServicepublic void populate(com.hazelcast.spi.LiveOperations liveOperations)
populate in interface com.hazelcast.spi.LiveOperationsTrackerpublic void shutdown()
shutdown in interface com.hazelcast.wan.WanReplicationServicepublic void pause(String wanReplicationName, String wanPublisherId)
pause in interface com.hazelcast.wan.WanReplicationServicepublic void stop(String wanReplicationName, String wanPublisherId)
stop in interface com.hazelcast.wan.WanReplicationServicepublic void resume(String wanReplicationName, String wanPublisherId)
resume in interface com.hazelcast.wan.WanReplicationServicepublic void checkWanReplicationQueues(String name)
checkWanReplicationQueues in interface com.hazelcast.wan.WanReplicationServicepublic void syncMap(String wanReplicationName, String wanPublisherId, String mapName)
syncMap in interface com.hazelcast.wan.WanReplicationServicepublic void syncAllMaps(String wanReplicationName, String wanPublisherId)
syncAllMaps in interface com.hazelcast.wan.WanReplicationServicepublic void consistencyCheck(String wanReplicationName, String wanPublisherId, String mapName)
consistencyCheck in interface com.hazelcast.wan.WanReplicationServicepublic void clearQueues(String wanReplicationName, String wanPublisherId)
clearQueues in interface com.hazelcast.wan.WanReplicationServicepublic void addWanReplicationConfigLocally(com.hazelcast.config.WanReplicationConfig wanConfig)
addWanReplicationConfigLocally in interface com.hazelcast.wan.WanReplicationServicepublic com.hazelcast.wan.AddWanConfigResult addWanReplicationConfig(com.hazelcast.config.WanReplicationConfig wanConfig)
addWanReplicationConfig in interface com.hazelcast.wan.WanReplicationServicepublic Collection<com.hazelcast.spi.ServiceNamespace> getAllServiceNamespaces(com.hazelcast.spi.PartitionReplicationEvent event)
getAllServiceNamespaces in interface com.hazelcast.spi.FragmentedMigrationAwareServicepublic boolean isKnownServiceNamespace(com.hazelcast.spi.ServiceNamespace namespace)
isKnownServiceNamespace in interface com.hazelcast.spi.FragmentedMigrationAwareServicepublic com.hazelcast.spi.Operation prepareReplicationOperation(com.hazelcast.spi.PartitionReplicationEvent event,
Collection<com.hazelcast.spi.ServiceNamespace> namespaces)
prepareReplicationOperation in interface com.hazelcast.spi.FragmentedMigrationAwareServicepublic com.hazelcast.spi.Operation prepareReplicationOperation(com.hazelcast.spi.PartitionReplicationEvent event)
prepareReplicationOperation in interface com.hazelcast.spi.MigrationAwareServicepublic void beforeMigration(com.hazelcast.spi.PartitionMigrationEvent event)
beforeMigration in interface com.hazelcast.spi.MigrationAwareServicepublic void commitMigration(com.hazelcast.spi.PartitionMigrationEvent event)
commitMigration in interface com.hazelcast.spi.MigrationAwareServicepublic void rollbackMigration(com.hazelcast.spi.PartitionMigrationEvent event)
rollbackMigration in interface com.hazelcast.spi.MigrationAwareServicepublic void init(com.hazelcast.spi.NodeEngine nodeEngine,
Properties properties)
init in interface com.hazelcast.spi.ManagedServicepublic void reset()
reset in interface com.hazelcast.spi.ManagedServicepublic void shutdown(boolean terminate)
shutdown in interface com.hazelcast.spi.ManagedServiceCopyright © 2022 Hazelcast, Inc.. All Rights Reserved.