⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asciimemcachednodeimpl.java

📁 memcached JAVA客户端API,应用广泛,运行比较稳定。
💻 JAVA
字号:
package net.spy.memcached.protocol.ascii;import java.net.SocketAddress;import java.nio.channels.SocketChannel;import java.util.concurrent.BlockingQueue;import net.spy.memcached.ops.GetOperation;import net.spy.memcached.ops.Operation;import net.spy.memcached.ops.OperationState;import net.spy.memcached.protocol.ProxyCallback;import net.spy.memcached.protocol.TCPMemcachedNodeImpl;/** * Memcached node for the ASCII protocol. */public final class AsciiMemcachedNodeImpl extends TCPMemcachedNodeImpl {	public AsciiMemcachedNodeImpl(SocketAddress sa, SocketChannel c,			int bufSize, BlockingQueue<Operation> rq,			BlockingQueue<Operation> wq, BlockingQueue<Operation> iq) {		super(sa, c, bufSize, rq, wq, iq);	}	@Override	protected void optimize() {		// make sure there are at least two get operations in a row before		// attempting to optimize them.		if(writeQ.peek() instanceof GetOperation) {			getOp=(GetOperationImpl)writeQ.remove();			if(writeQ.peek() instanceof GetOperation) {				OptimizedGetImpl og=new OptimizedGetImpl(getOp);				getOp=og;				while(writeQ.peek() instanceof GetOperation) {					GetOperationImpl o=(GetOperationImpl) writeQ.remove();					if(!o.isCancelled()) {						og.addOperation(o);					}				}				// Initialize the new mega get				getOp.initialize();				assert getOp.getState() == OperationState.WRITING;				ProxyCallback pcb=(ProxyCallback) og.getCallback();				getLogger().debug("Set up %s with %s keys and %s callbacks",					this, pcb.numKeys(), pcb.numCallbacks());			}		}	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -