xmemcached 源代码简单记录


xmemcached 源代码简单记录_第1张图片

 

XMemcachedClient.set()

1. checkKey
2. createCommand -->return TextStoreCommand
3. sendCommand
    MemcachedConnector.findSessionByKey() --> key.hashCode()%size
    MemcachedSession.write(command)
    TextStoreCommand.encode()
4. return command.getResult()


XMemcachedClient.get()

1. checkKey
2. createCommand -->return TextGetOneCommand
3. sendCommand
    MemcachedConnector.findSessionByKey() --> key.hashCode()%size
    TextStoreCommand.encode()
    MemcachedSession.write(command)
4. Command.getLatch().await()
5. return command.getResult()

你可能感兴趣的:(xmemcached)