Class ChannelFactory


  • @ThreadSafe
    public class ChannelFactory
    extends Object
    Central component providing connections to remote server. Most of the code originates in TcpTransportFactory.
    Since:
    14.0
    • Constructor Detail

      • ChannelFactory

        public ChannelFactory()
    • Method Detail

      • destroy

        public void destroy()
      • getCacheTopologyInfo

        public CacheTopologyInfo getCacheTopologyInfo​(byte[] cacheName)
      • getHashAwareServer

        public SocketAddress getHashAwareServer​(Object key,
                                                byte[] cacheName)
      • releaseChannel

        public void releaseChannel​(io.netty.channel.Channel channel)
      • receiveTopology

        public void receiveTopology​(byte[] cacheName,
                                    int responseTopologyAge,
                                    int responseTopologyId,
                                    InetSocketAddress[] addresses,
                                    SocketAddress[][] segmentOwners,
                                    short hashFunctionVersion)
      • updateCacheInfo

        protected void updateCacheInfo​(org.infinispan.commons.marshall.WrappedBytes cacheName,
                                       CacheInfo newCacheInfo,
                                       boolean quiet)
      • getConsistentHash

        public ConsistentHash getConsistentHash​(byte[] cacheName)
        Note that the returned ConsistentHash may not be thread-safe.
      • isTcpNoDelay

        public boolean isTcpNoDelay()
      • isTcpKeepAlive

        public boolean isTcpKeepAlive()
      • getMaxRetries

        public int getMaxRetries()
      • getTopologyId

        public int getTopologyId​(byte[] cacheName)
      • onConnectionEvent

        public void onConnectionEvent​(org.infinispan.hotrod.impl.transport.netty.ChannelPool pool,
                                      org.infinispan.hotrod.impl.transport.netty.ChannelPool.ChannelEventType type)
      • manualSwitchToCluster

        public boolean manualSwitchToCluster​(String clusterName)
        Switch to an alternate cluster (or from an alternate cluster back to the main cluster).

        Overrides any automatic cluster switch in progress, which may be useful when the automatic switch takes too long.

      • getMarshaller

        public org.infinispan.commons.marshall.Marshaller getMarshaller()
      • getCurrentClusterName

        public String getCurrentClusterName()
      • getTopologyAge

        public int getTopologyAge()
      • getBalancer

        public FailoverRequestBalancingStrategy getBalancer​(byte[] cacheName)
        Note that the returned RequestBalancingStrategy may not be thread-safe.
      • socketTimeout

        public int socketTimeout()
      • getNumActive

        public int getNumActive​(SocketAddress address)
      • getNumActive

        public int getNumActive()
      • getNumIdle

        public int getNumIdle()
      • getRetries

        public long getRetries()
      • incrementRetryCount

        public void incrementRetryCount()