public class Merger
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
Merger.MergeKiller |
protected class |
Merger.MergeTask
Starts the merge protocol (only run by the merge leader).
|
Modifier and Type | Field and Description |
---|---|
protected ResponseCollector<Digest> |
digest_collector
For GET_DIGEST / DIGEST_RSP correlation
|
protected GMS |
gms |
protected Log |
log |
protected MergeId |
merge_id |
protected BoundedList<MergeId> |
merge_id_history |
protected java.util.concurrent.Future<?> |
merge_killer |
protected ResponseCollector<MergeData> |
merge_rsps
For MERGE_REQ/MERGE_RSP correlation, contains MergeData elements
|
protected Merger.MergeTask |
merge_task |
Modifier and Type | Method and Description |
---|---|
protected void |
_handleMergeRequest(Address sender,
MergeId merge_id,
java.util.Collection<? extends Address> mbrs) |
protected void |
cancelMerge(MergeId id) |
protected static java.util.Map<Address,java.util.Collection<Address>> |
determineMergeCoords(java.util.Map<Address,View> views)
Needs to return a map of all subview coordinators and their views (as a collection of members).
|
protected Address |
determineMergeLeader(java.util.Map<Address,View> views)
Returns the address of the merge leader
|
protected Digest |
fetchDigestsFromAllMembersInSubPartition(View view,
MergeId merge_id)
Multicasts a GET_DIGEST_REQ to all members of this sub partition and waits for all responses
(GET_DIGEST_RSP) or N ms.
|
protected void |
fixDigests()
Fetches the digests from all members and installs them again.
|
protected void |
forceCancelMerge() |
MergeId |
getMergeId() |
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 |
isMergeKillerTaskRunning() |
boolean |
isMergeTaskRunning() |
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 |
sendMergeCancelledMessage(java.util.Collection<Address> coords,
MergeId merge_id) |
protected void |
sendMergeRejectedResponse(Address sender,
MergeId merge_id) |
protected void |
sendMergeResponse(Address sender,
View view,
Digest digest,
MergeId merge_id)
Send back a response containing view and digest to sender
|
protected void |
sendMergeView(java.util.Collection<Address> coords,
MergeData combined_merge_data,
MergeId merge_id)
Sends the new view and digest to all subgroup coordinors in coords.
|
boolean |
setMergeId(MergeId expected,
MergeId new_value) |
protected void |
startMergeKiller() |
protected void |
stop() |
protected void |
stopMergeKiller() |
protected final GMS gms
protected final Log log
protected final Merger.MergeTask merge_task
protected final ResponseCollector<MergeData> merge_rsps
protected final ResponseCollector<Digest> digest_collector
protected MergeId merge_id
protected final BoundedList<MergeId> merge_id_history
protected java.util.concurrent.Future<?> merge_killer
public Merger(GMS gms)
public java.lang.String getMergeIdAsString()
public java.lang.String getMergeIdHistory()
public boolean isMergeTaskRunning()
public boolean isMergeKillerTaskRunning()
public MergeId getMergeId()
public boolean isMergeInProgress()
public boolean matchMergeId(MergeId id)
public void merge(java.util.Map<Address,View> views)
views
- A List of different views detected by the merge protocol, keyed by senderpublic 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-nullpublic 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 Address determineMergeLeader(java.util.Map<Address,View> views)
protected static java.util.Map<Address,java.util.Collection<Address>> determineMergeCoords(java.util.Map<Address,View> views)
protected void _handleMergeRequest(Address sender, MergeId merge_id, java.util.Collection<? extends Address> mbrs) throws java.lang.Exception
java.lang.Exception
protected void sendMergeResponse(Address sender, View view, Digest digest, MergeId merge_id)
protected void sendMergeView(java.util.Collection<Address> coords, MergeData combined_merge_data, MergeId merge_id)
protected void sendMergeRejectedResponse(Address sender, MergeId merge_id)
protected void sendMergeCancelledMessage(java.util.Collection<Address> coords, MergeId merge_id)
protected Digest fetchDigestsFromAllMembersInSubPartition(View view, MergeId merge_id)
protected void fixDigests()
protected void stop()
protected void cancelMerge(MergeId id)
protected void forceCancelMerge()
protected void startMergeKiller()
protected void stopMergeKiller()
Copyright © 1998-2020 Red Hat. All Rights Reserved.