public class Merger
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
protected class |
Merger.MergeTask
Starts the merge protocol (only run by the merge leader).
|
限定符和类型 | 字段和说明 |
---|---|
protected BoundedList<MergeId> |
merge_id_history |
限定符和类型 | 方法和说明 |
---|---|
protected void |
_handleMergeRequest(Address sender,
MergeId merge_id,
java.util.Collection<? extends Address> mbrs) |
MergeId |
getMergeId()
Only used for testing, might get removed any time.
|
java.lang.String |
getMergeIdAsString() |
java.lang.String |
getMergeIdHistory() |
void |
handleDigestResponse(Address sender,
Digest digest) |
void |
handleMergeCancelled(MergeId merge_id) |
void |
handleMergeRequest(Address sender,
MergeId merge_id,
java.util.Collection<? extends Address> mbrs)
Get the view and digest and send back both (MergeData) in the form of a MERGE_RSP to the sender.
|
void |
handleMergeResponse(MergeData data,
MergeId merge_id) |
void |
handleMergeView(MergeData data,
MergeId merge_id)
If merge_id is not equal to this.merge_id then discard.
|
boolean |
isMergeInProgress() |
boolean |
matchMergeId(MergeId id) |
void |
merge(java.util.Map<Address,View> views)
Invoked upon receiving a MERGE event from the MERGE layer.
|
static void |
sanitizeViews(java.util.Map<Address,View> map)
Removes all members from a given view which don't have us in their view
(https://jira.jboss.org/browse/JGRP-1061).
|
protected void |
sendMergeRejectedResponse(Address sender,
MergeId merge_id) |
boolean |
setMergeId(MergeId expected,
MergeId new_value) |
protected final BoundedList<MergeId> merge_id_history
public Merger(GMS gms)
public java.lang.String getMergeIdAsString()
public java.lang.String getMergeIdHistory()
public void merge(java.util.Map<Address,View> views)
views
- A List of different views detected by the merge protocolpublic void handleMergeRequest(Address sender, MergeId merge_id, java.util.Collection<? extends Address> mbrs)
sender
- The address of the merge leadermerge_id
- The merge IDmbrs
- The set of members from which we expect responses. Guaranteed to be non-nullprotected void _handleMergeRequest(Address sender, MergeId merge_id, java.util.Collection<? extends Address> mbrs) throws java.lang.Exception
java.lang.Exception
public void handleMergeView(MergeData data, MergeId merge_id)
public void handleMergeCancelled(MergeId merge_id)
public static void sanitizeViews(java.util.Map<Address,View> map)
A: AB B: AB C: ABCbecomes
A: AB B: AB C: C // A and B don't have C in their views
map
- A map of members and their associated viewsprotected void sendMergeRejectedResponse(Address sender, MergeId merge_id)
public MergeId getMergeId()
public boolean isMergeInProgress()
public boolean matchMergeId(MergeId id)