Package org.jgroups.protocols.pbcast
Class Merger
java.lang.Object
org.jgroups.protocols.pbcast.Merger
Handles merging. Called by CoordGmsImpl and ParticipantGmsImpl
- Author:
- Bela Ban
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOnly used for testing, might get removed any time.voidhandleDigestResponse(Address sender, Digest digest) voidhandleMergeCancelled(MergeId merge_id) voidhandleMergeRequest(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.voidhandleMergeResponse(MergeData data, MergeId merge_id) voidhandleMergeView(MergeData data, MergeId merge_id) If merge_id is not equal to this.merge_id then discard.voidInvoked upon receiving a MERGE event from the MERGE layer.static voidsanitizeViews(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 voidsendMergeRejectedResponse(Address sender, MergeId merge_id)
-
Constructor Details
-
Merger
-
-
Method Details
-
merge
Invoked upon receiving a MERGE event from the MERGE layer. Starts the merge protocol. See description of protocol in DESIGN.- Parameters:
views- A List of different views detected by the merge protocol
-
handleMergeRequest
public 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. If a merge is already in progress, send back a MergeData with the merge_rejected field set to true.- Parameters:
sender- The address of the merge leadermerge_id- The merge IDmbrs- The set of members from which we expect responses
-
handleMergeResponse
-
handleMergeView
If merge_id is not equal to this.merge_id then discard. Else cast the view/digest to all members of this group. -
handleMergeCancelled
-
handleDigestResponse
-
sanitizeViews
Removes all members from a given view which don't have us in their view (https://jira.jboss.org/browse/JGRP-1061). Example:A: AB B: AB C: ABC
becomesA: AB B: AB C: C // A and B don't have C in their views
- Parameters:
map- A map of members and their associated views
-
sendMergeRejectedResponse
-
getMergeId
Only used for testing, might get removed any time. Do not use !
-