public BaseTransactionalSet(CommandAsyncExecutor commandExecutor, long timeout, List<TransactionalOperation> operations, RCollectionAsync<V> set) { this.commandExecutor = commandExecutor; this.timeout = timeout; this.operations = operations; this.set = set; this.object = (RObject) set; this.name = object.getName(); }
((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RDeque) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RQueue) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RSet) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RList) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (isLiveObject(obj.getValue())) { if (deleted.add(getMap(obj.getValue()).getName())) { deleteCollection(deleted, map.keySet()); deleteCollection(deleted, map.values()); ((RObject)obj.getValue()).delete(); } else { validateAnnotation(attachedObject, obj.getKey());
public RFuture<Boolean> moveAsync(final String destination, final V value) { RSet<V> destinationSet = new RedissonSet<V>(object.getCodec(), commandExecutor, destination, null);
object.isExistsAsync().addListener(new FutureListener<Boolean>() { @Override public void operationComplete(Future<Boolean> future) throws Exception {
public BaseTransactionalSet(CommandAsyncExecutor commandExecutor, long timeout, List<TransactionalOperation> operations, RCollectionAsync<V> set) { this.commandExecutor = commandExecutor; this.timeout = timeout; this.operations = operations; this.set = set; this.object = (RObject) set; this.name = object.getName(); }
((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RDeque) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RQueue) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RSet) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RList) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (isLiveObject(obj.getValue())) { if (deleted.add(getMap(obj.getValue()).getName())) { deleteCollection(deleted, map.keySet()); deleteCollection(deleted, map.values()); ((RObject)obj.getValue()).delete(); } else { validateAnnotation(attachedObject, obj.getKey());
public RFuture<Boolean> moveAsync(final String destination, final V value) { RSet<V> destinationSet = new RedissonSet<V>(object.getCodec(), commandExecutor, destination, null);
object.isExistsAsync().addListener(new FutureListener<Boolean>() { @Override public void operationComplete(Future<Boolean> future) throws Exception {
public RFuture<Boolean> expireAtAsync(long timestamp) { return commandExecutor.evalWriteAsync(object.getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, "redis.call('zadd', KEYS[2], 92233720368547758, 'redisson__expiretag');" + "local entries = redis.call('hgetall', KEYS[1]); " + "for i, v in ipairs(entries) do " + "if i % 2 == 0 then " + "local name = ARGV[2] .. v; " + "redis.call('pexpireat', name, ARGV[1]); " + "end;" + "end; " + "redis.call('pexpireat', KEYS[2], ARGV[1]); " + "return redis.call('pexpireat', KEYS[1], ARGV[1]); ", Arrays.<Object>asList(object.getName(), timeoutSetName), timestamp, prefix); }
((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RDeque) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RQueue) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RSet) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (obj.getValue() instanceof RList) { deleteCollection(deleted, (Iterable<?>)obj.getValue()); ((RObject)obj.getValue()).delete(); } else if (isLiveObject(obj.getValue())) { if (deleted.add(getMap(obj.getValue()).getName())) { deleteCollection(deleted, map.keySet()); deleteCollection(deleted, map.values()); ((RObject)obj.getValue()).delete(); } else { validateAnnotation(attachedObject, obj.getKey());
public RFuture<Boolean> moveAsync(final String destination, final V value) { RSet<V> destinationSet = new RedissonSet<V>(object.getCodec(), commandExecutor, destination, null);
object.isExistsAsync().addListener(new FutureListener<Boolean>() { @Override public void operationComplete(Future<Boolean> future) throws Exception {
public RFuture<Boolean> expireAtAsync(long timestamp) { return commandExecutor.evalWriteAsync(object.getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, "redis.call('zadd', KEYS[2], 92233720368547758, 'redisson__expiretag');" + "local entries = redis.call('hgetall', KEYS[1]); " + "for i, v in ipairs(entries) do " + "if i % 2 == 0 then " + "local name = ARGV[2] .. v; " + "redis.call('pexpireat', name, ARGV[1]); " + "end;" + "end; " + "redis.call('pexpireat', KEYS[2], ARGV[1]); " + "return redis.call('pexpireat', KEYS[1], ARGV[1]); ", Arrays.<Object>asList(object.getName(), timeoutSetName), timestamp, prefix); }
public RFuture<Boolean> clearExpireAsync() { return commandExecutor.evalWriteAsync(object.getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, "redis.call('zrem', KEYS[2], 'redisson__expiretag'); " + "local entries = redis.call('hgetall', KEYS[1]); " + "for i, v in ipairs(entries) do " + "if i % 2 == 0 then " + "local name = ARGV[1] .. v; " + "redis.call('persist', name); " + "end;" + "end; " + "redis.call('persist', KEYS[2]); " + "return redis.call('persist', KEYS[1]); ", Arrays.<Object>asList(object.getName(), timeoutSetName), prefix); }
public RFuture<Boolean> clearExpireAsync() { return commandExecutor.evalWriteAsync(object.getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, "redis.call('zrem', KEYS[2], 'redisson__expiretag'); " + "local entries = redis.call('hgetall', KEYS[1]); " + "for i, v in ipairs(entries) do " + "if i % 2 == 0 then " + "local name = ARGV[1] .. v; " + "redis.call('persist', name); " + "end;" + "end; " + "redis.call('persist', KEYS[2]); " + "return redis.call('persist', KEYS[1]); ", Arrays.<Object>asList(object.getName(), timeoutSetName), prefix); }