本文整理汇总了Java中net.spy.memcached.ops.DeleteOperation.Callback方法的典型用法代码示例。如果您正苦于以下问题:Java DeleteOperation.Callback方法的具体用法?Java DeleteOperation.Callback怎么用?Java DeleteOperation.Callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.spy.memcached.ops.DeleteOperation
的用法示例。
在下文中一共展示了DeleteOperation.Callback方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: delete
import net.spy.memcached.ops.DeleteOperation; //导入方法依赖的package包/类
public OperationFuture<Boolean> delete(String key, EVCacheLatch evcacheLatch) {
final CountDownLatch latch = new CountDownLatch(1);
final OperationFuture<Boolean> rv = new OperationFuture<Boolean>(key, latch, connectionFactory.getOperationTimeout(), executorService);
final Stopwatch operationDuration = getTimer(DELETE_STRING).start();
final DeleteOperation.Callback callback = new DeleteOperation.Callback() {
@Override
public void receivedStatus(OperationStatus status) {
operationDuration.stop();
rv.set(Boolean.TRUE, status);
if (status.getStatusCode().equals(StatusCode.SUCCESS)) {
getCounter(DELETE_OPERATION_SUCCESS_STRING).increment();
} else {
getCounter("DeleteOperation-"+ status.getStatusCode().name()).increment();
}
}
@Override
public void gotData(long cas) {
rv.setCas(cas);
}
@Override
public void complete() {
latch.countDown();
rv.signalComplete();
}
};
final DeleteOperation op = opFact.delete(key, callback);
rv.setOperation(op);
if (evcacheLatch != null && evcacheLatch instanceof EVCacheLatchImpl && !client.isInWriteOnly()) ((EVCacheLatchImpl) evcacheLatch).addFuture(rv);
mconn.enqueueOperation(key, op);
return rv;
}
示例2: DeleteOperationImpl
import net.spy.memcached.ops.DeleteOperation; //导入方法依赖的package包/类
public DeleteOperationImpl(String k, DeleteOperation.Callback cb) {
this(k, 0, cb);
}
示例3: delete
import net.spy.memcached.ops.DeleteOperation; //导入方法依赖的package包/类
public DeleteOperation
delete(String key, DeleteOperation.Callback operationCallback) {
return new DeleteOperationImpl(key, operationCallback);
}
示例4: delete
import net.spy.memcached.ops.DeleteOperation; //导入方法依赖的package包/类
public DeleteOperation delete(String key, DeleteOperation.Callback cb) {
return new DeleteOperationImpl(key, cb);
}
示例5: delete
import net.spy.memcached.ops.DeleteOperation; //导入方法依赖的package包/类
/**
* Create a deletion operation.
*
* @param key the key to delete
* @param callback the status callback
* @return the new DeleteOperation
*/
DeleteOperation delete(String key, DeleteOperation.Callback callback);