@Override public RFuture<BatchResult<?>> executeAsync() { return executorService.executeAsync(BatchOptions.defaults()); }
protected boolean isRedisBasedQueue() { return options != null && (this.options.getExecutionMode() == ExecutionMode.REDIS_READ_ATOMIC || this.options.getExecutionMode() == ExecutionMode.REDIS_WRITE_ATOMIC); }
@Override public void openPipeline() { BatchOptions options = BatchOptions.defaults() .executionMode(ExecutionMode.IN_MEMORY); this.executorService = new CommandBatchService(redisson.getConnectionManager(), options); }
@Override public void operationComplete(Future<RedisConnection> connFuture) throws Exception { checkConnectionFuture(entry, source, mainPromise, attemptPromise, details, connectionFuture, options.isSkipResult(), options.getResponseTimeout(), attempts, options.getExecutionMode(), slots); } });
private BatchOptions createOptions() { int syncSlaves = 0; if (!commandExecutor.getConnectionManager().isClusterMode()) { MasterSlaveEntry entry = commandExecutor.getConnectionManager().getEntrySet().iterator().next(); syncSlaves = entry.getAvailableClients() - 1; } BatchOptions batchOptions = BatchOptions.defaults() .syncSlaves(syncSlaves, options.getSyncTimeout(), TimeUnit.MILLISECONDS) .responseTimeout(options.getResponseTimeout(), TimeUnit.MILLISECONDS) .retryAttempts(options.getRetryAttempts()) .retryInterval(options.getRetryInterval(), TimeUnit.MILLISECONDS) .atomic(); return batchOptions; }
if (this.options.getExecutionMode() != ExecutionMode.IN_MEMORY) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> multiCommand = new BatchCommandData(RedisCommands.MULTI, new Object[] {}, index.incrementAndGet()); if (this.options.isSkipResult()) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> offCommand = new BatchCommandData(RedisCommands.CLIENT_REPLY, new Object[] { "OFF" }, index.incrementAndGet()); if (this.options.getSyncSlaves() > 0) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> waitCommand = new BatchCommandData(RedisCommands.WAIT, new Object[] { this.options.getSyncSlaves(), this.options.getSyncTimeout() }, index.incrementAndGet()); entry.getCommands().add(waitCommand); if (this.options.isSkipResult()) { voidPromise.addListener(new FutureListener<Void>() { @Override
if (options.getRetryAttempts() > 0) { attempts = options.getRetryAttempts(); } else { attempts = connectionManager.getConfig().getRetryAttempts(); if (options.getRetryInterval() > 0) { interval = options.getRetryInterval(); } else { interval = connectionManager.getConfig().getRetryInterval();
@Override public RBatch atomic() { options.atomic(); return this; }
public static BatchOptions defaults() { return new BatchOptions(); }
private BatchOptions createOptions() { int syncSlaves = 0; if (!commandExecutor.getConnectionManager().isClusterMode()) { MasterSlaveEntry entry = commandExecutor.getConnectionManager().getEntrySet().iterator().next(); syncSlaves = entry.getAvailableClients() - 1; } BatchOptions batchOptions = BatchOptions.defaults() .syncSlaves(syncSlaves, options.getSyncTimeout(), TimeUnit.MILLISECONDS) .responseTimeout(options.getResponseTimeout(), TimeUnit.MILLISECONDS) .retryAttempts(options.getRetryAttempts()) .retryInterval(options.getRetryInterval(), TimeUnit.MILLISECONDS) .atomic(); return batchOptions; }
if (this.options.getExecutionMode() != ExecutionMode.IN_MEMORY) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> multiCommand = new BatchCommandData(RedisCommands.MULTI, new Object[] {}, index.incrementAndGet()); if (this.options.isSkipResult()) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> offCommand = new BatchCommandData(RedisCommands.CLIENT_REPLY, new Object[] { "OFF" }, index.incrementAndGet()); if (this.options.getSyncSlaves() > 0) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> waitCommand = new BatchCommandData(RedisCommands.WAIT, new Object[] { this.options.getSyncSlaves(), this.options.getSyncTimeout() }, index.incrementAndGet()); entry.getCommands().add(waitCommand); if (this.options.isSkipResult()) { voidPromise.addListener(new FutureListener<Void>() { @Override
@Override public void operationComplete(Future<RedisConnection> connFuture) throws Exception { checkConnectionFuture(entry, source, mainPromise, attemptPromise, details, connectionFuture, options.isSkipResult(), options.getResponseTimeout(), attempts, options.getExecutionMode(), slots); } });
if (options.getRetryAttempts() > 0) { attempts = options.getRetryAttempts(); } else { attempts = connectionManager.getConfig().getRetryAttempts(); if (options.getRetryInterval() > 0) { interval = options.getRetryInterval(); } else { interval = connectionManager.getConfig().getRetryInterval();
@Override public RBatch atomic() { options.atomic(); return this; }
public static BatchOptions defaults() { return new BatchOptions(); }
@Override public RBatchReactive createBatch() { return createBatch(BatchOptions.defaults()); }
@Override public void openPipeline() { BatchOptions options = BatchOptions.defaults() .executionMode(ExecutionMode.IN_MEMORY); this.executorService = new CommandBatchService(redisson.getConnectionManager(), options); }
private BatchOptions createOptions() { int syncSlaves = 0; if (!commandExecutor.getConnectionManager().isClusterMode()) { MasterSlaveEntry entry = commandExecutor.getConnectionManager().getEntrySet().iterator().next(); syncSlaves = entry.getAvailableClients() - 1; } BatchOptions batchOptions = BatchOptions.defaults() .syncSlaves(syncSlaves, options.getSyncTimeout(), TimeUnit.MILLISECONDS) .responseTimeout(options.getResponseTimeout(), TimeUnit.MILLISECONDS) .retryAttempts(options.getRetryAttempts()) .retryInterval(options.getRetryInterval(), TimeUnit.MILLISECONDS) .atomic(); return batchOptions; }
protected boolean isRedisBasedQueue() { return options != null && (this.options.getExecutionMode() == ExecutionMode.REDIS_READ_ATOMIC || this.options.getExecutionMode() == ExecutionMode.REDIS_WRITE_ATOMIC); }
if (this.options.getExecutionMode() != ExecutionMode.IN_MEMORY) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> multiCommand = new BatchCommandData(RedisCommands.MULTI, new Object[] {}, index.incrementAndGet()); if (this.options.isSkipResult()) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> offCommand = new BatchCommandData(RedisCommands.CLIENT_REPLY, new Object[] { "OFF" }, index.incrementAndGet()); if (this.options.getSyncSlaves() > 0) { for (Entry entry : commands.values()) { BatchCommandData<?, ?> waitCommand = new BatchCommandData(RedisCommands.WAIT, new Object[] { this.options.getSyncSlaves(), this.options.getSyncTimeout() }, index.incrementAndGet()); entry.getCommands().add(waitCommand); if (this.options.isSkipResult()) { voidPromise.addListener(new FutureListener<Void>() { @Override