当前位置: 首页>>代码示例>>Java>>正文


Java DeleteOperation类代码示例

本文整理汇总了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;
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:25,代码来源:MemcachedClient.java

示例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);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:8,代码来源:OperationFactoryTestBase.java

示例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;
}
 
开发者ID:Netflix,项目名称:EVCache,代码行数:35,代码来源:EVCacheMemcachedClient.java

示例4: DeleteOperationImpl

import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperationImpl(String k, DeleteOperation.Callback cb) {
  this(k, 0, cb);
}
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:4,代码来源:DeleteOperationImpl.java

示例5: decodePayload

import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
@Override
protected void decodePayload(byte[] pl) {
  super.decodePayload(pl);
  ((DeleteOperation.Callback) getCallback()).gotData(responseCas);
}
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:6,代码来源:DeleteOperationImpl.java

示例6: delete

import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation
delete(String key, DeleteOperation.Callback operationCallback) {
  return new DeleteOperationImpl(key, operationCallback);
}
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:5,代码来源:BinaryOperationFactory.java

示例7: delete

import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation delete(String key, DeleteOperation.Callback cb) {
  return new DeleteOperationImpl(key, cb);
}
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:4,代码来源:AsciiOperationFactory.java

示例8: delete

import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation delete(String key,
	OperationCallback operationCallback) {
	return new DeleteOperationImpl(key, operationCallback);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:5,代码来源:BinaryOperationFactory.java

示例9: delete

import net.spy.memcached.ops.DeleteOperation; //导入依赖的package包/类
public DeleteOperation delete(String key, OperationCallback cb) {
	return new DeleteOperationImpl(key, cb);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:4,代码来源:AsciiOperationFactory.java

示例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);
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:9,代码来源:OperationFactory.java

示例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);
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:9,代码来源:OperationFactory.java


注:本文中的net.spy.memcached.ops.DeleteOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。