public class MemcachedConnector extends SocketChannelController implements Connector
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_SELECTOR_POOL_SIZE |
protected Protocol |
protocol |
protected MemcachedSessionLocator |
sessionLocator |
protected ConcurrentHashMap<InetSocketAddress,Queue<Session>> |
sessionMap |
static String |
XMEMCACHED_SELECTOR_POOL_SIZE |
soLingerOnselectorManager, selectorPoolSizecodecFactory, configuration, dispatchMessageDispatcher, dispatchMessageThreadCount, handler, handleReadWriteConcurrently, localSocketAddress, log, readEventDispatcher, readThreadCount, sessionSet, sessionTimeout, socketOptions, soTimeout, started, stateListeners, statistics, statisticsInterval, writeEventDispatcher, writeThreadCount| 构造器和说明 |
|---|
MemcachedConnector(Configuration configuration,
MemcachedSessionLocator locator,
BufferAllocator allocator,
CommandFactory commandFactory,
int poolSize,
int maxQueuedNoReplyOperations) |
configureSocketChannel, dispatchReadEvent, dispatchWriteEvent, setSoLingerbind, buildSessionConfig, closeSelectionKey, getSelectorManager, getSelectorPoolSize, initialSelectorManager, onRead, onWrite, setSelectorPoolSize, start0, stop0addStateListener, bind, checkStatisticsForRestart, getCodecFactory, getConfiguration, getDispatchMessageThreadCount, getHandler, getLocalSocketAddress, getPort, getReadThreadCount, getReceiveThroughputLimit, getSendThroughputLimit, getSessionIdleTimeout, getSessionTimeout, getSocketOption, getSoTimeout, getStatistics, getWriteThreadCount, isHandleReadWriteConcurrently, isStarted, notifyAllSessionClosed, notifyException, notifyReady, notifyStarted, notifyStopped, onAccept, registerSession, removeStateListener, setCodecFactory, setConfiguration, setDispatchMessageThreadCount, setHandler, setHandleReadWriteConcurrently, setLocalSocketAddress, setReadThreadCount, setReceiveThroughputLimit, setSendThroughputLimit, setSessionIdleTimeout, setSessionTimeout, setSocketOption, setSocketOptions, setSoTimeout, setWriteThreadCount, start, stop, unregisterSessionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetSocketOptionsaddStateListener, getCodecFactory, getDispatchMessageThreadCount, getHandler, getLocalSocketAddress, getPort, getReadThreadCount, getReceiveThroughputLimit, getSendThroughputLimit, getSessionIdleTimeout, getSessionTimeout, getSoTimeout, getStatistics, getWriteThreadCount, isHandleReadWriteConcurrently, isStarted, removeStateListener, setCodecFactory, setDispatchMessageThreadCount, setHandler, setHandleReadWriteConcurrently, setLocalSocketAddress, setReadThreadCount, setReceiveThroughputLimit, setSendThroughputLimit, setSessionIdleTimeout, setSessionTimeout, setSocketOption, setSoTimeout, setWriteThreadCount, start, stoponAcceptpublic static final int DEFAULT_SELECTOR_POOL_SIZE
protected Protocol protocol
protected MemcachedSessionLocator sessionLocator
protected final ConcurrentHashMap<InetSocketAddress,Queue<Session>> sessionMap
public MemcachedConnector(Configuration configuration, MemcachedSessionLocator locator, BufferAllocator allocator, CommandFactory commandFactory, int poolSize, int maxQueuedNoReplyOperations)
public void setSessionLocator(MemcachedSessionLocator sessionLocator)
setSessionLocator 在接口中 Connectorpublic void setEnableHealSession(boolean enableHealSession)
setEnableHealSession 在接口中 Connectorpublic Queue<ReconnectRequest> getReconnectRequestQueue()
getReconnectRequestQueue 在接口中 Connectorpublic Set<Session> getSessionSet()
getSessionSet 在接口中 ConnectorgetSessionSet 在类中 AbstractControllerpublic final void setHealSessionInterval(long healConnectionInterval)
setHealSessionInterval 在接口中 Connectorpublic long getHealSessionInterval()
getHealSessionInterval 在接口中 Connectorpublic void setOptimizeGet(boolean optimiezeGet)
setOptimizeGet 在接口中 Connectorpublic void setOptimizeMergeBuffer(boolean optimizeMergeBuffer)
setOptimizeMergeBuffer 在接口中 Connectorpublic Protocol getProtocol()
public void addSession(Session session)
public List<Session> getSessionListBySocketAddress(InetSocketAddress inetSocketAddress)
public void removeReconnectRequest(InetSocketAddress inetSocketAddress)
removeReconnectRequest 在接口中 Connectorpublic final void updateSessions()
updateSessions 在接口中 Connectorpublic void removeSession(Session session)
removeSession 在接口中 Connectorprotected void doStart()
throws IOException
NioControllerdoStart 在类中 NioControllerIOExceptionpublic void onConnect(SelectionKey key) throws IOException
onConnect 在接口中 SelectionKeyHandleronConnect 在类中 AbstractControllerIOExceptionprotected MemcachedTCPSession createSession(SocketChannel socketChannel, InetSocketAddressWrapper wrapper)
public void addToWatingQueue(ReconnectRequest request)
addToWatingQueue 在接口中 Connectorpublic Future<Boolean> connect(InetSocketAddressWrapper addressWrapper) throws IOException
connect 在接口中 ConnectorIOExceptionpublic void closeChannel(Selector selector) throws IOException
closeChannel 在接口中 SelectionKeyHandlerIOExceptionpublic Session send(Command msg) throws MemcachedException
send 在接口中 ConnectorMemcachedExceptionpublic List<Session> getStandbySessionListByMainNodeAddr(InetSocketAddress addr)
getStandbySessionListByMainNodeAddr 在接口中 Connectoraddr - public final Queue<Session> getSessionByAddress(InetSocketAddress addr)
getSessionByAddress 在接口中 Connectoraddr - public final void setConnectionPoolSize(int poolSize)
setConnectionPoolSize 在接口中 Connectorpublic void setMergeFactor(int mergeFactor)
setMergeFactor 在接口中 Connectorpublic FlowControl getNoReplyOpsFlowControl()
ConnectorgetNoReplyOpsFlowControl 在接口中 Connectorprotected NioSession buildSession(SocketChannel sc)
buildSession 在类中 SocketChannelControllerprotected Queue<WriteMessage> buildQueue()
buildQueue 在类中 AbstractControllerpublic BufferAllocator getBufferAllocator()
public void quitAllSessions()
ConnectorquitAllSessions 在接口中 Connectorpublic void setFailureMode(boolean failureMode)
setFailureMode 在接口中 Connectorpublic void setBufferAllocator(BufferAllocator allocator)
setBufferAllocator 在接口中 Connectorpublic Collection<InetSocketAddress> getServerAddresses()
Copyright © 2013. All Rights Reserved.