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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void collectAllServiceNamespaces​(com.hazelcast.internal.partition.PartitionReplicationEvent event, java.util.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 partition
      void onMigrationRollback​(com.hazelcast.internal.partition.PartitionMigrationEvent event)
      Indicates that migration is rolling back for a given partition
      void onMigrationStart​(com.hazelcast.internal.partition.PartitionMigrationEvent event)
      Indicates that migration started for a given partition
      default T prepareEventContainerReplicationData​(com.hazelcast.internal.partition.PartitionReplicationEvent event, java.util.Collection<com.hazelcast.internal.services.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.
    • Method Detail

      • 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,
                                                       java.util.Collection<com.hazelcast.internal.services.ServiceNamespace> namespaces)
        Returns a container containing the WAN events for the given replication 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.
        Parameters:
        event - the replication event
        namespaces - namespaces which will be replicated
        Returns:
        the WAN event container
        See Also:
        processEventContainerReplicationData(int, Object)
      • processEventContainerReplicationData

        default void processEventContainerReplicationData​(int partitionId,
                                                          T eventContainer)
        Processes the WAN event container received through intra-cluster replication or migration. This method may completely remove existing WAN events for the given partitionId or it may append the given eventContainer to the existing events. Invoked when migrating WAN replication data between members in a cluster.
        Parameters:
        partitionId - partition ID which is being replicated or migrated
        eventContainer - the WAN event container
        See Also:
        prepareEventContainerReplicationData(PartitionReplicationEvent, Collection)
      • collectAllServiceNamespaces

        default void collectAllServiceNamespaces​(com.hazelcast.internal.partition.PartitionReplicationEvent event,
                                                 java.util.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 event
        namespaces - the set in which namespaces should be added