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


Java DeleteOperation.Callback方法代码示例

本文整理汇总了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;
}
 
开发者ID:Netflix,项目名称:EVCache,代码行数:35,代码来源:EVCacheMemcachedClient.java

示例2: 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

示例3: 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

示例4: 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

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


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