Class ChannelFactory

java.lang.Object
org.infinispan.hotrod.impl.transport.netty.ChannelFactory

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

  • Constructor Details

    • ChannelFactory

      public ChannelFactory()
  • Method Details

    • start

      public void start(Codec codec, HotRodConfiguration configuration, org.infinispan.commons.marshall.Marshaller marshaller, ExecutorService executorService, ClientListenerNotifier listenerNotifier, MarshallerRegistry marshallerRegistry)
    • getMarshallerRegistry

      public MarshallerRegistry getMarshallerRegistry()
    • createChannelInitializer

      protected org.infinispan.hotrod.impl.transport.netty.ChannelInitializer createChannelInitializer(SocketAddress address, io.netty.bootstrap.Bootstrap bootstrap)
    • getCacheOperationsFactory

      protected CacheOperationsFactory getCacheOperationsFactory()
    • destroy

      public void destroy()
    • getCacheTopologyInfo

      public CacheTopologyInfo getCacheTopologyInfo(byte[] cacheName)
    • getPrimarySegmentsByAddress

      public Map<SocketAddress,Set<Integer>> getPrimarySegmentsByAddress(byte[] cacheName)
    • fetchChannelAndInvoke

      public <T extends ChannelOperation> T fetchChannelAndInvoke(Set<SocketAddress> failedServers, byte[] cacheName, T operation)
    • fetchChannelAndInvoke

      public <T extends ChannelOperation> T fetchChannelAndInvoke(Set<SocketAddress> failedServers, byte[] cacheName, T operation, boolean checkServer)
    • fetchChannelAndInvoke

      public <T extends ChannelOperation> T fetchChannelAndInvoke(SocketAddress server, T operation)
    • getHashAwareServer

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

      public <T extends ChannelOperation> T fetchChannelAndInvoke(Object key, Set<SocketAddress> failedServers, byte[] cacheName, T operation)
    • 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)
    • getServers

      public Collection<InetSocketAddress> getServers()
    • getServers

      public Collection<InetSocketAddress> getServers(byte[] cacheName)
    • getConsistentHash

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

      public ConsistentHashFactory getConsistentHashFactory()
    • isTcpNoDelay

      public boolean isTcpNoDelay()
    • isTcpKeepAlive

      public boolean isTcpKeepAlive()
    • getMaxRetries

      public int getMaxRetries()
    • createTopologyId

      public AtomicReference<ClientTopology> createTopologyId(byte[] cacheName)
    • 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)
    • getNumIdle

      public int getNumIdle(SocketAddress address)
    • getNumActive

      public int getNumActive()
    • getNumIdle

      public int getNumIdle()
    • getConfiguration

      public HotRodConfiguration getConfiguration()
    • getRetries

      public long getRetries()
    • incrementRetryCount

      public void incrementRetryCount()
    • getClientIntelligence

      public ClientIntelligence getClientIntelligence()