Class ChannelFactory
java.lang.Object
org.infinispan.client.hotrod.impl.transport.netty.ChannelFactory
Central component providing connections to remote server. Most of the code originates in TcpTransportFactory.
- Since:
- 9.3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.infinispan.client.hotrod.impl.transport.netty.ChannelInitializer
createChannelInitializer
(SocketAddress address, io.netty.bootstrap.Bootstrap bootstrap) 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) createTopologyId
(byte[] cacheName) void
destroy()
<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) getBalancer
(byte[] cacheName) Note that the returnedRequestBalancingStrategy
may not be thread-safe.getCacheTopologyInfo
(byte[] cacheName) getConsistentHash
(byte[] cacheName) Note that the returnedConsistentHash
may not be thread-safe.getHashAwareServer
(Object key, byte[] cacheName) org.infinispan.commons.marshall.Marshaller
int
int
int
getNumActive
(SocketAddress address) int
int
getNumIdle
(SocketAddress address) protected final OperationsFactory
getPrimarySegmentsByAddress
(byte[] cacheName) long
getServers
(byte[] cacheName) int
int
getTopologyId
(byte[] cacheName) void
boolean
boolean
boolean
manualSwitchToCluster
(String clusterName) Switch to an alternate cluster (or from an alternate cluster back to the main cluster).void
onConnectionEvent
(org.infinispan.client.hotrod.impl.transport.netty.ChannelPool pool, org.infinispan.client.hotrod.impl.transport.netty.ChannelPool.ChannelEventType type) void
receiveTopology
(byte[] cacheName, int responseTopologyAge, int responseTopologyId, InetSocketAddress[] addresses, SocketAddress[][] segmentOwners, short hashFunctionVersion) void
releaseChannel
(io.netty.channel.Channel channel) void
setNegotiatedCodec
(Codec negotiatedCodec) int
void
start
(Configuration configuration, org.infinispan.commons.marshall.Marshaller marshaller, ExecutorService executorService, ClientListenerNotifier listenerNotifier, MarshallerRegistry marshallerRegistry) protected void
updateCacheInfo
(org.infinispan.commons.marshall.WrappedBytes cacheName, CacheInfo newCacheInfo, boolean quiet)
-
Field Details
-
DEFAULT_CLUSTER_NAME
- See Also:
-
-
Constructor Details
-
ChannelFactory
-
-
Method Details
-
start
public void start(Configuration configuration, org.infinispan.commons.marshall.Marshaller marshaller, ExecutorService executorService, ClientListenerNotifier listenerNotifier, MarshallerRegistry marshallerRegistry) -
getNegotiatedCodec
-
setNegotiatedCodec
-
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
-
destroy
public void destroy() -
getCacheTopologyInfo
-
getPrimarySegmentsByAddress
-
fetchChannelAndInvoke
public <T extends ChannelOperation> T fetchChannelAndInvoke(Set<SocketAddress> failedServers, byte[] cacheName, T operation) -
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, boolean quiet) -
getServers
-
getServers
-
getConsistentHash
Note that the returnedConsistentHash
may 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.client.hotrod.impl.transport.netty.ChannelPool pool, org.infinispan.client.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 returnedRequestBalancingStrategy
may 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
-