public class IPartitionLostEvent extends Object implements DataSerializable
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 and Description |
---|
IPartitionLostEvent() |
IPartitionLostEvent(int partitionId,
int lostReplicaIndex,
Address eventSource) |
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
|
public IPartitionLostEvent()
public IPartitionLostEvent(int partitionId, int lostReplicaIndex, Address eventSource)
public int getPartitionId()
public int getLostReplicaIndex()
For instance, 0 means only the owner of the partition is lost, 1 means both the owner and first backup are lost.
public Address getEventSource()
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.