Class TPConfig

java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.TPConfig
All Implemented Interfaces:
Lifecycle
Direct Known Subclasses:
TP

public class TPConfig extends Protocol
Base class for TP which captures fields and accessors. Reduces the size of TP (https://issues.redhat.com/browse/JGRP-2592).
Since:
5.5.4
Author:
Bela Ban
  • Field Details

    • bind_addr

      protected InetAddress bind_addr
    • bind_port

      protected int bind_port
      The port to which the transport binds. 0 means to bind to any (ephemeral) port. See also port_range
    • port_range

      protected int port_range
    • external_addr

      protected InetAddress external_addr
    • external_port

      protected int external_port
    • receive_on_all_interfaces

      protected boolean receive_on_all_interfaces
    • receive_interfaces

      protected List<NetworkInterface> receive_interfaces
    • logical_addr_cache_max_size

      protected int logical_addr_cache_max_size
    • logical_addr_cache_expiration

      protected long logical_addr_cache_expiration
    • logical_addr_cache_reaper_interval

      protected long logical_addr_cache_reaper_interval
    • message_processing_policy

      protected String message_processing_policy
    • local_transport_class

      protected String local_transport_class
    • use_direct_memory

      protected boolean use_direct_memory
    • use_vthreads

      protected boolean use_vthreads
    • thread_naming_pattern

      protected String thread_naming_pattern
    • time_service_interval

      protected long time_service_interval
    • log_discard_msgs

      protected boolean log_discard_msgs
      Whether warnings about messages from different groups are logged - private flag, not for common use
    • log_discard_msgs_version

      protected boolean log_discard_msgs_version
    • who_has_cache_timeout

      protected long who_has_cache_timeout
    • suppress_time_different_version_warnings

      protected long suppress_time_different_version_warnings
    • suppress_time_different_cluster_warnings

      protected long suppress_time_different_cluster_warnings
    • bundler_type

      protected String bundler_type
    • timer_handle_non_blocking_tasks

      protected boolean timer_handle_non_blocking_tasks
    • cluster_name

      protected AsciiString cluster_name
    • is_trace

      protected boolean is_trace
    • local_physical_addr

      protected PhysicalAddress local_physical_addr
    • view

      protected volatile View view
    • members

      protected final Set<Address> members
    • connectLock

      protected final ReentrantLock connectLock
    • thread_factory

      protected ThreadFactory thread_factory
    • timer

      protected TimeScheduler timer
    • time_service

      protected TimeService time_service
    • socket_factory

      protected SocketFactory socket_factory
    • who_has_cache

      protected ExpiryCache<Address> who_has_cache
      Cache keeping track of WHO_HAS requests for physical addresses (given a logical address) and expiring them after who_has_cache_timeout ms
    • suppress_log_different_version

      protected SuppressLog<Address> suppress_log_different_version
      Log to suppress identical warnings for messages from members with different (incompatible) versions
    • suppress_log_different_cluster

      protected SuppressLog<Address> suppress_log_different_cluster
      Log to suppress identical warnings for messages from members in different clusters
    • last_discovery_request

      protected long last_discovery_request
    • logical_addr_cache

      protected LazyRemovalCache<Address, PhysicalAddress> logical_addr_cache
      Maintains mappings between logical and physical addresses. When sending a message to a logical address, we look up the physical address from logical_addr_cache and send the message to the physical address
      The keys are logical addresses, the values physical addresses
    • logical_addr_cache_reaper

      protected Future<?> logical_addr_cache_reaper
    • msg_stats

      protected MsgStats msg_stats
    • bundler

      protected Bundler bundler
    • thread_pool

      protected ThreadPool thread_pool
    • async_executor

      protected AsyncExecutor<Object> async_executor
    • msg_processing_policy

      protected MessageProcessingPolicy msg_processing_policy
    • local_transport

      protected LocalTransport local_transport
    • diag_handler

      protected DiagnosticsHandler diag_handler
    • rtt

      protected RTT rtt
  • Constructor Details

    • TPConfig

      public TPConfig()
  • Method Details

    • getBindAddr

      public InetAddress getBindAddr()
    • setBindAddr

      public <T extends TP> T setBindAddr(InetAddress b)
    • getBindAddress

      public InetAddress getBindAddress()
    • setBindAddress

      public <T extends TP> T setBindAddress(InetAddress a)
    • getBindPort

      public int getBindPort()
    • setBindPort

      public <T extends TP> T setBindPort(int port)
    • setPortRange

      public <T extends TP> T setPortRange(int range)
    • getPortRange

      public int getPortRange()
    • getExternalAddr

      public InetAddress getExternalAddr()
    • setExternalAddr

      public <T extends TP> T setExternalAddr(InetAddress e)
    • getExternalPort

      public int getExternalPort()
    • setExternalPort

      public <T extends TP> T setExternalPort(int e)
    • receiveOnAllInterfaces

      public boolean receiveOnAllInterfaces()
    • receiveOnAllInterfaces

      public <T extends TP> T receiveOnAllInterfaces(boolean r)
    • setBindToAllInterfaces

      public <T extends TP> T setBindToAllInterfaces(boolean f)
    • isReceiveOnAllInterfaces

      public boolean isReceiveOnAllInterfaces()
    • getReceiveInterfaces

      public List<NetworkInterface> getReceiveInterfaces()
    • getLogicalAddrCacheMaxSize

      public int getLogicalAddrCacheMaxSize()
    • setLogicalAddrCacheMaxSize

      public <T extends TP> T setLogicalAddrCacheMaxSize(int l)
    • getLogicalAddrCacheExpiration

      public long getLogicalAddrCacheExpiration()
    • setLogicalAddrCacheExpiration

      public <T extends TP> T setLogicalAddrCacheExpiration(long l)
    • getLogicalAddrCacheReaperInterval

      public long getLogicalAddrCacheReaperInterval()
    • setLogicalAddrCacheReaperInterval

      public <T extends TP> T setLogicalAddrCacheReaperInterval(long l)
    • useDirectMemory

      public boolean useDirectMemory()
    • useDirectMemory

      public <T extends TP> T useDirectMemory(boolean b)
    • useVirtualThreads

      public <T extends TP> T useVirtualThreads(boolean f)
    • useVirtualThreads

      public boolean useVirtualThreads()
    • getThreadNamingPattern

      public String getThreadNamingPattern()
    • threadNamingPattern

      public <T extends TP> T threadNamingPattern(String p)
    • getTimeServiceInterval

      public long getTimeServiceInterval()
    • setTimeServiceInterval

      public <T extends TP> T setTimeServiceInterval(long t)
    • logDiscardMsgs

      public boolean logDiscardMsgs()
    • logDiscardMsgs

      public <T extends TP> T logDiscardMsgs(boolean l)
    • logDiscardMsgsVersion

      public boolean logDiscardMsgsVersion()
    • logDiscardMsgsVersion

      public <T extends TP> T logDiscardMsgsVersion(boolean l)
    • setLogDiscardMessages

      public <T extends TP> T setLogDiscardMessages(boolean f)
    • getLogDiscardMessages

      public boolean getLogDiscardMessages()
    • setLogDiscardMessagesVersion

      public <T extends TP> T setLogDiscardMessagesVersion(boolean f)
    • getLogDiscardMessagesVersion

      public boolean getLogDiscardMessagesVersion()
    • getWhoHasCacheTimeout

      public long getWhoHasCacheTimeout()
    • setWhoHasCacheTimeout

      public <T extends TP> T setWhoHasCacheTimeout(long w)
    • getSuppressTimeDifferentVersionWarnings

      public long getSuppressTimeDifferentVersionWarnings()
    • setSuppressTimeDifferentVersionWarnings

      public <T extends TP> T setSuppressTimeDifferentVersionWarnings(long s)
    • getSuppressTimeDifferentClusterWarnings

      public long getSuppressTimeDifferentClusterWarnings()
    • setSuppressTimeDifferentClusterWarnings

      public <T extends TP> T setSuppressTimeDifferentClusterWarnings(long s)
    • getBundlerType

      public String getBundlerType()
    • setBundlerType

      public <T extends TP> T setBundlerType(String b)
    • isTrace

      public boolean isTrace()
    • isTrace

      public <T extends TP> T isTrace(boolean i)
    • getMessageStats

      public MsgStats getMessageStats()
    • setMessageStats

      public <T extends TP> T setMessageStats(MsgStats ms)
    • enableStats

      public void enableStats(boolean flag)
      Overrides:
      enableStats in class Protocol
    • localPhysicalAddress

      public PhysicalAddress localPhysicalAddress()
    • getLocalPhysicalAddress

      public String getLocalPhysicalAddress()
    • view

      public View view()
    • getThreadPool

      public ThreadPool getThreadPool()
    • getAsyncExecutor

      public AsyncExecutor<Object> getAsyncExecutor()
    • setAsyncExecutor

      public <T extends TP> T setAsyncExecutor(AsyncExecutor<Object> e)
    • getThreadFactory

      public ThreadFactory getThreadFactory()
      Description copied from class: Protocol
      Supposed to be overwritten by subclasses. Usually the transport returns a valid non-null thread factory, but thread factories can also be created by individual protocols
      Overrides:
      getThreadFactory in class Protocol
      Returns:
    • getTimer

      public TimeScheduler getTimer()
    • getNumTimerTasks

      public int getNumTimerTasks()
    • getTimerThreads

      public int getTimerThreads()
    • dumpTimerTasks

      public String dumpTimerTasks()
    • getTimerClass

      public String getTimerClass()
    • removeCancelledTimerTasks

      public void removeCancelledTimerTasks()
    • getTimeService

      public TimeService getTimeService()
    • timestamp

      public long timestamp()
    • getSocketFactory

      public SocketFactory getSocketFactory()
      Description copied from class: Protocol
      Returns the SocketFactory associated with this protocol, if overridden in a subclass, or passes the call down
      Overrides:
      getSocketFactory in class Protocol
      Returns:
      SocketFactory
    • setSocketFactory

      public void setSocketFactory(SocketFactory f)
      Description copied from class: Protocol
      Sets a SocketFactory. Socket factories are typically provided by the transport (TP)
      Overrides:
      setSocketFactory in class Protocol
      Parameters:
      f -
    • getBundler

      public Bundler getBundler()
    • getBundlerClass

      public String getBundlerClass()
    • clusterName

      public String clusterName()
    • getClusterName

      public String getClusterName()
    • getClusterNameAscii

      public AsciiString getClusterNameAscii()
    • getMessageProcessingPolicy

      public MessageProcessingPolicy getMessageProcessingPolicy()
    • msgProcessingPolicy

      public MessageProcessingPolicy msgProcessingPolicy()
    • msgProcessingPolicy

      public <T extends TP> T msgProcessingPolicy(MessageProcessingPolicy p)
    • getLocalTransport

      public LocalTransport getLocalTransport()
    • getDiagnosticsHandler

      public DiagnosticsHandler getDiagnosticsHandler()
    • getRTT

      public RTT getRTT()
    • printWhoHasCache

      public String printWhoHasCache()
    • getLogicalAddressCache

      public LazyRemovalCache<Address, PhysicalAddress> getLogicalAddressCache()
    • printLogicalAddressCache

      public String printLogicalAddressCache()
    • getNumThreads

      public static int getNumThreads()
    • setThreadPool

      public <T extends TP> T setThreadPool(Executor thread_pool)
    • setThreadFactory

      public <T extends TP> T setThreadFactory(ThreadFactory factory)
    • setTimer

      public <T extends TP> T setTimer(TimeScheduler timer)
      Sets a new timer. This should be done before the transport is initialized; be very careful, as replacing a running timer with tasks in it can wreak havoc !
      Parameters:
      timer -
    • setTimeService

      public <T extends TP> T setTimeService(TimeService ts)
    • setBundler

      public <T extends TP> T setBundler(Bundler new_bundler)
    • bundler

      public <T extends TP> T bundler(String type) throws Exception
      Throws:
      Exception
    • createBundler

      public static Bundler createBundler(String type, Class<?> cl) throws Exception
      Throws:
      Exception
    • setMessageProcessingPolicy

      public <T extends TP> T setMessageProcessingPolicy(String policy)
    • setLocalTransport

      public <T extends TP> T setLocalTransport(LocalTransport l)
    • setLocalTransport

      public <T extends TP> T setLocalTransport(String tp_class) throws Exception
      Throws:
      Exception
    • setDiagnosticsHandler

      public <T extends TP> T setDiagnosticsHandler(DiagnosticsHandler handler) throws Exception
      Sets a DiagnosticsHandler. Should be set before the stack is started
      Throws:
      Exception
    • createDiagnosticsHandler

      public DiagnosticsHandler createDiagnosticsHandler()
    • registerProbeHandler

      public <T extends TP> T registerProbeHandler(DiagnosticsHandler.ProbeHandler handler)
    • unregisterProbeHandler

      public <T extends TP> T unregisterProbeHandler(DiagnosticsHandler.ProbeHandler handler)
    • unregisterProbeHandler

      public <T extends TP> T unregisterProbeHandler(Class<? extends DiagnosticsHandler.ProbeHandler> cl)
    • setLevel

      public <T extends Protocol> T setLevel(String level)
      Description copied from class: Protocol
      Sets the level of a logger. This method is used to dynamically change the logging level of a running system, e.g. via JMX. The appender of a level needs to exist.
      Overrides:
      setLevel in class Protocol
      Parameters:
      level - The new level. Valid values are "fatal", "error", "warn", "info", "debug", "trace" (capitalization not relevant)
    • loggerType

      public static String loggerType()
    • enableAllStats

      public void enableAllStats(boolean flag)
    • resetStats

      public void resetStats()
      Overrides:
      resetStats in class Protocol
    • isLogicalAddressCacheReaperRunning

      public boolean isLogicalAddressCacheReaperRunning()
    • enableBlockingTimerTasks

      public <T extends TP> T enableBlockingTimerTasks(boolean flag)
    • getDifferentClusterMessages

      public int getDifferentClusterMessages()
    • getDifferentVersionMessages

      public int getDifferentVersionMessages()
    • clearDifferentClusterCache

      public <T extends TP> T clearDifferentClusterCache()
    • clearDifferentVersionCache

      public <T extends TP> T clearDifferentVersionCache()
    • defaultHeaders

      public String defaultHeaders(boolean detailed)
    • sameCluster

      protected boolean sameCluster(String req)
    • getNumRejectedMsgs

      @Deprecated public long getNumRejectedMsgs()
      Deprecated.
      Don't remove! https://issues.redhat.com/browse/JGRP-2814
    • getNumberOfThreadDumps

      @Deprecated public static long getNumberOfThreadDumps()
      Deprecated.
      Don't remove! https://issues.redhat.com/browse/JGRP-2814
    • getNumUcastMsgsSent

      @Deprecated public long getNumUcastMsgsSent()
      Deprecated.
      Don't remove! https://issues.redhat.com/browse/JGRP-2814
    • getNumMcastMsgsSent

      @Deprecated public long getNumMcastMsgsSent()
      Deprecated.
      Don't remove! https://issues.redhat.com/browse/JGRP-2814
    • getNumUcastMsgsReceived

      @Deprecated public long getNumUcastMsgsReceived()
      Deprecated.
      Don't remove! https://issues.redhat.com/browse/JGRP-2814
    • getNumMcastMsgsReceived

      @Deprecated public long getNumMcastMsgsReceived()
      Deprecated.
      Don't remove! https://issues.redhat.com/browse/JGRP-2814