public class WanReplicationServiceImpl extends Object implements WanReplicationService
WanReplicationService
SERVICE_NAME
Constructor and Description |
---|
WanReplicationServiceImpl(Node node) |
Modifier and Type | Method and Description |
---|---|
AddWanConfigResult |
addWanReplicationConfig(WanReplicationConfig wanConfig)
Adds a new
WanReplicationConfig to the cluster. |
void |
addWanReplicationConfigLocally(WanReplicationConfig wanConfig)
Adds a new
WanReplicationConfig to this member and creates the
WanReplicationPublisher s specified in the config. |
UUID |
consistencyCheck(String wanReplicationName,
String wanPublisherId,
String mapName)
Initiate WAN consistency check for a specific map.
|
DistributedServiceWanEventCounters |
getReceivedEventCounters(String serviceName)
Returns a counter of received and processed WAN replication events.
|
DistributedServiceWanEventCounters |
getSentEventCounters(String wanReplicationName,
String wanPublisherId,
String serviceName)
Returns a counter of sent and processed WAN replication events.
|
Map<String,LocalWanStats> |
getStats()
Return the service statistics for the local instance.
|
List<Version> |
getSupportedWanProtocolVersions()
Returns an immutable collection of all WAN protocol versions supported by
this instance.
|
static String |
getWanPublisherId(AbstractWanPublisherConfig 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.
|
DelegatingWanReplicationScheme |
getWanReplicationPublishers(String name)
Creates a new
WanReplicationPublisher by the given name. |
WanSyncState |
getWanSyncState()
Returns current status of WAN sync operation or
null when there
is no status. |
void |
pause(String wanReplicationName,
String wanPublisherId)
Pauses WAN replication for the given
wanReplicationName and
wanPublisherId on this hazelcast instance. |
void |
removeWanEventCounters(String serviceName,
String objectName)
Removes all WAN event counters for the given
serviceName and
dataStructureName . |
void |
removeWanEvents(String wanReplicationName,
String wanPublisherId)
Removes all WAN events awaiting replication for the given wanReplicationName
for the given target.
|
void |
resume(String wanReplicationName,
String wanPublisherId)
Resumes WAN replication for the given
wanReplicationName and
wanPublisherId on this hazelcast instance. |
void |
shutdown()
Starts the shutdown process of the WAN replication service.
|
void |
stop(String wanReplicationName,
String wanPublisherId)
Stops WAN replication for the given
wanReplicationName and
wanPublisherId on this hazelcast instance. |
UUID |
syncAllMaps(String wanReplicationName,
String wanPublisherId)
Initiate wan sync for all maps.
|
UUID |
syncMap(String wanReplicationName,
String wanPublisherId,
String mapName)
Initiate wan sync for a specific map.
|
public WanReplicationServiceImpl(Node node)
public DelegatingWanReplicationScheme getWanReplicationPublishers(String name)
WanReplicationService
WanReplicationPublisher
by the given name. If
the name already exists, returns the previous instance.getWanReplicationPublishers
in interface WanReplicationService
name
- name of the WAN replication configuration@Nonnull public static String getWanPublisherId(AbstractWanPublisherConfig publisherConfig)
publisherConfig
- the WAN replication publisher configurationpublic void shutdown()
WanReplicationService
shutdown
in interface WanReplicationService
public void pause(String wanReplicationName, String wanPublisherId)
WanReplicationService
wanReplicationName
and
wanPublisherId
on this hazelcast instance.pause
in interface WanReplicationService
wanReplicationName
- name of WAN replication configurationwanPublisherId
- ID of the WAN replication publisherpublic void stop(String wanReplicationName, String wanPublisherId)
WanReplicationService
wanReplicationName
and
wanPublisherId
on this hazelcast instance.stop
in interface WanReplicationService
wanReplicationName
- name of WAN replication configurationwanPublisherId
- ID of the WAN replication publisherpublic void resume(String wanReplicationName, String wanPublisherId)
WanReplicationService
wanReplicationName
and
wanPublisherId
on this hazelcast instance.resume
in interface WanReplicationService
wanReplicationName
- name of WAN replication configurationwanPublisherId
- ID of the WAN replication publisherpublic UUID syncMap(String wanReplicationName, String wanPublisherId, String mapName)
WanReplicationService
syncMap
in interface WanReplicationService
wanReplicationName
- the name of the wan replication configwanPublisherId
- ID of the WAN replication publishermapName
- the map namepublic UUID syncAllMaps(String wanReplicationName, String wanPublisherId)
WanReplicationService
syncAllMaps
in interface WanReplicationService
wanReplicationName
- the name of the wan replication configwanPublisherId
- ID of the WAN replication publisherpublic UUID consistencyCheck(String wanReplicationName, String wanPublisherId, String mapName)
WanReplicationService
consistencyCheck
in interface WanReplicationService
wanReplicationName
- the name of the wan replication configwanPublisherId
- ID of the WAN replication publishermapName
- the map namenull
if consistency check is ignored because of the configurationpublic void removeWanEvents(String wanReplicationName, String wanPublisherId)
WanReplicationService
removeWanEvents
in interface WanReplicationService
wanReplicationName
- the name of the wan replication configwanPublisherId
- ID of the WAN replication publisherpublic AddWanConfigResult addWanReplicationConfig(WanReplicationConfig wanConfig)
WanReplicationService
WanReplicationConfig
to the cluster.
This method can also accept WAN configs with an existing WAN replication
name. Such configs will be merged into the existing WAN replication
config by adding publishers with publisher IDs which are not already part
of the existing configuration.
The return value is a best-effort guess at the result of adding WAN
replication config based on the existing local WAN replication config.
An exact result is difficult to calculate since not all members might
have the same existing configuration and there might be a concurrent
request to add overlapping WAN replication config.addWanReplicationConfig
in interface WanReplicationService
wanConfig
- the WAN replication config to addWanReplicationService.addWanReplicationConfigLocally(WanReplicationConfig)
public void addWanReplicationConfigLocally(WanReplicationConfig wanConfig)
WanReplicationService
WanReplicationConfig
to this member and creates the
WanReplicationPublisher
s specified in the config.
This method can also accept WAN configs with an existing WAN replication
name. Such configs will be merged into the existing WAN replication
config by adding publishers with publisher IDs which are not already part
of the existing configuration.addWanReplicationConfigLocally
in interface WanReplicationService
public Map<String,LocalWanStats> getStats()
StatisticsAwareService
getStats
in interface StatisticsAwareService<LocalWanStats>
public WanSyncState getWanSyncState()
WanReplicationService
null
when there
is no status.getWanSyncState
in interface WanReplicationService
public DistributedServiceWanEventCounters getReceivedEventCounters(String serviceName)
WanReplicationService
getReceivedEventCounters
in interface WanReplicationService
serviceName
- the name of the service for the WAN eventspublic DistributedServiceWanEventCounters getSentEventCounters(String wanReplicationName, String wanPublisherId, String serviceName)
WanReplicationService
getSentEventCounters
in interface WanReplicationService
wanReplicationName
- the name of the wan replication configwanPublisherId
- WAN replication publisher IDserviceName
- the name of the service for the WAN eventspublic void removeWanEventCounters(String serviceName, String objectName)
WanReplicationService
serviceName
and
dataStructureName
.removeWanEventCounters
in interface WanReplicationService
serviceName
- the name of the service for the WAN eventsobjectName
- the distributed object namepublic List<Version> getSupportedWanProtocolVersions()
WanReplicationService
getSupportedWanProtocolVersions
in interface WanReplicationService
Copyright © 2019 Hazelcast, Inc.. All rights reserved.