protected class Merger.MergeTask
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.ConcurrentMap<Address,java.util.Collection<Address>> |
coords
List of all subpartition coordinators and their members
|
protected java.util.Set<View> |
subviews |
protected java.lang.Thread |
thread |
Modifier | Constructor and Description |
---|---|
protected |
MergeTask() |
Modifier and Type | Method and Description |
---|---|
protected void |
_run(MergeId new_merge_id,
java.util.Collection<Address> coordsCopy)
Runs the merge protocol as a leader
|
protected MutableDigest |
consolidateDigests(View new_view,
java.util.List<MergeData> merge_rsps)
Merge all digests into one.
|
protected MergeData |
consolidateMergeData(java.util.List<MergeData> merge_rsps,
java.util.List<View> subviews)
Merge all MergeData.
|
protected boolean |
getMergeDataFromSubgroupCoordinators(java.util.Map<Address,java.util.Collection<Address>> coords,
MergeId new_merge_id,
long timeout)
Sends a MERGE_REQ to all coords and populates a list of MergeData (in merge_rsps).
|
boolean |
isRunning() |
protected void |
removeRejectedMergeRequests(java.util.Collection<Address> coords)
Removed rejected merge requests from merge_rsps and coords.
|
void |
run() |
void |
start(java.util.Map<Address,View> views) |
void |
stop() |
protected java.lang.Thread thread
protected final java.util.concurrent.ConcurrentMap<Address,java.util.Collection<Address>> coords
protected final java.util.Set<View> subviews
public void start(java.util.Map<Address,View> views)
views
- Guaranteed to be non-null and to have >= 2 members, or else this thread would not be startedpublic void stop()
public boolean isRunning()
public void run()
run
in interface java.lang.Runnable
protected void _run(MergeId new_merge_id, java.util.Collection<Address> coordsCopy) throws java.lang.Exception
java.lang.Exception
protected boolean getMergeDataFromSubgroupCoordinators(java.util.Map<Address,java.util.Collection<Address>> coords, MergeId new_merge_id, long timeout)
If a subgroup coordinator rejects the MERGE_REQ (e.g. because of participation in a different merge), that member will be removed from coords !
coords
- A map of coordinatgor addresses and associated membership listsnew_merge_id
- The new merge idtimeout
- Max number of msecs to wait for the merge responses from the subgroup coordsprotected void removeRejectedMergeRequests(java.util.Collection<Address> coords)
protected MergeData consolidateMergeData(java.util.List<MergeData> merge_rsps, java.util.List<View> subviews)
After merging all members into a Membership and subsequent sorting, the first member of the sorted membership will be the new coordinator. This method has a lock on merge_rsps.
merge_rsps
- A list of MergeData items. Elements with merge_rejected=true were removed before. Is guaranteed
not to be null and to contain at least 1 membersubviews
- Contains a list of Views, each View is a subgroupprotected MutableDigest consolidateDigests(View new_view, java.util.List<MergeData> merge_rsps)
Copyright © 1998-2020 Red Hat. All Rights Reserved.