com.hazelcast.partition

## Class PartitionLostEvent

- java.lang.Object
- - com.hazelcast.partition.PartitionLostEvent

- All Implemented Interfaces:
    DataSerializable, PartitionEvent

      public class PartitionLostEvent
      extends Object
      implements DataSerializable, PartitionEvent

  The event that is fired when a partition lost its owner and all backups.
  See Also:
    `Partition`, `PartitionService`, `PartitionLostListener`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PartitionLostEvent()`
    `PartitionLostEvent(int partitionId, int lostBackupCount, Address eventSource)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Address` | `getEventSource()` Returns the address of the node that dispatches the event
    `int` | `getLostBackupCount()` Returns the number of lost backups for the partition.
    `int` | `getPartitionId()` Returns the lost partition ID.
    `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

    - #### PartitionLostEvent

          public PartitionLostEvent()

    - #### PartitionLostEvent

          public PartitionLostEvent(int partitionId,
                                    int lostBackupCount,
                                    Address eventSource)

  - ### Method Detail

    - #### getPartitionId

          public int getPartitionId()

      Returns the lost partition ID.
      Specified by:
        `getPartitionId` in interface `PartitionEvent`
      Returns:
        the lost partition ID.

    - #### getLostBackupCount

          public int getLostBackupCount()

      Returns the number of lost backups for the partition. 0: the owner, 1: first backup, 2: second backup... If all replicas of a partition are lost, `IPartition.MAX_BACKUP_COUNT` is returned.

    - #### getEventSource

          public Address getEventSource()

      Returns the address of the node that dispatches the event
      Returns:
        the address of the node that dispatches the event

    - #### 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.