public class MERGE3 extends Protocol
限定符和类型 | 类和说明 |
---|---|
protected class |
MERGE3.InfoSender |
static class |
MERGE3.MergeHeader |
protected class |
MERGE3.ViewConsistencyChecker |
限定符和类型 | 字段和说明 |
---|---|
protected long |
check_interval |
protected java.lang.String |
cluster_name |
protected java.util.concurrent.Future<?> |
info_sender |
protected boolean |
is_coord |
protected Address |
local_addr |
protected long |
max_interval |
protected int |
max_participants_in_merge |
protected long |
min_interval |
protected int |
num_merge_events |
protected TimeScheduler |
timer |
protected boolean |
transport_supports_multicasting |
protected View |
view |
protected java.util.concurrent.Future<?> |
view_consistency_checker |
protected ResponseCollector<View> |
view_rsps |
protected java.util.concurrent.ConcurrentMap<ViewId,java.util.Set<Address>> |
views |
构造器和说明 |
---|
MERGE3() |
限定符和类型 | 方法和说明 |
---|---|
protected void |
addInfo(Address sender,
ViewId view_id,
java.lang.String logical_name,
PhysicalAddress physical_addr)
Adds received INFO to views hashmap
|
void |
checkInconsistencies() |
void |
clearViews() |
protected long |
computeCheckInterval() |
protected MERGE3.MergeHeader |
createInfo() |
static java.util.List<View> |
detectDifferentViews(java.util.Map<Address,View> map) |
java.lang.Object |
down(Event evt)
An event is to be sent down the stack.
|
java.lang.String |
dumpViews() |
long |
getMaxInterval() |
long |
getMinInterval() |
int |
getViews() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isInfoSenderRunning() |
protected boolean |
isMergeRunning() |
boolean |
isMergeTaskRunning() |
boolean |
isViewConsistencyCheckerRunning() |
static Buffer |
marshal(View view) |
protected View |
readView(byte[] buffer,
int offset,
int length) |
void |
sendInfo() |
void |
setMaxInterval(long val) |
void |
setMinInterval(long i) |
protected void |
startInfoSender() |
protected void |
startViewConsistencyChecker() |
void |
stop()
This method is called on a
Channel.disconnect() . |
protected void |
stopInfoSender() |
protected void |
stopViewConsistencyChecker() |
java.lang.Object |
up(Event evt)
An event was received from the layer below.
|
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, up
protected long min_interval
protected long max_interval
protected int max_participants_in_merge
protected long check_interval
protected Address local_addr
protected volatile View view
protected TimeScheduler timer
protected java.util.concurrent.Future<?> info_sender
protected java.util.concurrent.Future<?> view_consistency_checker
protected final ResponseCollector<View> view_rsps
protected boolean transport_supports_multicasting
protected java.lang.String cluster_name
protected volatile boolean is_coord
protected int num_merge_events
public int getViews()
public boolean isViewConsistencyCheckerRunning()
public boolean isMergeTaskRunning()
public boolean isInfoSenderRunning()
public java.lang.String dumpViews()
public void clearViews()
public void sendInfo()
public void checkInconsistencies()
public void init() throws java.lang.Exception
Protocol
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 long getMinInterval()
public void setMinInterval(long i)
public long getMaxInterval()
public void setMaxInterval(long val)
protected long computeCheckInterval()
protected boolean isMergeRunning()
protected void startInfoSender()
protected void stopInfoSender()
protected void startViewConsistencyChecker()
protected void stopViewConsistencyChecker()
public 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 static java.util.List<View> detectDifferentViews(java.util.Map<Address,View> map)
protected View readView(byte[] buffer, int offset, int length)
protected MERGE3.MergeHeader createInfo()
protected void addInfo(Address sender, ViewId view_id, java.lang.String logical_name, PhysicalAddress physical_addr)