com.hazelcast.spi.partition

## Class IPartitionLostEvent

- java.lang.Object
- - com.hazelcast.spi.partition.IPartitionLostEvent

- All Implemented Interfaces:
    DataSerializable

      public class IPartitionLostEvent
      extends Object
      implements DataSerializable

  Internal event that is dispatched to `PartitionAwareService.onPartitionLost(com.hazelcast.spi.partition.IPartitionLostEvent)`

  It contains the partition ID, number of replicas that is lost and the address of node that detects the partition lost.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IPartitionLostEvent()`
    `IPartitionLostEvent(int partitionId, int lostReplicaIndex, Address eventSource)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Address` | `getEventSource()` The address of the node that detects the partition lost.
    `int` | `getLostReplicaIndex()` 0-based replica index that is lost for the partition.
    `int` | `getPartitionId()` The partition ID that is lost.
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

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

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

- - ### Constructor Detail

    - #### IPartitionLostEvent

          public IPartitionLostEvent()

    - #### IPartitionLostEvent

          public IPartitionLostEvent(int partitionId,
                                     int lostReplicaIndex,
                                     Address eventSource)

  - ### Method Detail

    - #### getPartitionId

          public int getPartitionId()

      The partition ID that is lost.
      Returns:
        the partition ID that is lost

    - #### getLostReplicaIndex

          public int getLostReplicaIndex()

      0-based replica index that is lost for the partition.

      For instance, 0 means only the owner of the partition is lost, 1 means both the owner and first backup are lost.

      Returns:
        0-based replica index that is lost for the partition

    - #### getEventSource

          public Address getEventSource()

      The address of the node that detects the partition lost.
      Returns:
        the address of the node that detects the partition lost

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2020. All rights reserved.