public class ReconnectingClient extends AbstractRawMemcacheClient
| Modifier and Type | Class and Description |
|---|---|
(package private) static interface |
ReconnectingClient.Connector |
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.net.HostAndPort |
address |
private BackoffFunction |
backoffFunction |
private RawMemcacheClient |
client |
private ReconnectingClient.Connector |
connector |
private org.slf4j.Logger |
log |
private int |
reconnectCount |
private static ScheduledExecutorService |
SCHEDULED_EXECUTOR_SERVICE |
private ScheduledExecutorService |
scheduledExecutorService |
private boolean |
stayConnected |
| Constructor and Description |
|---|
ReconnectingClient(BackoffFunction backoffFunction,
ScheduledExecutorService scheduledExecutorService,
com.google.common.net.HostAndPort address,
int outstandingRequestLimit,
boolean binary,
Executor executor,
long timeoutMillis,
Charset charset,
Metrics metrics,
int maxSetLength) |
ReconnectingClient(BackoffFunction backoffFunction,
ScheduledExecutorService scheduledExecutorService,
ReconnectingClient.Connector connector,
com.google.common.net.HostAndPort address) |
| Modifier and Type | Method and Description |
|---|---|
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> com.google.common.util.concurrent.ListenableFuture<T> |
send(Request<T> request) |
void |
shutdown()
Shut down the client.
|
static ScheduledExecutorService |
singletonExecutor() |
String |
toString() |
notifyConnectionChange, registerForConnectionChanges, unregisterForConnectionChangesprivate static final ScheduledExecutorService SCHEDULED_EXECUTOR_SERVICE
private final org.slf4j.Logger log
private final BackoffFunction backoffFunction
private final ScheduledExecutorService scheduledExecutorService
private final ReconnectingClient.Connector connector
private final com.google.common.net.HostAndPort address
private volatile RawMemcacheClient client
private volatile int reconnectCount
private volatile boolean stayConnected
public ReconnectingClient(BackoffFunction backoffFunction, ScheduledExecutorService scheduledExecutorService, com.google.common.net.HostAndPort address, int outstandingRequestLimit, boolean binary, Executor executor, long timeoutMillis, Charset charset, Metrics metrics, int maxSetLength)
ReconnectingClient(BackoffFunction backoffFunction, ScheduledExecutorService scheduledExecutorService, ReconnectingClient.Connector connector, com.google.common.net.HostAndPort address)
public <T> com.google.common.util.concurrent.ListenableFuture<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 int numTotalConnections()
RawMemcacheClientpublic int numActiveConnections()
RawMemcacheClientprivate void retry()
private void onFailure()
public static ScheduledExecutorService singletonExecutor()
Copyright © 2017 Spotify AB. All Rights Reserved.