
Public Member Functions | |
| void | addOperation (final MemcachedNode node, final Operation o) |
| void | addOperation (final String key, final Operation o) |
| void | addOperations (final Map< MemcachedNode, Operation > ops) |
| CountDownLatch | broadcastOperation (final BroadcastOpFactory of) |
| void | handleIO () throws IOException |
| MemcachedConnection (int bufSize, ConnectionFactory f, List< InetSocketAddress > a) throws IOException | |
| void | setGetOptimization (boolean to) |
| void | shutdown () throws IOException |
| String | toString () |
Package Functions | |
| NodeLocator | getLocator () |
Static Package Functions | |
| static String | dbgBuffer (ByteBuffer b, int size) |
Private Member Functions | |
| void | attemptReconnects () throws IOException |
| void | handleInputQueue () |
| void | handleIO (SelectionKey sk) |
| void | handleReads (SelectionKey sk, MemcachedNode qa) throws IOException |
| void | handleWrites (SelectionKey sk, MemcachedNode qa) throws IOException |
| void | queueReconnect (MemcachedNode qa) |
| boolean | selectorsMakeSense () |
Private Attributes | |
| final ConcurrentLinkedQueue < MemcachedNode > | addedQueue |
| int | emptySelects = 0 |
| final NodeLocator | locator |
| boolean | optimizeGets = true |
| final SortedMap< Long, MemcachedNode > | reconnectQueue |
| Selector | selector = null |
| volatile boolean | shutDown = false |
Static Private Attributes | |
| static final int | DOUBLE_CHECK_EMPTY = 256 |
| static final int | EXCESSIVE_EMPTY = 0x1000000 |
| static final long | MAX_DELAY = 30000 |
| MemcachedConnection | ( | int | bufSize, | |
| ConnectionFactory | f, | |||
| List< InetSocketAddress > | a | |||
| ) | throws IOException |
Construct a memcached connection.
| bufSize | the size of the buffer used for reading from the server | |
| f | the factory that will provide an operation queue | |
| a | the addresses of the servers to connect to |
| IOException | if a connection attempt fails early |
| void addOperation | ( | final MemcachedNode | node, | |
| final Operation | o | |||
| ) |
Add an operation to the given connection.
| which | the connection offset | |
| o | the operation |
| void addOperations | ( | final Map< MemcachedNode, Operation > | ops | ) |
| void attemptReconnects | ( | ) | throws IOException [private] |
| CountDownLatch broadcastOperation | ( | final BroadcastOpFactory | of | ) |
Broadcast an operation to all nodes.
| static String dbgBuffer | ( | ByteBuffer | b, | |
| int | size | |||
| ) | [static, package] |
| NodeLocator getLocator | ( | ) | [package] |
Get the node locator used by this connection.
| void handleInputQueue | ( | ) | [private] |
| void handleIO | ( | SelectionKey | sk | ) | [private] |
| void handleIO | ( | ) | throws IOException |
MemcachedClient calls this method to handle IO over the connections.
| void handleReads | ( | SelectionKey | sk, | |
| MemcachedNode | qa | |||
| ) | throws IOException [private] |
| void handleWrites | ( | SelectionKey | sk, | |
| MemcachedNode | qa | |||
| ) | throws IOException [private] |
| void queueReconnect | ( | MemcachedNode | qa | ) | [private] |
| boolean selectorsMakeSense | ( | ) | [private] |
| void setGetOptimization | ( | boolean | to | ) |
Enable or disable get optimization.
When enabled (default), multiple sequential gets are collapsed into one.
| void shutdown | ( | ) | throws IOException |
Shut down all of the connections.
| String toString | ( | ) |
final ConcurrentLinkedQueue<MemcachedNode> addedQueue [private] |
final int DOUBLE_CHECK_EMPTY = 256 [static, private] |
int emptySelects = 0 [private] |
final int EXCESSIVE_EMPTY = 0x1000000 [static, private] |
final NodeLocator locator [private] |
final long MAX_DELAY = 30000 [static, private] |
boolean optimizeGets = true [private] |
final SortedMap<Long, MemcachedNode> reconnectQueue [private] |
volatile boolean shutDown = false [private] |
1.5.8