org.jgroups.protocols
Class TCPPING

java.lang.Object
  extended by org.jgroups.stack.Protocol
      extended by org.jgroups.protocols.Discovery
          extended by org.jgroups.protocols.TCPPING

public class TCPPING
extends Discovery

The TCPPING protocol defines a static cluster membership. The cluster members are retrieved by directly contacting the members listed in initial_hosts, sending point-to-point discovery requests.

The TCPPING protocol defines a static configuration, which requires that you to know in advance where to find all of the members of your cluster.

Author:
Bela Ban

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.Responses
 
Field Summary
protected  BoundedList<PhysicalAddress> dynamic_hosts
          https://jira.jboss.org/jira/browse/JGRP-989
protected  int max_dynamic_hosts
           
 
Fields inherited from class org.jgroups.protocols.Discovery
break_on_coord_rsp, current_coord, force_sending_discovery_rsps, group_addr, is_coord, is_leaving, is_server, local_addr, members, num_discovery_requests, num_initial_members, num_initial_srv_members, ping_responses, return_entire_cache, stagger_timeout, timeout, timer, use_disk_cache, view
 
Fields inherited from class org.jgroups.stack.Protocol
down_prot, ergonomics, id, log, name, stack, stats, up_prot
 
Constructor Summary
TCPPING()
           
 
Method Summary
 void clearDynamicHostList()
           
 void discoveryRequestReceived(Address sender, java.lang.String logical_name, java.util.Collection<PhysicalAddress> physical_addrs)
           
 java.lang.Object down(Event evt)
          An event is to be sent down the stack.
 java.util.Collection<PhysicalAddress> fetchClusterMembers(java.lang.String cluster_name)
          Grab all current cluster members
 java.lang.String getDynamicHostList()
           
 java.util.List<IpAddress> getInitialHosts()
          Returns the list of initial hosts as configured by the user via XML.
 java.lang.String getInitialHostsList()
           
 int getPortRange()
           
 boolean isDynamic()
           
 boolean sendDiscoveryRequestsInParallel()
          Whether or not to send each discovery request on a separate (timer) thread.
 void setInitialHosts(java.util.List<IpAddress> initial_hosts)
           
 void setPortRange(int port_range)
           
 
Methods inherited from class org.jgroups.protocols.Discovery
deserialize, findAllViews, findAllViewsAsString, findInitialMembers, findInitialMembersAsString, findMembers, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getTimeout, getView, getViewId, handleConnect, handleDisconnect, init, isMergeRunning, providedUpServices, resetStats, sendDiscoveryRequest, sendDiscoveryResponse, sendMcastDiscoveryRequest, serializeWithoutView, setForceSendingDiscoveryRsps, setNumInitialMembers, setTimeout, start, stop, up
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, printStats, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

max_dynamic_hosts

protected int max_dynamic_hosts

dynamic_hosts

protected final BoundedList<PhysicalAddress> dynamic_hosts
https://jira.jboss.org/jira/browse/JGRP-989

Constructor Detail

TCPPING

public TCPPING()
Method Detail

isDynamic

public boolean isDynamic()
Specified by:
isDynamic in class Discovery

getInitialHosts

public java.util.List<IpAddress> getInitialHosts()
Returns the list of initial hosts as configured by the user via XML. Note that the returned list is mutable, so careful with changes !

Returns:
List
list of initial hosts. This variable is only set after the channel has been created and set Properties() has been called

setInitialHosts

public void setInitialHosts(java.util.List<IpAddress> initial_hosts)

getPortRange

public int getPortRange()

setPortRange

public void setPortRange(int port_range)

getDynamicHostList

public java.lang.String getDynamicHostList()

clearDynamicHostList

public void clearDynamicHostList()

getInitialHostsList

public java.lang.String getInitialHostsList()

fetchClusterMembers

public java.util.Collection<PhysicalAddress> fetchClusterMembers(java.lang.String cluster_name)
Description copied from class: Discovery
Grab all current cluster members

Specified by:
fetchClusterMembers in class Discovery
Returns:
A list of the cluster members (usually IpAddresses), or null if the transport is multicast-enabled. Returns an empty list if no cluster members could be found.

sendDiscoveryRequestsInParallel

public boolean sendDiscoveryRequestsInParallel()
Description copied from class: Discovery
Whether or not to send each discovery request on a separate (timer) thread. If disabled, a discovery request will be sent to all members fetched by Discovery.fetchClusterMembers(String) sequentially

Specified by:
sendDiscoveryRequestsInParallel in class Discovery

down

public java.lang.Object down(Event evt)
Description copied from class: Discovery
An event is to be sent down the stack. The layer may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the layer may need to add a header to it (or do nothing at all) before sending it down the stack using PassDown. 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(). The PING protocol is interested in several different down events, Event.FIND_INITIAL_MBRS - sent by the GMS layer and expecting a GET_MBRS_OK Event.TMP_VIEW and Event.VIEW_CHANGE - a view change event Event.BECOME_SERVER - called after client has joined and is fully working group member Event.CONNECT, Event.DISCONNECT.

Overrides:
down in class Discovery

discoveryRequestReceived

public void discoveryRequestReceived(Address sender,
                                     java.lang.String logical_name,
                                     java.util.Collection<PhysicalAddress> physical_addrs)
Overrides:
discoveryRequestReceived in class Discovery


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.