Package com.hazelcast.wan
Interface WanMigrationAwarePublisher<T>
- Type Parameters:
T
- WAN event container type (used for replication and migration inside the cluster)
public interface WanMigrationAwarePublisher<T>
Interface for WAN publisher migration related events. Can be implemented
by WAN publishers to listen to migration events, for example to maintain
the WAN event counters.
None of the methods of this interface is expected to block or fail.
- See Also:
-
PartitionMigrationEvent
MigrationAwareService
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
collectAllServiceNamespaces
(com.hazelcast.internal.partition.PartitionReplicationEvent event, Set<com.hazelcast.internal.services.ServiceNamespace> namespaces) Collect the namespaces of all WAN event containers that should be replicated by the replication event.void
onMigrationCommit
(com.hazelcast.internal.partition.PartitionMigrationEvent event) Indicates that migration is committing for a given partitionvoid
onMigrationRollback
(com.hazelcast.internal.partition.PartitionMigrationEvent event) Indicates that migration is rolling back for a given partitionvoid
onMigrationStart
(com.hazelcast.internal.partition.PartitionMigrationEvent event) Indicates that migration started for a given partitiondefault T
prepareEventContainerReplicationData
(com.hazelcast.internal.partition.PartitionReplicationEvent event, Collection<com.hazelcast.internal.services.ServiceNamespace> namespaces) Returns a container containing the WAN events for the given replicationevent
andnamespaces
to be replicated.default void
processEventContainerReplicationData
(int partitionId, T eventContainer) Processes the WAN event container received through intra-cluster replication or migration.
-
Method Details
-
onMigrationStart
void onMigrationStart(com.hazelcast.internal.partition.PartitionMigrationEvent event) Indicates that migration started for a given partition- Parameters:
event
- the migration event
-
onMigrationCommit
void onMigrationCommit(com.hazelcast.internal.partition.PartitionMigrationEvent event) Indicates that migration is committing for a given partition- Parameters:
event
- the migration event
-
onMigrationRollback
void onMigrationRollback(com.hazelcast.internal.partition.PartitionMigrationEvent event) Indicates that migration is rolling back for a given partition- Parameters:
event
- the migration event
-
prepareEventContainerReplicationData
default T prepareEventContainerReplicationData(com.hazelcast.internal.partition.PartitionReplicationEvent event, Collection<com.hazelcast.internal.services.ServiceNamespace> namespaces) Returns a container containing the WAN events for the given replicationevent
andnamespaces
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.- Parameters:
event
- the replication eventnamespaces
- namespaces which will be replicated- Returns:
- the WAN event container
- See Also:
-
processEventContainerReplicationData
Processes the WAN event container received through intra-cluster replication or migration. This method may completely remove existing WAN events for the givenpartitionId
or it may append the giveneventContainer
to the existing events. Invoked when migrating WAN replication data between members in a cluster.- Parameters:
partitionId
- partition ID which is being replicated or migratedeventContainer
- the WAN event container- See Also:
-
collectAllServiceNamespaces
default void collectAllServiceNamespaces(com.hazelcast.internal.partition.PartitionReplicationEvent event, Set<com.hazelcast.internal.services.ServiceNamespace> namespaces) Collect the namespaces of all WAN event containers that should be replicated by the replication event. Invoked when migrating WAN replication data between members in a cluster.- Parameters:
event
- the replication eventnamespaces
- the set in which namespaces should be added
-