MERGE3
instead, as it causes less traffic, especially for large clusters@Deprecated public class MERGE2 extends Protocol
This protocol works as follows:
Provides: sends MERGE event with list of coordinators up the stack
Modifier and Type | Class and Description |
---|---|
protected class |
MERGE2.FindSubgroupsTask
Deprecated.
Task periodically executing (if role is coordinator).
|
protected static class |
MERGE2.MergeHeader
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
cluster_name
Deprecated.
|
protected Address |
current_coord
Deprecated.
|
protected CondVar |
discovery_cond
Deprecated.
|
protected java.util.concurrent.locks.Lock |
discovery_lock
Deprecated.
|
protected long |
discovery_timeout
Deprecated.
|
protected boolean |
fetching_done
Deprecated.
|
protected boolean |
force_sending_discovery_rsps
Deprecated.
|
protected int |
inconsistent_view_threshold
Deprecated.
|
protected boolean |
is_coord
Deprecated.
|
protected Address |
local_addr
Deprecated.
|
protected long |
max_interval
Deprecated.
|
protected java.util.Set<Address> |
members
Deprecated.
|
protected java.util.Set<Address> |
merge_candidates
Deprecated.
|
protected boolean |
merge_fast
Deprecated.
|
protected long |
merge_fast_delay
Deprecated.
|
protected long |
min_interval
Deprecated.
|
protected int |
num_inconsistent_views
Deprecated.
|
protected int |
num_merge_events
Deprecated.
|
protected MERGE2.FindSubgroupsTask |
task
Deprecated.
|
protected TimeScheduler |
timer
Deprecated.
|
protected boolean |
transport_supports_multicasting
Deprecated.
|
protected View |
view
Deprecated.
|
protected java.util.Map<Address,View> |
views
Deprecated.
|
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
MERGE2()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
down(Event evt)
Deprecated.
An event is to be sent down the stack.
|
java.lang.String |
fetchAllViews()
Deprecated.
|
java.lang.String |
getCurrentCoord()
Deprecated.
|
long |
getMaxInterval()
Deprecated.
|
long |
getMinInterval()
Deprecated.
|
protected void |
handle(MERGE2.MergeHeader hdr,
Address sender)
Deprecated.
|
void |
init()
Deprecated.
Called after instance has been created (null constructor) and before protocol is started.
|
protected boolean |
isMergeRunning()
Deprecated.
|
boolean |
isMergeTaskRunning()
Deprecated.
|
protected void |
mergeFast(Address dest,
Address sender)
Deprecated.
|
void |
sendMergeSolicitation()
Deprecated.
Discovers members and detects whether we have multiple coordinator.
|
void |
setMaxInterval(long l)
Deprecated.
|
void |
setMinInterval(long i)
Deprecated.
|
void |
startMergeTask()
Deprecated.
|
void |
stop()
Deprecated.
This method is called on a
Channel.disconnect() . |
void |
stopMergeTask()
Deprecated.
|
java.lang.Object |
up(Event evt)
Deprecated.
An event was received from the layer below.
|
void |
up(MessageBatch batch)
Deprecated.
Sends up a multiple messages in a
MessageBatch . |
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled
protected long min_interval
protected long max_interval
protected int inconsistent_view_threshold
protected boolean merge_fast
protected long merge_fast_delay
protected boolean force_sending_discovery_rsps
protected long discovery_timeout
protected Address local_addr
protected volatile View view
protected final java.util.Set<Address> members
protected final java.util.Set<Address> merge_candidates
protected final MERGE2.FindSubgroupsTask task
protected volatile boolean is_coord
protected volatile Address current_coord
protected TimeScheduler timer
protected int num_inconsistent_views
protected int num_merge_events
protected final java.util.concurrent.locks.Lock discovery_lock
protected final CondVar discovery_cond
protected volatile boolean fetching_done
protected boolean transport_supports_multicasting
protected java.lang.String cluster_name
public boolean isMergeTaskRunning()
public void init() throws java.lang.Exception
Protocol
public long getMinInterval()
public void setMinInterval(long i)
public long getMaxInterval()
public void setMaxInterval(long l)
protected boolean isMergeRunning()
public void sendMergeSolicitation()
public java.lang.String getCurrentCoord()
public void startMergeTask()
public void stopMergeTask()
public java.lang.String fetchAllViews()
public void stop()
Protocol
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushedpublic java.lang.Object down(Event evt)
Protocol
down_prot.down()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using up_prot.up()
.public java.lang.Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.public void up(MessageBatch batch)
Protocol
MessageBatch
. The sender of the batch is always the same, and so is the
destination (null == multicast messages). Messages in a batch can be OOB messages, regular messages, or mixed
messages, although the transport itself will create initial MessageBatches that contain only either OOB or
regular messages.
The default processing below sends messages up the stack individually, based on a matching criteria
(calling Protocol.accept(org.jgroups.Message)
), and - if true - calls Protocol.up(org.jgroups.Event)
for that message and removes the message. If the batch is not empty, it is passed up, or else it is dropped.
Subclasses should check if there are any messages destined for them (e.g. using
MessageBatch.getMatchingMessages(short,boolean)
), then possibly remove and process them and finally pass
the batch up to the next protocol. Protocols can also modify messages in place, e.g. ENCRYPT could decrypt all
encrypted messages in the batch, not remove them, and pass the batch up when done.protected void handle(MERGE2.MergeHeader hdr, Address sender)
Copyright © 1998-2020 Red Hat. All Rights Reserved.