public class Merger extends Object
Modifier and Type | Field and Description |
---|---|
protected BoundedList<MergeId> |
merge_id_history |
Modifier and Type | Method and Description |
---|---|
protected void |
_handleMergeRequest(Address sender,
MergeId merge_id,
Collection<? extends Address> mbrs) |
MergeId |
getMergeId()
Only used for testing, might get removed any time.
|
String |
getMergeIdAsString() |
String |
getMergeIdHistory() |
void |
handleDigestResponse(Address sender,
Digest digest) |
void |
handleMergeCancelled(MergeId merge_id) |
void |
handleMergeRequest(Address sender,
MergeId merge_id,
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(Map<Address,View> views)
Invoked upon receiving a MERGE event from the MERGE layer.
|
static void |
sanitizeViews(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 String getMergeIdAsString()
public String getMergeIdHistory()
public void merge(Map<Address,View> views)
views
- A List of different views detected by the merge protocolpublic void handleMergeRequest(Address sender, MergeId merge_id, Collection<? extends Address> mbrs)
sender
- The address of the merge leadermerge_id
- The merge IDmbrs
- The set of members from which we expect responsesprotected void _handleMergeRequest(Address sender, MergeId merge_id, Collection<? extends Address> mbrs) throws Exception
Exception
public void handleMergeView(MergeData data, MergeId merge_id)
public void handleMergeCancelled(MergeId merge_id)
public static void sanitizeViews(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)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.