Package org.jgroups.protocols.relay
Class RELAY2
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.relay.RELAY
org.jgroups.protocols.relay.RELAY2
- All Implemented Interfaces:
Lifecycle
Design: ./doc/design/RELAY2.txt and at https://github.com/belaban/JGroups/blob/master/doc/design/RELAY2.txt.
JIRA: https://issues.redhat.com/browse/JGRP-1433
- Since:
- 3.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected final ResponseCollector<String> protected longFields inherited from class org.jgroups.protocols.relay.RELAY
async_relay_creation, broadcast_route_notifications, can_become_site_master, can_become_site_master_flag, config, delay_sites_down, forward_sm_time, forward_to_local_mbr, forward_to_local_mbr_time, forward_to_site_master, is_site_master, max_site_masters, members, prots_above, relayed, relayed_time, relayer, route_status_listener, site, site_config, site_master_listener, site_master_picker, site_master_picker_impl, site_masters, site_masters_ratio, sites, suppress_log_no_route, suppress_time_no_route_errors, timer, topo, viewFields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_printTopology(Relayer rel) booleancanForwardLocalCluster(boolean c) voidprotected voidprotected voiddeliverLocally(SiteAddress dest, SiteAddress sender, Message msg) A message is sent down the stack.booleanenableAddressTagging(boolean flag) protected Stringprotected voidforwardTo(Address next_dest, SiteAddress final_dest, Address original_sender, Message msg, boolean forward_to_current_coord) longprotected booleanhandleAdminMessage(RelayHeader hdr, Address sender) Handles SITES_UP/SITES_DOWN/TOPO_REQ/TOPO_RSP messagesprotected voidhandleMessage(RelayHeader hdr, Message msg) Called to handle a message received by the transportprotected voidCalled to handle a message received by the relayervoidhandleView(View view) printTopology(boolean all_sites) booleanrelayMulticasts(boolean flag) protected voidroute(SiteAddress dest, SiteAddress sender, Message msg) Routes the message to the target destination, used by a site master (coordinator)protected voidsendSiteUnreachableTo(Address src, String target_site) Sends a SITE-UNREACHABLE message to the sender of the message.protected voidsendToBridges(Address sender, Message msg, String... excluded_sites) Sends the message via all bridges excluding the excluded_sites bridgesprotected booleansendTopoReq(JChannel bridge, Address dest) setTopoWaitTime(long t) protected voidstartRelayer(Relayer2 rel, String bridge_name) A single message was received.voidup(MessageBatch batch) Sends up a multiple messages in aMessageBatch.Methods inherited from class org.jgroups.protocols.relay.RELAY
addSite, addToRelayedTime, asyncRelayCreation, asyncRelayCreation, broadcastRouteNotifications, broadcastRouteNotifications, canBecomeSiteMaster, canBecomeSiteMaster, clearNoRouteCache, config, config, copy, delaySitesDown, delaySitesDown, determineSiteMasters, down, getAvgMsgsForwardingToLocalMbr, getAvgMsgsForwardingToSM, getAvgMsgsRelaying, getBridge, getBridgeView, getConfig, getCurrentSites, getMaxSiteMasters, getNumberOfNoRouteErrors, getNumForwardedToLocalMbr, getNumForwardedToSiteMaster, getNumRelayed, getNumRoutes, getPhysicalAddress, getRoute, getRouteStatusListener, getSite, getSiteMasterPickerImpl, getSiteMastersRatio, getSites, getTimeForwardingToLocalMbr, getTimeForwardingToSM, getTimer, getTimeRelaying, incrementRelayed, init, isLocal, isLocalSitemaster, isSiteMaster, members, notifySiteMasterListener, parse, parseSiteConfiguration, pickSiteMaster, printRoutes, printSites, resetStats, setConfig, setMaxSiteMasters, setRouteStatusListener, setSite, setSiteMasterListener, setSiteMasterPickerImpl, setSiteMastersRatio, site, site, siteMasterPicker, siteMasters, siteNames, sitesChange, stop, topo, triggerMemberUnreachableEvent, triggerSiteUnreachableEvent, up, viewMethods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, toString
-
Field Details
-
enable_address_tagging
protected boolean enable_address_tagging -
relay_multicasts
protected boolean relay_multicasts -
can_forward_local_cluster
protected boolean can_forward_local_cluster -
topo_wait_time
protected long topo_wait_time -
topo_collector
-
-
Constructor Details
-
RELAY2
public RELAY2()
-
-
Method Details
-
enableAddressTagging
-
relayMulticasts
-
enableAddressTagging
public boolean enableAddressTagging() -
relayMulticasts
public boolean relayMulticasts() -
canForwardLocalCluster
public boolean canForwardLocalCluster() -
canForwardLocalCluster
-
getTopoWaitTime
public long getTopoWaitTime() -
setTopoWaitTime
-
configure
-
printTopology
-
printLocalTopology
-
down
Description copied from class:ProtocolA message is sent down the stack. Protocols may examine the message and do something (e.g. add a header) with it, before passing it down. -
up
Description copied from class:ProtocolA single message was received. Protocols may examine the message and do something (e.g. add a header) with it before passing it up. -
up
Description copied from class:ProtocolSends up a multiple messages in aMessageBatch. 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 - callsProtocol.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.iterator(Predicate)), 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. -
handleView
- Specified by:
handleViewin classRELAY
-
handleRelayMessage
Called to handle a message received by the relayer- Specified by:
handleRelayMessagein classRELAY
-
handleAdminMessage
Handles SITES_UP/SITES_DOWN/TOPO_REQ/TOPO_RSP messages -
handleMessage
Called to handle a message received by the transport -
route
Routes the message to the target destination, used by a site master (coordinator)- Parameters:
dest- the destination site addresssender- the address of the sendermsg- The message
-
sendToBridges
Sends the message via all bridges excluding the excluded_sites bridges -
sendSiteUnreachableTo
Sends a SITE-UNREACHABLE message to the sender of the message. Because the sender is always local (we're the relayer), no routing needs to be done- Parameters:
src- The node who is trying to send a message to thetarget_sitetarget_site- The remote site's name.
-
forwardTo
protected void forwardTo(Address next_dest, SiteAddress final_dest, Address original_sender, Message msg, boolean forward_to_current_coord) -
deliverLocally
-
deliver
-
startRelayer
-
_printTopology
-
sendTopoReq
-
fetchTopoFromSiteMaster
-