Package com.tangosol.net.partition
Class PartitionEvent
java.lang.Object
java.util.EventObject
com.tangosol.net.partition.PartitionEvent
- All Implemented Interfaces:
Serializable
The PartitionEvent carries information about an event related to one or more
partitions.
- Since:
- Coherence 3.3
- Author:
- cp 2007.05.18
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Member
The "from" member for events that represent transfer from a member.protected Member
The "to" member for events that represent transfer to a member.protected int
The event's id.protected PartitionSet
The set of affected partitions.static final int
This event indicates that the ownership of one or more partitions have been assigned to a service member.static final int
This event indicates that one or more partitions have been lost.static final int
This event indicates that a transfer for one or more partitions is beginning and the data that belongs to partitions in the specified partition set are about to be inserted into corresponding backing maps.static final int
This event indicates that a transfer for one or more partitions has completed and the data that belong to these partitions have been inserted into corresponding backing maps.static final int
This event indicates that one or more partitions have been recovered by a service member.static final int
This event indicates that data that belong to one or more partitions are about to be transferred to a different member.static final int
This event indicates that data that belong to one or more partitions have been successfully transferred to a different member and all the data for that partition have been removed from this node.static final int
This event indicates that a transfer for one or more partitions has been aborted (e.g. receiver's failure), and the partitions are now "owned" by this node again, and are about to be unfrozen.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionPartitionEvent
(PartitionedService svc, int nId, PartitionSet setPartitions, Member memberFrom, Member memberTo) Construct a partition event. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Get the event's description.static String
getDescription
(int nId) Convert an event ID into a human-readable string.Determine the member that held the partitions prior to the action represented by this event.int
getId()
Return this event's id.Determine the set of partitions represented by this event.Determine the partitioned service that this event originates from.Determine the member that holds the partitions after the action represented by this event.toString()
Return a String representation of this PartitionEvent object.Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
PARTITION_LOST
public static final int PARTITION_LOSTThis event indicates that one or more partitions have been lost. When a partition is lost, its ownership is re-assigned to an existing member, on which this event is then raised. By default, the partition is assigned to the senior ownership-enabled member running the partitioned service. For the PARTITION_LOST event, the partition set and "to member" will always be non-null.As of Coherence 3.6, a restart of an ownership-enabled member after the loss of all ownership-enabled members is indistinguishable from a fresh service start. In such a scenario, the PARTITION_ASSIGNED event is raised.
- Since:
- Coherence 3.3
- See Also:
-
PARTITION_TRANSMIT_BEGIN
public static final int PARTITION_TRANSMIT_BEGINThis event indicates that data that belong to one or more partitions are about to be transferred to a different member. When this event is raised, the partitions have been frozen (no changes can occur to data managed within that partitions) and they have been "unowned".- Since:
- Coherence 3.5
- See Also:
-
PARTITION_TRANSMIT_COMMIT
public static final int PARTITION_TRANSMIT_COMMITThis event indicates that data that belong to one or more partitions have been successfully transferred to a different member and all the data for that partition have been removed from this node.- Since:
- Coherence 3.5
- See Also:
-
PARTITION_TRANSMIT_ROLLBACK
public static final int PARTITION_TRANSMIT_ROLLBACKThis event indicates that a transfer for one or more partitions has been aborted (e.g. receiver's failure), and the partitions are now "owned" by this node again, and are about to be unfrozen.- Since:
- Coherence 3.5
- See Also:
-
PARTITION_RECEIVE_BEGIN
public static final int PARTITION_RECEIVE_BEGINThis event indicates that a transfer for one or more partitions is beginning and the data that belongs to partitions in the specified partition set are about to be inserted into corresponding backing maps. When this is event is raised, this node is not yet an owner for these partitions.Note: if this event is raised as a result of a recovery from the backup during failover, the "member from" property will be null.
- Since:
- Coherence 3.5
- See Also:
-
PARTITION_RECEIVE_COMMIT
public static final int PARTITION_RECEIVE_COMMITThis event indicates that a transfer for one or more partitions has completed and the data that belong to these partitions have been inserted into corresponding backing maps. This event is raised immediately before this node becomes the partition owner.Note: if this event is raised as a result of a recovery from the backup during failover, the "member from" property will be null.
- Since:
- Coherence 3.5
- See Also:
-
PARTITION_ASSIGNED
public static final int PARTITION_ASSIGNEDThis event indicates that the ownership of one or more partitions have been assigned to a service member. Partitions are initially assigned when the first ownership-enabled member joins the service, at which time this event is raised. By default, the partition is assigned to the senior ownership-enabled member running the partitioned service. For the PARTITION_ASSIGNED event, the partition set and "to member" will always be non-null.- Since:
- Coherence 3.6
- See Also:
-
PARTITION_RECOVERED
public static final int PARTITION_RECOVEREDThis event indicates that one or more partitions have been recovered by a service member. Partitions are recovered from persistent storage when neither the primary nor any backup owners exist (e.g. during service startup or following the departure of all owners) and a persistent copy is located by the configured PersistenceEnvironment. For the PARTITION_RECOVERED event, the partition set and "to member" will always be non-null.- Since:
- Coherence 12.1.3
- See Also:
-
m_nId
protected int m_nIdThe event's id. -
m_setPartitions
The set of affected partitions. -
m_memberFrom
The "from" member for events that represent transfer from a member. -
m_memberTo
The "to" member for events that represent transfer to a member.
-
-
Constructor Details
-
PartitionEvent
public PartitionEvent(PartitionedService svc, int nId, PartitionSet setPartitions, Member memberFrom, Member memberTo) Construct a partition event.- Parameters:
svc
- the service raising this eventnId
- the event ID, one of the PARTITION_* constantssetPartitions
- the set of partitions represented by this event; may be nullmemberFrom
- the member that held the partitions prior to the action represented by this event; may be nullmemberTo
- the member that holds the partitions after the action represented by this event; may be null
-
-
Method Details
-
getService
Determine the partitioned service that this event originates from.- Returns:
- the originating service
-
getId
public int getId()Return this event's id. The event id is one of the PARTITION_* enumerated constants.It is expected that new event IDs will be added to subsequent versions. Listener implementations that process partition events should only deal with event objects that have specific, known event IDs, and ignore all others.
- Returns:
- the event id
-
getPartitionSet
Determine the set of partitions represented by this event.- Returns:
- the PartitionSet containing the partition identifiers represented by this event; may be null
-
getFromMember
Determine the member that held the partitions prior to the action represented by this event.- Returns:
- the "from" Member for the partitions; may be null
-
getToMember
Determine the member that holds the partitions after the action represented by this event.- Returns:
- the "to" Member for the partitions; may be null
-
getDescription
Get the event's description.- Returns:
- this event's description
-
getDescription
Convert an event ID into a human-readable string.- Parameters:
nId
- an event ID, one of the PARTITION_* enumerated values- Returns:
- a corresponding human-readable string, for example "lost"
-
toString
Return a String representation of this PartitionEvent object.- Overrides:
toString
in classEventObject
- Returns:
- a human-readable description of the PartitionEvent
-