Class ChannelFactory
java.lang.Object
org.infinispan.hotrod.impl.transport.netty.ChannelFactory
Central component providing connections to remote server. Most of the code originates in TcpTransportFactory.
- Since:
- 14.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.infinispan.hotrod.impl.transport.netty.ChannelInitializercreateChannelInitializer(SocketAddress address, io.netty.bootstrap.Bootstrap bootstrap) createTopologyId(byte[] cacheName) voiddestroy()<T extends ChannelOperation>
TfetchChannelAndInvoke(Object key, Set<SocketAddress> failedServers, byte[] cacheName, T operation) <T extends ChannelOperation>
TfetchChannelAndInvoke(SocketAddress server, T operation) <T extends ChannelOperation>
TfetchChannelAndInvoke(Set<SocketAddress> failedServers, byte[] cacheName, T operation) <T extends ChannelOperation>
TfetchChannelAndInvoke(Set<SocketAddress> failedServers, byte[] cacheName, T operation, boolean checkServer) getBalancer(byte[] cacheName) Note that the returnedRequestBalancingStrategymay not be thread-safe.getCacheTopologyInfo(byte[] cacheName) getConsistentHash(byte[] cacheName) Note that the returnedConsistentHashmay not be thread-safe.getHashAwareServer(Object key, byte[] cacheName) org.infinispan.commons.marshall.MarshallerintintintgetNumActive(SocketAddress address) intintgetNumIdle(SocketAddress address) getPrimarySegmentsByAddress(byte[] cacheName) longgetServers(byte[] cacheName) intintgetTopologyId(byte[] cacheName) voidbooleanbooleanbooleanmanualSwitchToCluster(String clusterName) Switch to an alternate cluster (or from an alternate cluster back to the main cluster).voidonConnectionEvent(org.infinispan.hotrod.impl.transport.netty.ChannelPool pool, org.infinispan.hotrod.impl.transport.netty.ChannelPool.ChannelEventType type) voidreceiveTopology(byte[] cacheName, int responseTopologyAge, int responseTopologyId, InetSocketAddress[] addresses, SocketAddress[][] segmentOwners, short hashFunctionVersion) voidreleaseChannel(io.netty.channel.Channel channel) intvoidstart(Codec codec, HotRodConfiguration configuration, org.infinispan.commons.marshall.Marshaller marshaller, ExecutorService executorService, ClientListenerNotifier listenerNotifier, MarshallerRegistry marshallerRegistry) protected voidupdateCacheInfo(org.infinispan.commons.marshall.WrappedBytes cacheName, CacheInfo newCacheInfo)
-
Field Details
-
DEFAULT_CLUSTER_NAME
- See Also:
-
topologyInfo
-
-
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
-
createChannelInitializer
protected org.infinispan.hotrod.impl.transport.netty.ChannelInitializer createChannelInitializer(SocketAddress address, io.netty.bootstrap.Bootstrap bootstrap) -
getCacheOperationsFactory
-
destroy
public void destroy() -
getCacheTopologyInfo
-
getPrimarySegmentsByAddress
-
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
-
getHashAwareServer
-
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) -
getServers
-
getServers
-
getConsistentHash
Note that the returnedConsistentHashmay not be thread-safe. -
getConsistentHashFactory
-
isTcpNoDelay
public boolean isTcpNoDelay() -
isTcpKeepAlive
public boolean isTcpKeepAlive() -
getMaxRetries
public int getMaxRetries() -
createTopologyId
-
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
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
-
getTopologyAge
public int getTopologyAge() -
getBalancer
Note that the returnedRequestBalancingStrategymay not be thread-safe. -
socketTimeout
public int socketTimeout() -
getNumActive
-
getNumIdle
-
getNumActive
public int getNumActive() -
getNumIdle
public int getNumIdle() -
getConfiguration
-
getRetries
public long getRetries() -
incrementRetryCount
public void incrementRetryCount() -
getClientIntelligence
-