public class DefaultRawMemcacheClient extends AbstractRawMemcacheClient
| Modifier and Type | Class and Description |
|---|---|
private class |
DefaultRawMemcacheClient.ConnectionHandler
Handles a channel connected to the address specified in the constructor.
|
private class |
DefaultRawMemcacheClient.RequestWritePromise |
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.net.HostAndPort |
address |
private io.netty.channel.Channel |
channel |
private static io.netty.util.concurrent.DefaultThreadFactory |
DAEMON_THREAD_FACTORY |
private AtomicReference<String> |
disconnectReason |
private static io.netty.channel.EventLoopGroup |
EVENT_LOOP_GROUP |
private Executor |
executor |
private BatchFlusher |
flusher |
private org.slf4j.Logger |
log |
private int |
outstandingRequestLimit |
private AtomicInteger |
pendingCounter |
private long |
timeoutMillis |
| Modifier | Constructor and Description |
|---|---|
private |
DefaultRawMemcacheClient(com.google.common.net.HostAndPort address,
io.netty.channel.Channel channel,
int outstandingRequestLimit,
Executor executor,
long timeoutMillis) |
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.util.concurrent.ListenableFuture<RawMemcacheClient> |
connect(com.google.common.net.HostAndPort address,
int outstandingRequestLimit,
boolean binary,
Executor executor,
long timeoutMillis,
Charset charset) |
boolean |
isConnected()
Is the client connected to a server?
|
private boolean |
isLostConnection(Throwable t) |
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 <T> com.google.common.util.concurrent.ListenableFuture<T> |
onExecutor(com.google.common.util.concurrent.ListenableFuture<T> future) |
private static <T> com.google.common.util.concurrent.ListenableFuture<T> |
onExecutor(com.google.common.util.concurrent.ListenableFuture<T> future,
Executor executor) |
<T> com.google.common.util.concurrent.ListenableFuture<T> |
send(Request<T> request) |
private void |
setDisconnected(String message) |
private void |
setDisconnected(Throwable cause) |
void |
shutdown()
Shut down the client.
|
String |
toString() |
private boolean |
tryIncrementPending()
Increment the
pendingCounter, saving a volatile read in the fast path by doing the
limit check in the CAS loop. |
notifyConnectionChange, registerForConnectionChanges, unregisterForConnectionChangesprivate static final io.netty.util.concurrent.DefaultThreadFactory DAEMON_THREAD_FACTORY
private static final io.netty.channel.EventLoopGroup EVENT_LOOP_GROUP
private final org.slf4j.Logger log
private final AtomicInteger pendingCounter
private final int outstandingRequestLimit
private final io.netty.channel.Channel channel
private final BatchFlusher flusher
private final com.google.common.net.HostAndPort address
private final Executor executor
private final long timeoutMillis
private final AtomicReference<String> disconnectReason
private DefaultRawMemcacheClient(com.google.common.net.HostAndPort address,
io.netty.channel.Channel channel,
int outstandingRequestLimit,
Executor executor,
long timeoutMillis)
public static com.google.common.util.concurrent.ListenableFuture<RawMemcacheClient> connect(com.google.common.net.HostAndPort address, int outstandingRequestLimit, boolean binary, Executor executor, long timeoutMillis, Charset charset)
public <T> com.google.common.util.concurrent.ListenableFuture<T> send(Request<T> request)
private <T> com.google.common.util.concurrent.ListenableFuture<T> onExecutor(com.google.common.util.concurrent.ListenableFuture<T> future)
private static <T> com.google.common.util.concurrent.ListenableFuture<T> onExecutor(com.google.common.util.concurrent.ListenableFuture<T> future,
Executor executor)
private boolean tryIncrementPending()
pendingCounter, saving a volatile read in the fast path by doing the
limit check in the CAS loop.public void shutdown()
RawMemcacheClientRawMemcacheClient.registerForConnectionChanges(ConnectionChangeListener) to
to get notified when it has (possibly) finished shutting downpublic boolean isConnected()
RawMemcacheClientpublic int numTotalConnections()
RawMemcacheClientpublic int numActiveConnections()
RawMemcacheClientprivate boolean isLostConnection(Throwable t)
private void setDisconnected(Throwable cause)
private void setDisconnected(String message)
Copyright © 2015 Spotify AB. All Rights Reserved.