com.hazelcast.spi

## Class PartitionReplicationEvent

- java.lang.Object
- - java.util.EventObject
  - - com.hazelcast.spi.PartitionReplicationEvent

- All Implemented Interfaces:
    Serializable

      public class PartitionReplicationEvent
      extends EventObject

  An event send to `MigrationAwareService` when partition changes happen.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.EventObject

      `source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PartitionReplicationEvent(int partitionId, int replicaIndex)` Creates a PartitionReplicationEvent

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getPartitionId()` Gets the ID of the partition.
    `int` | `getReplicaIndex()` Gets the replica index.
    `String` | `toString()`

    - ### Methods inherited from class java.util.EventObject

      `getSource`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PartitionReplicationEvent

          public PartitionReplicationEvent(int partitionId,
                                           int replicaIndex)

      Creates a PartitionReplicationEvent
      Parameters:
        `partitionId` - the partition ID
        `replicaIndex` - the replica index

  - ### Method Detail

    - #### getPartitionId

          public int getPartitionId()

      Gets the ID of the partition.
      Returns:
        the ID of the partition

    - #### getReplicaIndex

          public int getReplicaIndex()

      Gets the replica index. 0 is primary, the rest is backup.
      Returns:
        the replica index

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `EventObject`

Copyright © 2019. All rights reserved.