@ThreadSafe public class ChannelFactory extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ChannelFactory.ClusterSwitchStatus |
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CLUSTER_NAME |
| Constructor and Description |
|---|
ChannelFactory() |
| Modifier and Type | Method and Description |
|---|---|
AtomicInteger |
createTopologyId(byte[] cacheName) |
void |
destroy() |
<T extends ChannelOperation> |
fetchChannelAndInvoke(Object key,
Set<SocketAddress> failedServers,
byte[] cacheName,
T operation) |
<T extends ChannelOperation> |
fetchChannelAndInvoke(Set<SocketAddress> failedServers,
byte[] cacheName,
T operation) |
<T extends ChannelOperation> |
fetchChannelAndInvoke(SocketAddress server,
T operation) |
FailoverRequestBalancingStrategy |
getBalancer(byte[] cacheName)
Note that the returned
RequestBalancingStrategy may not be thread-safe. |
CacheTopologyInfo |
getCacheTopologyInfo(byte[] cacheName) |
Configuration |
getConfiguration() |
ConsistentHash |
getConsistentHash(byte[] cacheName)
Note that the returned
ConsistentHash may not be thread-safe. |
ConsistentHashFactory |
getConsistentHashFactory() |
String |
getCurrentClusterName() |
Marshaller |
getMarshaller() |
MarshallerRegistry |
getMarshallerRegistry() |
int |
getMaxRetries() |
int |
getNumActive() |
int |
getNumActive(SocketAddress address) |
int |
getNumIdle() |
int |
getNumIdle(SocketAddress address) |
Map<SocketAddress,Set<Integer>> |
getPrimarySegmentsByAddress(byte[] cacheName) |
long |
getRetries() |
Collection<SocketAddress> |
getServers() |
SocketAddress |
getSocketAddress(Object key,
byte[] cacheName) |
int |
getTopologyAge() |
int |
getTopologyId(byte[] cacheName) |
void |
incrementRetryCount() |
boolean |
isTcpKeepAlive() |
boolean |
isTcpNoDelay() |
void |
releaseChannel(io.netty.channel.Channel channel) |
void |
reset(byte[] cacheName) |
int |
socketTimeout() |
void |
start(Codec codec,
Configuration configuration,
AtomicInteger defaultCacheTopologyId,
Marshaller marshaller,
ExecutorService executorService,
ClientListenerNotifier listenerNotifier,
Collection<Consumer<Set<SocketAddress>>> failedServerNotifier,
MarshallerRegistry marshallerRegistry) |
boolean |
switchToCluster(String clusterName) |
CompletableFuture<ChannelFactory.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) |
protected Collection<SocketAddress> |
updateTopologyInfo(byte[] cacheName,
Collection<SocketAddress> newServers,
boolean quiet) |
public static final String DEFAULT_CLUSTER_NAME
public void start(Codec codec, Configuration configuration, AtomicInteger defaultCacheTopologyId, Marshaller marshaller, ExecutorService executorService, ClientListenerNotifier listenerNotifier, Collection<Consumer<Set<SocketAddress>>> failedServerNotifier, MarshallerRegistry marshallerRegistry)
public MarshallerRegistry getMarshallerRegistry()
public void destroy()
public CacheTopologyInfo getCacheTopologyInfo(byte[] cacheName)
public Map<SocketAddress,Set<Integer>> getPrimarySegmentsByAddress(byte[] cacheName)
public void updateHashFunction(Map<SocketAddress,Set<Integer>> servers2Hash, int numKeyOwners, short hashFunctionVersion, int hashSpace, byte[] cacheName, AtomicInteger topologyId)
public void updateHashFunction(SocketAddress[][] segmentOwners, int numSegments, short hashFunctionVersion, byte[] cacheName, AtomicInteger topologyId)
public <T extends ChannelOperation> T fetchChannelAndInvoke(Set<SocketAddress> failedServers, byte[] cacheName, T operation)
public <T extends ChannelOperation> T fetchChannelAndInvoke(SocketAddress server, T operation)
public SocketAddress getSocketAddress(Object key, byte[] cacheName)
public <T extends ChannelOperation> T fetchChannelAndInvoke(Object key, Set<SocketAddress> failedServers, byte[] cacheName, T operation)
public void releaseChannel(io.netty.channel.Channel channel)
public void updateServers(Collection<SocketAddress> newServers, byte[] cacheName, boolean quiet)
protected Collection<SocketAddress> updateTopologyInfo(byte[] cacheName, Collection<SocketAddress> newServers, boolean quiet)
public Collection<SocketAddress> getServers()
public ConsistentHash getConsistentHash(byte[] cacheName)
ConsistentHash may not be thread-safe.public ConsistentHashFactory getConsistentHashFactory()
public boolean isTcpNoDelay()
public boolean isTcpKeepAlive()
public int getMaxRetries()
public void reset(byte[] cacheName)
public AtomicInteger createTopologyId(byte[] cacheName)
public int getTopologyId(byte[] cacheName)
public CompletableFuture<ChannelFactory.ClusterSwitchStatus> trySwitchCluster(String failedClusterName, byte[] cacheName)
public Marshaller getMarshaller()
public boolean switchToCluster(String clusterName)
public String getCurrentClusterName()
public int getTopologyAge()
public FailoverRequestBalancingStrategy getBalancer(byte[] cacheName)
RequestBalancingStrategy may not be thread-safe.public int socketTimeout()
public int getNumActive(SocketAddress address)
public int getNumIdle(SocketAddress address)
public int getNumActive()
public int getNumIdle()
public Configuration getConfiguration()
public long getRetries()
public void incrementRetryCount()
Copyright © 2022 JBoss by Red Hat. All rights reserved.