T
- WAN event container type (used for replication and migration inside the
cluster)public interface WanReplicationPublisher<T>
HazelcastInstanceAware
if it needs a reference to the instance on which it is being run.Modifier and Type | Method and Description |
---|---|
default void |
collectAllServiceNamespaces(PartitionReplicationEvent event,
Set<ServiceNamespace> namespaces)
Collect the namespaces of all WAN event containers that should be replicated
by the replication event.
|
void |
doPrepublicationChecks()
Performs pre-publication checks (e.g.
|
default LocalWanPublisherStats |
getStats()
Gathers statistics of related
WanReplicationPublisher instance. |
void |
init(WanReplicationConfig wanReplicationConfig,
AbstractWanPublisherConfig publisherConfig)
Initializes the publisher.
|
default void |
pause()
Calls to this method will pause WAN event container polling.
|
default T |
prepareEventContainerReplicationData(PartitionReplicationEvent event,
Collection<ServiceNamespace> namespaces)
Returns a container containing the WAN events for the given replication
event and namespaces to be replicated. |
default void |
processEventContainerReplicationData(int partitionId,
T eventContainer)
Processes the WAN event container received through intra-cluster replication
or migration.
|
default void |
publishAntiEntropyEvent(WanAntiEntropyEvent event)
Publishes a WAN anti-entropy event.
|
void |
publishReplicationEvent(WanReplicationEvent eventObject)
Publish the
eventObject WAN replication event. |
void |
publishReplicationEventBackup(WanReplicationEvent eventObject)
Publish the
eventObject WAN replication event backup. |
default int |
removeWanEvents()
Removes all WAN events awaiting replication.
|
default int |
removeWanEvents(int partitionId,
String serviceName)
Removes all WAN events awaiting replication and belonging to the provided
service and partition.
|
void |
republishReplicationEvent(WanReplicationEvent wanReplicationEvent)
Publishes the
wanReplicationEvent on this publisher. |
default void |
reset()
Resets the publisher (e.g.
|
default void |
resume()
This method re-enables WAN event containers polling for a paused or stopped
WanReplicationPublisher instance. |
void |
shutdown()
Closes the publisher and its internal connections and shuts down other internal states.
|
default void |
stop()
Calls to this method will stop WAN replication.
|
void init(WanReplicationConfig wanReplicationConfig, AbstractWanPublisherConfig publisherConfig)
wanReplicationConfig
- WanReplicationConfig
instancepublisherConfig
- AbstractWanPublisherConfig
instancevoid shutdown()
default void reset()
void doPrepublicationChecks()
publishReplicationEvent(WanReplicationEvent)
and publishReplicationEventBackup(WanReplicationEvent)
.void publishReplicationEvent(WanReplicationEvent eventObject)
eventObject
WAN replication event.eventObject
- the replication eventvoid publishReplicationEventBackup(WanReplicationEvent eventObject)
eventObject
WAN replication event backup.eventObject
- the replication backup eventvoid republishReplicationEvent(WanReplicationEvent wanReplicationEvent)
wanReplicationEvent
on this publisher. This can be
used to forward received events on the target cluster.wanReplicationEvent
- the WAN event to publishdefault void publishAntiEntropyEvent(WanAntiEntropyEvent event)
event
- the WAN anti-entropy eventdefault void pause()
WanReplicationPublisher
instance.
WAN events will still be offered to WAN event containers but they won't be polled. This means that the containers might eventually fill up and start dropping events.
Calling this method on already paused WanReplicationPublisher
instances will have no effect.
default void stop()
pause()
method, a publisher which is stopped
should not accept new events. This method will not remove existing events.
This means that once this method returns, there might still be some WAN
events in the containers but these events will not be replicated until
the publisher is resumed.
Calling this method on already stopped WanReplicationPublisher
instances will have no effect.
NOTE: used only in Hazelcast Enterprise.
default void resume()
WanReplicationPublisher
instance.
Calling this method on already running WanReplicationPublisher
instances will have no effect.
NOTE: used only in Hazelcast Enterprise.
default LocalWanPublisherStats getStats()
WanReplicationPublisher
instance.
This method will always return the same instance.
NOTE: used only in Hazelcast Enterprise.LocalWanPublisherStats
default T prepareEventContainerReplicationData(PartitionReplicationEvent event, Collection<ServiceNamespace> namespaces)
event
and namespaces
to be replicated. The replication
here refers to the intra-cluster replication between members in a single
cluster and does not refer to WAN replication, e.g. between two clusters.
Invoked when migrating WAN replication data between members in a cluster.
NOTE: used only in Hazelcast Enterprise.event
- the replication eventnamespaces
- namespaces which will be replicatedprocessEventContainerReplicationData(int, Object)
default void processEventContainerReplicationData(int partitionId, T eventContainer)
partitionId
or it may append the given
eventContainer
to the existing events.
Invoked when migrating WAN replication data between members in a cluster.
NOTE: used only in Hazelcast Enterprise.partitionId
- partition ID which is being replicated or migratedeventContainer
- the WAN event containerprepareEventContainerReplicationData(PartitionReplicationEvent, Collection)
default void collectAllServiceNamespaces(PartitionReplicationEvent event, Set<ServiceNamespace> namespaces)
event
- the replication eventnamespaces
- the set in which namespaces should be addeddefault int removeWanEvents()
default int removeWanEvents(int partitionId, String serviceName)
serviceName
- the service name of the WAN events should be removedpartitionId
- the partition ID of the WAN events should be removedCopyright © 2019 Hazelcast, Inc.. All rights reserved.