java.lang.Object
org.infinispan.client.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:
9.3
  • Field Details

  • Constructor Details

    • ChannelFactory

      public ChannelFactory(CodecHolder codecHolder)
  • Method Details

    • start

      public void start(Configuration configuration, org.infinispan.commons.marshall.Marshaller marshaller, ExecutorService executorService, ClientListenerNotifier listenerNotifier, MarshallerRegistry marshallerRegistry)
    • getNegotiatedCodec

      public Codec getNegotiatedCodec()
    • setNegotiatedCodec

      public void setNegotiatedCodec(Codec negotiatedCodec)
    • getMarshallerRegistry

      public MarshallerRegistry getMarshallerRegistry()
    • createChannelInitializer

      public org.infinispan.client.hotrod.impl.transport.netty.ChannelInitializer createChannelInitializer(SocketAddress address, io.netty.bootstrap.Bootstrap bootstrap)
    • createChannelPool

      protected org.infinispan.client.hotrod.impl.transport.netty.ChannelPool createChannelPool(io.netty.bootstrap.Bootstrap bootstrap, org.infinispan.client.hotrod.impl.transport.netty.ChannelInitializer channelInitializer, SocketAddress address)
    • getOperationsFactory

      protected final OperationsFactory getOperationsFactory()
    • 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(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.client.hotrod.impl.transport.netty.ChannelPool pool, org.infinispan.client.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 Configuration getConfiguration()
    • getRetries

      public long getRetries()
    • incrementRetryCount

      public void incrementRetryCount()
    • getClientIntelligence

      public ClientIntelligence getClientIntelligence()