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
限定符和类型 | 类和说明 |
---|---|
protected class |
MERGE2.FindSubgroupsTask
已过时。
Task periodically executing (if role is coordinator).
|
protected static class |
MERGE2.MergeHeader
已过时。
|
限定符和类型 | 字段和说明 |
---|---|
protected java.lang.String |
cluster_name
已过时。
|
protected Address |
current_coord
已过时。
|
protected java.util.concurrent.locks.Condition |
discovery_cond
已过时。
|
protected java.util.concurrent.locks.Lock |
discovery_lock
已过时。
|
protected long |
discovery_timeout
已过时。
|
protected boolean |
fetching_done
已过时。
|
protected boolean |
force_sending_discovery_rsps
已过时。
|
protected int |
inconsistent_view_threshold
已过时。
|
protected boolean |
is_coord
已过时。
|
protected Address |
local_addr
已过时。
|
protected long |
max_interval
已过时。
|
protected java.util.Set<Address> |
members
已过时。
|
protected java.util.Set<Address> |
merge_candidates
已过时。
|
protected boolean |
merge_fast
已过时。
|
protected long |
merge_fast_delay
已过时。
|
protected long |
min_interval
已过时。
|
protected int |
num_inconsistent_views
已过时。
|
protected int |
num_merge_events
已过时。
|
protected MERGE2.FindSubgroupsTask |
task
已过时。
|
protected TimeScheduler |
timer
已过时。
|
protected boolean |
transport_supports_multicasting
已过时。
|
protected View |
view
已过时。
|
protected java.util.Map<Address,View> |
views
已过时。
|
构造器和说明 |
---|
MERGE2()
已过时。
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.Object |
down(Event evt)
已过时。
An event is to be sent down the stack.
|
java.lang.String |
fetchAllViews()
已过时。
|
java.lang.String |
getCurrentCoord()
已过时。
|
long |
getMaxInterval()
已过时。
|
long |
getMinInterval()
已过时。
|
protected void |
handle(MERGE2.MergeHeader hdr,
Address sender)
已过时。
|
void |
init()
已过时。
Called after instance has been created (null constructor) and before protocol is started.
|
protected boolean |
isMergeRunning()
已过时。
|
boolean |
isMergeTaskRunning()
已过时。
|
protected void |
mergeFast(Address dest,
Address sender)
已过时。
|
void |
sendMergeSolicitation()
已过时。
Discovers members and detects whether we have multiple coordinator.
|
void |
setMaxInterval(long l)
已过时。
|
void |
setMinInterval(long i)
已过时。
|
void |
startMergeTask()
已过时。
|
void |
stop()
已过时。
This method is called on a
Channel.disconnect() . |
void |
stopMergeTask()
已过时。
|
java.lang.Object |
up(Event evt)
已过时。
An event was received from the layer below.
|
void |
up(MessageBatch batch)
已过时。
Sends up a multiple messages in a
MessageBatch . |
accept, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, 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 java.util.concurrent.locks.Condition 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(Message)
), and - if true - calls Protocol.up(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)