@ThreadSafe public class TcpTransportFactory extends Object implements TransportFactory
Modifier and Type | Class and Description |
---|---|
static class |
TcpTransportFactory.ClusterSwitchStatus |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CLUSTER_NAME |
Constructor and Description |
---|
TcpTransportFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkServersAlive(Collection<SocketAddress> servers) |
AtomicInteger |
createTopologyId(byte[] cacheName) |
void |
destroy() |
Transport |
getAddressTransport(SocketAddress server) |
RequestBalancingStrategy |
getBalancer(byte[] cacheName)
Note that the returned
RequestBalancingStrategy may not be thread-safe. |
CacheTopologyInfo |
getCacheTopologyInfo(byte[] cacheName) |
org.apache.commons.pool.impl.GenericKeyedObjectPool<SocketAddress,TcpTransport> |
getConnectionPool() |
int |
getConnectTimeout() |
ConsistentHash |
getConsistentHash(byte[] cacheName)
Note that the returned
ConsistentHash may not be thread-safe. |
ConsistentHashFactory |
getConsistentHashFactory() |
String |
getCurrentClusterName() |
Marshaller |
getMarshaller() |
int |
getMaxRetries() |
Collection<SocketAddress> |
getServers() |
SocketAddress |
getSocketAddress(Object key,
byte[] cacheName) |
int |
getSoTimeout() |
SSLContext |
getSSLContext() |
int |
getTopologyAge() |
int |
getTopologyId(byte[] cacheName) |
Transport |
getTransport(Object key,
Set<SocketAddress> failedServers,
byte[] cacheName) |
Transport |
getTransport(Set<SocketAddress> failedServers,
byte[] cacheName) |
void |
invalidateTransport(SocketAddress serverAddress,
Transport transport) |
boolean |
isTcpKeepAlive() |
boolean |
isTcpNoDelay() |
void |
releaseTransport(Transport transport) |
void |
reset(byte[] cacheName) |
void |
start(Codec codec,
Configuration configuration,
AtomicInteger defaultCacheTopologyId,
ClientListenerNotifier listenerNotifier) |
boolean |
switchToCluster(String clusterName) |
TcpTransportFactory.ClusterSwitchStatus |
trySwitchCluster(String failedClusterName,
byte[] cacheName) |
void |
updateHashFunction(Map<SocketAddress,Set<Integer>> servers2Hash,
int numKeyOwners,
short hashFunctionVersion,
int hashSpace,
byte[] cacheName,
AtomicInteger topologyId) |
void |
updateHashFunction(SocketAddress[][] segmentOwners,
int numSegments,
short hashFunctionVersion,
byte[] cacheName,
AtomicInteger topologyId) |
void |
updateServers(Collection<SocketAddress> newServers,
byte[] cacheName,
boolean quiet) |
public static final String DEFAULT_CLUSTER_NAME
public void start(Codec codec, Configuration configuration, AtomicInteger defaultCacheTopologyId, ClientListenerNotifier listenerNotifier)
start
in interface TransportFactory
public void destroy()
destroy
in interface TransportFactory
public CacheTopologyInfo getCacheTopologyInfo(byte[] cacheName)
getCacheTopologyInfo
in interface TransportFactory
public void updateHashFunction(Map<SocketAddress,Set<Integer>> servers2Hash, int numKeyOwners, short hashFunctionVersion, int hashSpace, byte[] cacheName, AtomicInteger topologyId)
updateHashFunction
in interface TransportFactory
public void updateHashFunction(SocketAddress[][] segmentOwners, int numSegments, short hashFunctionVersion, byte[] cacheName, AtomicInteger topologyId)
updateHashFunction
in interface TransportFactory
public Transport getTransport(Set<SocketAddress> failedServers, byte[] cacheName)
getTransport
in interface TransportFactory
public Transport getAddressTransport(SocketAddress server)
getAddressTransport
in interface TransportFactory
public SocketAddress getSocketAddress(Object key, byte[] cacheName)
getSocketAddress
in interface TransportFactory
public Transport getTransport(Object key, Set<SocketAddress> failedServers, byte[] cacheName)
getTransport
in interface TransportFactory
public void releaseTransport(Transport transport)
releaseTransport
in interface TransportFactory
public void invalidateTransport(SocketAddress serverAddress, Transport transport)
invalidateTransport
in interface TransportFactory
public void updateServers(Collection<SocketAddress> newServers, byte[] cacheName, boolean quiet)
updateServers
in interface TransportFactory
public Collection<SocketAddress> getServers()
public ConsistentHash getConsistentHash(byte[] cacheName)
ConsistentHash
may not be thread-safe.getConsistentHash
in interface TransportFactory
public ConsistentHashFactory getConsistentHashFactory()
getConsistentHashFactory
in interface TransportFactory
public boolean isTcpNoDelay()
isTcpNoDelay
in interface TransportFactory
public boolean isTcpKeepAlive()
isTcpKeepAlive
in interface TransportFactory
public int getMaxRetries()
getMaxRetries
in interface TransportFactory
public int getSoTimeout()
getSoTimeout
in interface TransportFactory
public int getConnectTimeout()
getConnectTimeout
in interface TransportFactory
public SSLContext getSSLContext()
getSSLContext
in interface TransportFactory
public void reset(byte[] cacheName)
reset
in interface TransportFactory
public AtomicInteger createTopologyId(byte[] cacheName)
createTopologyId
in interface TransportFactory
public int getTopologyId(byte[] cacheName)
getTopologyId
in interface TransportFactory
public TcpTransportFactory.ClusterSwitchStatus trySwitchCluster(String failedClusterName, byte[] cacheName)
trySwitchCluster
in interface TransportFactory
public boolean checkServersAlive(Collection<SocketAddress> servers)
public Marshaller getMarshaller()
getMarshaller
in interface TransportFactory
public boolean switchToCluster(String clusterName)
switchToCluster
in interface TransportFactory
public String getCurrentClusterName()
getCurrentClusterName
in interface TransportFactory
public int getTopologyAge()
getTopologyAge
in interface TransportFactory
public RequestBalancingStrategy getBalancer(byte[] cacheName)
RequestBalancingStrategy
may not be thread-safe.public org.apache.commons.pool.impl.GenericKeyedObjectPool<SocketAddress,TcpTransport> getConnectionPool()
Copyright © 2022 JBoss, a division of Red Hat. All rights reserved.