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(); }
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(); }
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> 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); }
@Override public RFuture<Long> deleteAsync(RObject ... objects) { List<String> keys = new ArrayList<String>(); for (RObject obj : objects) { keys.add(obj.getName()); } return deleteAsync(keys.toArray(new String[keys.size()])); }
@Override public RFuture<Long> deleteAsync(RObject ... objects) { List<String> keys = new ArrayList<String>(); for (RObject obj : objects) { keys.add(obj.getName()); } return deleteAsync(keys.toArray(new String[keys.size()])); }
public MapReduceExecutor(RObject object, RedissonClient redisson, ConnectionManager connectionManager) { this.objectName = object.getName(); this.objectCodec = object.getCodec(); this.objectClass = object.getClass(); this.redisson = redisson; UUID id = UUID.randomUUID(); this.resultMapName = object.getName() + ":result:" + id; this.executorService = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME); this.connectionManager = connectionManager; }
public RFuture<Long> sizeInMemoryAsync() { List<Object> keys = Arrays.<Object>asList(object.getName(), timeoutSetName); return ((RedissonObject)object).sizeInMemoryAsync(keys); }
public RemoveCacheOperation(RObject set, Object value, String transactionId) { this(set.getName(), set.getCodec(), value, transactionId); }
public MapReduceExecutor(RObject object, RedissonClient redisson, ConnectionManager connectionManager) { this.objectName = object.getName(); this.objectCodec = object.getCodec(); this.objectClass = object.getClass(); this.redisson = redisson; UUID id = UUID.randomUUID(); this.resultMapName = object.getName() + ":result:" + id; this.executorService = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME); this.connectionManager = connectionManager; }
public RemoveOperation(RObject set, Object value, String transactionId) { this(set.getName(), set.getCodec(), value, transactionId); }
public RemoveCacheOperation(RObject set, Object value, String transactionId) { this(set.getName(), set.getCodec(), value, transactionId); }
public RFuture<Long> sizeInMemoryAsync() { List<Object> keys = Arrays.<Object>asList(object.getName(), timeoutSetName); return ((RedissonObject)object).sizeInMemoryAsync(keys); }
public MoveOperation(RObject set, String destinationName, long threadId, Object value, String transactionId) { this(set.getName(), set.getCodec(), destinationName, threadId, value, transactionId); }
public RemoveOperation(RObject set, Object value, String transactionId) { this(set.getName(), set.getCodec(), value, transactionId); }
public MoveOperation(RObject set, String destinationName, long threadId, Object value, String transactionId) { this(set.getName(), set.getCodec(), destinationName, threadId, value, transactionId); }
public AddOperation(RObject set, Object value, String transactionId) { this(set.getName(), set.getCodec(), value, transactionId); }
public void store(RObject ar, String fieldName, RMap<String, Object> liveMap) { Codec codec = ar.getCodec(); if (codec != null) { codecProvider.registerCodec((Class) codec.getClass(), codec); } liveMap.fastPut(fieldName, new RedissonReference(ar.getClass(), ar.getName(), codec)); }
public void store(RObject ar, String fieldName, RMap<String, Object> liveMap) { Codec codec = ar.getCodec(); if (codec != null) { codecProvider.registerCodec((Class) codec.getClass(), codec); } liveMap.fastPut(fieldName, new RedissonReference(ar.getClass(), ar.getName(), codec)); }