public class ReconnectingClient extends AbstractRawMemcacheClient
| Modifier and Type | Field and Description |
|---|---|
private HostAndPort |
address |
private BackoffFunction |
backoffFunction |
private RawMemcacheClient |
client |
private java.lang.Throwable |
connectionFailure |
private Connector |
connector |
private org.slf4j.Logger |
log |
private int |
reconnectCount |
private static java.util.concurrent.ScheduledExecutorService |
SCHEDULED_EXECUTOR_SERVICE |
private java.util.concurrent.ScheduledExecutorService |
scheduledExecutorService |
private boolean |
stayConnected |
| Modifier | Constructor and Description |
|---|---|
private |
ReconnectingClient(BackoffFunction backoffFunction,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
Connector connector,
Authenticator authenticator,
HostAndPort address) |
(package private) |
ReconnectingClient(BackoffFunction backoffFunction,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
Connector connector,
HostAndPort address) |
|
ReconnectingClient(BackoffFunction backoffFunction,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
HostAndPort address,
int outstandingRequestLimit,
int batchSize,
boolean binary,
Authenticator authenticator,
java.util.concurrent.Executor executor,
long connectionTimeoutMillis,
java.nio.charset.Charset charset,
Metrics metrics,
int maxSetLength,
io.netty.channel.EventLoopGroup eventLoopGroup,
java.lang.Class<? extends io.netty.channel.Channel> channelClass) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Throwable |
getConnectionFailure()
Returns the unrecoverable connection failure, if any.
|
boolean |
isConnected()
Is the client connected to a server?
|
int |
numActiveConnections()
How many active socket connections do we have (i.e.
|
int |
numTotalConnections()
How many actual socket connections do we have, including currently disconnected clients.
|
private void |
onFailure() |
private void |
retry() |
<T> java.util.concurrent.CompletionStage<T> |
send(Request<T> request) |
void |
shutdown()
Shut down the client.
|
static java.util.concurrent.ScheduledExecutorService |
singletonExecutor() |
java.lang.String |
toString() |
notifyConnectionChange, registerForConnectionChanges, unregisterForConnectionChangesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitawaitConnected, awaitDisconnected, awaitFullyConnected, awaitFullyDisconnected, awaitFuture, connectFuture, disconnectFuture, fullyConnectedFuture, fullyDisconnectFutureprivate static final java.util.concurrent.ScheduledExecutorService SCHEDULED_EXECUTOR_SERVICE
private final org.slf4j.Logger log
private final BackoffFunction backoffFunction
private final java.util.concurrent.ScheduledExecutorService scheduledExecutorService
private final Connector connector
private final HostAndPort address
private volatile RawMemcacheClient client
private volatile int reconnectCount
private volatile boolean stayConnected
private volatile java.lang.Throwable connectionFailure
public ReconnectingClient(BackoffFunction backoffFunction, java.util.concurrent.ScheduledExecutorService scheduledExecutorService, HostAndPort address, int outstandingRequestLimit, int batchSize, boolean binary, Authenticator authenticator, java.util.concurrent.Executor executor, long connectionTimeoutMillis, java.nio.charset.Charset charset, Metrics metrics, int maxSetLength, io.netty.channel.EventLoopGroup eventLoopGroup, java.lang.Class<? extends io.netty.channel.Channel> channelClass)
private ReconnectingClient(BackoffFunction backoffFunction, java.util.concurrent.ScheduledExecutorService scheduledExecutorService, Connector connector, Authenticator authenticator, HostAndPort address)
ReconnectingClient(BackoffFunction backoffFunction, java.util.concurrent.ScheduledExecutorService scheduledExecutorService, Connector connector, HostAndPort address)
public <T> java.util.concurrent.CompletionStage<T> send(Request<T> request)
public void shutdown()
RawMemcacheClientObservableClient.registerForConnectionChanges(ConnectionChangeListener) to to
get notified when it has (possibly) finished shutting downpublic boolean isConnected()
ObservableClientpublic java.lang.Throwable getConnectionFailure()
ObservableClientpublic int numTotalConnections()
RawMemcacheClientpublic int numActiveConnections()
RawMemcacheClientprivate void retry()
private void onFailure()
public static java.util.concurrent.ScheduledExecutorService singletonExecutor()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2020 Spotify AB. All Rights Reserved.