本文整理汇总了Java中net.spy.memcached.ops.DeleteOperation类的典型用法代码示例。如果您正苦于以下问题:Java DeleteOperation类的具体用法?Java DeleteOperation怎么用?Java DeleteOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeleteOperation类属于net.spy.memcached.ops包,在下文中一共展示了DeleteOperation类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: delete
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
/**
* Delete the given key from the cache.
*
* @param key the key to delete
* @return whether or not the operation was performed
* @throws IllegalStateException in the rare circumstance where queue
* is too full to accept any more requests
*/
public Future<Boolean> delete(String key) {
final CountDownLatch latch=new CountDownLatch(1);
final OperationFuture<Boolean> rv=new OperationFuture<Boolean>(latch,
operationTimeout);
DeleteOperation op=opFact.delete(key,
new OperationCallback() {
public void receivedStatus(OperationStatus s) {
rv.set(s.isSuccess());
}
public void complete() {
latch.countDown();
}});
rv.setOperation(op);
addOp(key, op);
return rv;
}
示例2: testDeleteOperationCloning
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public void testDeleteOperationCloning() {
DeleteOperation op = ofact.delete(TEST_KEY, genericCallback);
DeleteOperation op2 = cloneOne(DeleteOperation.class, op);
assertEquals(TEST_KEY, op2.getKeys().iterator().next());
assertCallback(op2);
}
示例3: 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;
}
示例4: DeleteOperationImpl
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperationImpl(String k, DeleteOperation.Callback cb) {
this(k, 0, cb);
}
示例5: decodePayload
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
@Override
protected void decodePayload(byte[] pl) {
super.decodePayload(pl);
((DeleteOperation.Callback) getCallback()).gotData(responseCas);
}
示例6: delete
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation
delete(String key, DeleteOperation.Callback operationCallback) {
return new DeleteOperationImpl(key, operationCallback);
}
示例7: delete
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation delete(String key, DeleteOperation.Callback cb) {
return new DeleteOperationImpl(key, cb);
}
示例8: delete
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation delete(String key,
OperationCallback operationCallback) {
return new DeleteOperationImpl(key, operationCallback);
}
示例9: delete
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation delete(String key, OperationCallback cb) {
return new DeleteOperationImpl(key, cb);
}
示例10: 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);
示例11: delete
import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
/**
* Create a deletion operation.
*
* @param key the key to delete
* @param operationCallback the status callback
* @return the new DeleteOperation
*/
DeleteOperation delete(String key, OperationCallback operationCallback);