@Override public void operationComplete(Future<Void> future) throws Exception { if (!future.isSuccess()) { promise.tryFailure(future.cause()); return; } RBatch batch = redisson.createBatch(); RMapAsync<KOut, VOut> resultMap = batch.getMap(resultMapName, objectCodec); resultMap.readAllMapAsync().addListener(new TransferListener<Map<KOut, VOut>>(promise)); resultMap.deleteAsync(); batch.executeAsync(); } });
NamingScheme namingScheme = objectBuilder.getNamingScheme(me.getClass().getSuperclass()); String indexName = namingScheme.getIndexName(me.getClass().getSuperclass(), fieldName); RMultimapAsync<Object, Object> idsMultimap = batch.getSetMultimap(indexName, namingScheme.getCodec()); idsMultimap.removeAsync(value, ((RLiveObject) me).getLiveObjectId()); RFuture<Long> deleteFuture = batch.getKeys().deleteAsync(map.getName()); batch.execute();
RBatch batch = redisson.createBatch(); Future<String> mapFuture = batch.getMap("test").putAsync("2", "5"); Future<Long> longFuture = batch.getAtomicLongAsync("counter").incrementAndGetAsync(); List<?> res = batch.execute(); // or Future<List<?>> asyncRes = batch.executeAsync();
@Override protected RMapAsync<byte[], byte[]> initAsyncCollection( final RBatch batch, final String setName, final Codec codec) { return batch.getMap(setName, codec); }
public void flush() { batchCmdCounter = 0; final RBatch flushBatch = this.currentBatch; currentAsync = null; currentBatch = null; try { writeSemaphore.acquire(); flushBatch.executeAsync().handle((r, t) -> { writeSemaphore.release(); if ((t != null) && !(t instanceof CancellationException)) { LOGGER.error("Exception in batched write", t); } return r; }); } catch (final InterruptedException e) { LOGGER.warn("async batch write semaphore interrupted", e); writeSemaphore.release(); } }
@Override protected RScoredSortedSetAsync<V> initAsyncCollection( final RBatch batch, final String setName, final Codec codec) { return batch.getScoredSortedSet(setName, codec); }
@Override public void operationComplete(Future<Void> future) throws Exception { if (!future.isSuccess()) { promise.tryFailure(future.cause()); return; } RBatch batch = redisson.createBatch(); RMapAsync<KOut, VOut> resultMap = batch.getMap(resultMapName, objectCodec); resultMap.readAllMapAsync().addListener(new TransferListener<Map<KOut, VOut>>(promise)); resultMap.deleteAsync(); batch.executeAsync(); } });
NamingScheme namingScheme = objectBuilder.getNamingScheme(me.getClass().getSuperclass()); String indexName = namingScheme.getIndexName(me.getClass().getSuperclass(), fieldName); RMultimapAsync<Object, Object> idsMultimap = batch.getSetMultimap(indexName, namingScheme.getCodec()); idsMultimap.removeAsync(value, ((RLiveObject) me).getLiveObjectId()); RFuture<Long> deleteFuture = batch.getKeys().deleteAsync(map.getName()); batch.execute();
@Override public void operationComplete(Future<Void> future) throws Exception { if (!future.isSuccess()) { promise.tryFailure(future.cause()); return; } RBatch batch = redisson.createBatch(); RMapAsync<KOut, VOut> resultMap = batch.getMap(resultMapName, objectCodec); resultMap.readAllMapAsync().addListener(new TransferListener<Map<KOut, VOut>>(promise)); resultMap.deleteAsync(); batch.executeAsync(); } });
NamingScheme namingScheme = objectBuilder.getNamingScheme(me.getClass().getSuperclass()); String indexName = namingScheme.getIndexName(me.getClass().getSuperclass(), fieldName); RMultimapAsync<Object, Object> idsMultimap = batch.getSetMultimap(indexName, namingScheme.getCodec()); idsMultimap.removeAsync(value, ((RLiveObject) me).getLiveObjectId()); RFuture<Long> deleteFuture = batch.getKeys().deleteAsync(map.getName()); batch.execute();