com.hazelcast.core
Class MigrationEvent

java.lang.Object
  extended by com.hazelcast.core.MigrationEvent
All Implemented Interfaces:
DataSerializable

public class MigrationEvent
extends Object
implements DataSerializable

An event fired when a partition migration starts, completes or fails.

See Also:
Partition, PartitionService, MigrationListener

Nested Class Summary
static class MigrationEvent.MigrationStatus
          Migration status: Started, completed or failed
 
Constructor Summary
MigrationEvent()
           
MigrationEvent(int partitionId, Member oldOwner, Member newOwner, MigrationEvent.MigrationStatus status)
           
 
Method Summary
 Member getNewOwner()
          Returns the new owner of the migrating partition
 Member getOldOwner()
          Returns the old owner of the migrating partition
 int getPartitionId()
          Returns the id of the partition which is (or is being) migrated
 MigrationEvent.MigrationStatus getStatus()
          Returns the status of the migration: started, completed or failed
 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

MigrationEvent

public MigrationEvent()

MigrationEvent

public MigrationEvent(int partitionId,
                      Member oldOwner,
                      Member newOwner,
                      MigrationEvent.MigrationStatus status)
Method Detail

getPartitionId

public int getPartitionId()
Returns the id of the partition which is (or is being) migrated

Returns:
the id of the partition which is (or is being) migrated

getOldOwner

public Member getOldOwner()
Returns the old owner of the migrating partition

Returns:
the old owner of the migrating partition

getNewOwner

public Member getNewOwner()
Returns the new owner of the migrating partition

Returns:
the new owner of the migrating partition

getStatus

public MigrationEvent.MigrationStatus getStatus()
Returns the status of the migration: started, completed or failed

Returns:
the migration status: started, completed or failed

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

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.