public <T> OperationFuture<Boolean> touch(final String key, final int exp, EVCacheLatch evcacheLatch) { final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Boolean> rv = new OperationFuture<Boolean>(key, latch, connectionFactory.getOperationTimeout(), executorService); final Stopwatch operationDuration = getTimer(TOUCH_OPERATION_STRING).start(); Operation op = opFact.touch(key, exp, new OperationCallback() {
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() {
public GetFuture(CountDownLatch l, long opTimeout, String key, ExecutorService service) { super(service); this.rv = new OperationFuture<Future<T>>(key, l, opTimeout, service); }
public GetFuture(CountDownLatch l, long opTimeout, String key, ExecutorService service) { super(service); this.rv = new OperationFuture<Future<T>>(key, l, opTimeout, service); }
public GetFuture(CountDownLatch l, long opTimeout) { this.rv = new OperationFuture<Future<T>>(l, opTimeout); }
public GetFuture(CountDownLatch l, long opTimeout) { this.rv = new OperationFuture<Future<T>>(l, opTimeout); }
public GetFuture(CountDownLatch l, long opTimeout, String key) { this.rv = new OperationFuture<Future<T>>(key, l, opTimeout); }
public GetFuture(CountDownLatch l, long opTimeout) { this.rv = new OperationFuture<Future<T>>(l, opTimeout); }
public GetConfigFuture(CountDownLatch l, long opTimeout, ConfigurationType type, ExecutorService service) { this.rv = new OperationFuture<Future<T>>(type.getValue(), l, opTimeout, service); }
private Future<Long> asyncMutate(Mutator m, String key, int by, long def, int exp) { final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Long> rv = new OperationFuture<Long>( latch, operationTimeout); Operation op = addOp(key, opFact.mutate(m, key, by, def, exp, new OperationCallback() { public void receivedStatus(OperationStatus s) { rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1")); } public void complete() { latch.countDown(); } })); rv.setOperation(op); return rv; }
private Future<Long> asyncMutate(Mutator m, String key, int by, long def, int exp) { final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Long> rv = new OperationFuture<Long>( latch, operationTimeout); Operation op = addOp(key, opFact.mutate(m, key, by, def, exp, new OperationCallback() { public void receivedStatus(OperationStatus s) { rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1")); } public void complete() { latch.countDown(); } })); rv.setOperation(op); return rv; }
private Future<Long> asyncMutate(Mutator m, String key, int by, long def, int exp) { final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Long> rv = new OperationFuture<Long>( latch, operationTimeout); Operation op = addOp(key, opFact.mutate(m, key, by, def, exp, new OperationCallback() { public void receivedStatus(OperationStatus s) { rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1")); } public void complete() { latch.countDown(); } })); rv.setOperation(op); return rv; }
private OperationFuture<Long> asyncMutate(Mutator m, String key, long by, long def, int exp) { final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Long> rv = new OperationFuture<Long>(key, latch, operationTimeout); Operation op = opFact.mutate(m, key, by, def, exp, new OperationCallback() { public void receivedStatus(OperationStatus s) { rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1"), s); } public void complete() { latch.countDown(); } }); mconn.enqueueOperation(key, op); rv.setOperation(op); return rv; }
private <T> Future<Boolean> asyncCat( ConcatenationType catType, long cas, String key, T value, Transcoder<T> tc) { CachedData co=tc.encode(value); final CountDownLatch latch=new CountDownLatch(1); final OperationFuture<Boolean> rv=new OperationFuture<Boolean>(latch, operationTimeout); Operation op=opFact.cat(catType, cas, key, co.getData(), new OperationCallback() { public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess()); } public void complete() { latch.countDown(); }}); rv.setOperation(op); addOp(key, op); return rv; }
private <T> Future<Boolean> asyncCat( ConcatenationType catType, long cas, String key, T value, Transcoder<T> tc) { CachedData co=tc.encode(value); final CountDownLatch latch=new CountDownLatch(1); final OperationFuture<Boolean> rv=new OperationFuture<Boolean>(latch, operationTimeout); Operation op=opFact.cat(catType, cas, key, co.getData(), new OperationCallback() { public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess()); } public void complete() { latch.countDown(); }}); rv.setOperation(op); addOp(key, op); return rv; }
private <T> OperationFuture<Boolean> asyncCat(ConcatenationType catType, long cas, String key, T value, Transcoder<T> tc) { CachedData co = tc.encode(value); final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Boolean> rv = new OperationFuture<Boolean>(key, latch, operationTimeout); Operation op = opFact.cat(catType, cas, key, co.getData(), new OperationCallback() { public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess(), val); } public void complete() { latch.countDown(); } }); rv.setOperation(op); mconn.enqueueOperation(key, op); return rv; }
private <T> Future<Boolean> asyncStore(StoreType storeType, String key, int exp, T value, Transcoder<T> tc) { CachedData co=tc.encode(value); final CountDownLatch latch=new CountDownLatch(1); final OperationFuture<Boolean> rv=new OperationFuture<Boolean>(latch, operationTimeout); Operation op=opFact.store(storeType, key, co.getFlags(), exp, co.getData(), new OperationCallback() { public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess()); } public void complete() { latch.countDown(); }}); rv.setOperation(op); addOp(key, op); return rv; }
private <T> Future<Boolean> asyncStore(StoreType storeType, String key, int exp, T value, Transcoder<T> tc) { CachedData co=tc.encode(value); final CountDownLatch latch=new CountDownLatch(1); final OperationFuture<Boolean> rv=new OperationFuture<Boolean>(latch, operationTimeout); Operation op=opFact.store(storeType, key, co.getFlags(), exp, co.getData(), new OperationCallback() { public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess()); } public void complete() { latch.countDown(); }}); rv.setOperation(op); addOp(key, op); return rv; }
private <T> OperationFuture<Boolean> asyncStore(StoreType storeType, String key, int exp, T value, Transcoder<T> tc) { CachedData co = tc.encode(value); final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Boolean> rv = new OperationFuture<Boolean>(key, latch, operationTimeout); Operation op = opFact.store(storeType, key, co.getFlags(), exp, co.getData(), new StoreOperation.Callback() { public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess(), val); } public void gotData(String key, long cas) { rv.setCas(cas); } public void complete() { latch.countDown(); } }); rv.setOperation(op); mconn.enqueueOperation(key, op); return rv; }
private <T> OperationFuture<Boolean> asyncSetConfig(InetSocketAddress addr, ConfigurationType configurationType, T value, Transcoder<T> tc) { CachedData co = tc.encode(value); final CountDownLatch latch = new CountDownLatch(1); final OperationFuture<Boolean> rv = new OperationFuture<Boolean>(configurationType.getValue(), latch, operationTimeout, executorService); Operation op = opFact.setConfig(configurationType, co.getFlags(), co.getData(), new OperationCallback() { public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess(), val); } public void complete() { latch.countDown(); } }); rv.setOperation(op); mconn.enqueueOperation(addr, op); return rv; }