From 901a5a797b6c376705f1109659d809497bcd82a1 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Fri, 15 Feb 2019 15:33:28 +0300 Subject: [PATCH] Code formatted according to checkstyle rules --- redisson/pom.xml | 2 +- .../org/redisson/RedissonBlockingDeque.java | 12 ++-- .../org/redisson/RedissonBlockingQueue.java | 4 +- .../RedissonBoundedBlockingQueue.java | 4 +- .../org/redisson/RedissonExecutorService.java | 15 ++-- .../main/java/org/redisson/RedissonKeys.java | 14 ++-- .../main/java/org/redisson/RedissonList.java | 4 +- .../redisson/RedissonListMultimapValues.java | 4 +- .../org/redisson/RedissonLocalCachedMap.java | 2 +- .../main/java/org/redisson/RedissonMap.java | 4 +- .../java/org/redisson/RedissonMapCache.java | 2 +- .../java/org/redisson/RedissonMultimap.java | 4 +- .../RedissonPriorityBlockingDeque.java | 10 +-- .../RedissonPriorityBlockingQueue.java | 4 +- .../org/redisson/RedissonPriorityQueue.java | 2 +- .../org/redisson/RedissonScoredSortedSet.java | 8 +-- .../java/org/redisson/RedissonScript.java | 8 +-- .../java/org/redisson/RedissonStream.java | 2 +- .../java/org/redisson/api/BatchOptions.java | 2 +- .../org/redisson/api/ExecutorOptions.java | 2 +- .../src/main/java/org/redisson/api/Node.java | 2 +- .../java/org/redisson/api/RBlockingDeque.java | 4 +- .../org/redisson/api/RBlockingDequeAsync.java | 4 +- .../redisson/api/RBlockingDequeReactive.java | 4 +- .../org/redisson/api/RBlockingDequeRx.java | 4 +- .../java/org/redisson/api/RBlockingQueue.java | 2 +- .../org/redisson/api/RBlockingQueueAsync.java | 2 +- .../redisson/api/RBlockingQueueReactive.java | 2 +- .../org/redisson/api/RBlockingQueueRx.java | 2 +- .../main/java/org/redisson/api/RBuckets.java | 2 +- .../java/org/redisson/api/RBucketsAsync.java | 2 +- .../org/redisson/api/RExecutorService.java | 6 +- .../redisson/api/RExecutorServiceAsync.java | 4 +- .../java/org/redisson/api/RHyperLogLog.java | 4 +- .../org/redisson/api/RHyperLogLogAsync.java | 4 +- .../redisson/api/RHyperLogLogReactive.java | 4 +- .../java/org/redisson/api/RHyperLogLogRx.java | 4 +- .../src/main/java/org/redisson/api/RKeys.java | 6 +- .../java/org/redisson/api/RKeysAsync.java | 6 +- .../java/org/redisson/api/RKeysReactive.java | 4 +- .../main/java/org/redisson/api/RKeysRx.java | 4 +- .../src/main/java/org/redisson/api/RList.java | 2 +- .../java/org/redisson/api/RListAsync.java | 2 +- .../java/org/redisson/api/RListReactive.java | 2 +- .../main/java/org/redisson/api/RListRx.java | 2 +- .../src/main/java/org/redisson/api/RMap.java | 2 +- .../main/java/org/redisson/api/RMapAsync.java | 2 +- .../java/org/redisson/api/RMapReactive.java | 2 +- .../main/java/org/redisson/api/RMapRx.java | 2 +- .../main/java/org/redisson/api/RMultimap.java | 2 +- .../java/org/redisson/api/RMultimapAsync.java | 6 +- .../org/redisson/api/RMultimapReactive.java | 2 +- .../java/org/redisson/api/RMultimapRx.java | 2 +- .../org/redisson/api/RScoredSortedSet.java | 6 +- .../redisson/api/RScoredSortedSetAsync.java | 4 +- .../api/RScoredSortedSetReactive.java | 4 +- .../org/redisson/api/RScoredSortedSetRx.java | 4 +- .../main/java/org/redisson/api/RScript.java | 4 +- .../java/org/redisson/api/RScriptAsync.java | 4 +- .../org/redisson/api/RScriptReactive.java | 2 +- .../main/java/org/redisson/api/RScriptRx.java | 2 +- .../main/java/org/redisson/api/RSortable.java | 20 +++--- .../java/org/redisson/api/RSortableAsync.java | 22 +++--- .../main/java/org/redisson/api/RStream.java | 20 +++--- .../java/org/redisson/api/RStreamAsync.java | 22 +++--- .../org/redisson/api/RStreamReactive.java | 20 +++--- .../main/java/org/redisson/api/RStreamRx.java | 20 +++--- .../org/redisson/api/TransactionOptions.java | 2 +- .../org/redisson/api/annotation/REntity.java | 4 +- .../redisson/api/annotation/RObjectField.java | 7 +- .../org/redisson/client/RedisConnection.java | 14 ++-- .../client/RedisPubSubConnection.java | 10 +-- .../client/handler/CommandDecoder.java | 5 +- .../protocol/decoder/ListMultiDecoder.java | 4 +- .../cluster/ClusterConnectionManager.java | 2 +- .../java/org/redisson/codec/SnappyCodec.java | 5 +- .../command/CommandAsyncExecutor.java | 42 +++++------ .../redisson/command/CommandAsyncService.java | 2 +- .../redisson/command/CommandSyncExecutor.java | 12 ++-- .../redisson/command/CommandSyncService.java | 12 ++-- .../redisson/config/ClusterServersConfig.java | 2 +- .../config/MasterSlaveServersConfig.java | 2 +- .../config/ReplicatedServersConfig.java | 2 +- .../config/SentinelServersConfig.java | 2 +- .../redisson/connection/MasterSlaveEntry.java | 70 ++++++++----------- .../main/java/org/redisson/jcache/JCache.java | 6 +- .../org/redisson/misc/CompositeIterable.java | 2 +- 87 files changed, 279 insertions(+), 295 deletions(-) diff --git a/redisson/pom.xml b/redisson/pom.xml index faf948f72..1c9d1315b 100644 --- a/redisson/pom.xml +++ b/redisson/pom.xml @@ -355,7 +355,7 @@ verify - checkstyle + check diff --git a/redisson/src/main/java/org/redisson/RedissonBlockingDeque.java b/redisson/src/main/java/org/redisson/RedissonBlockingDeque.java index 15d349a0a..de5441af6 100644 --- a/redisson/src/main/java/org/redisson/RedissonBlockingDeque.java +++ b/redisson/src/main/java/org/redisson/RedissonBlockingDeque.java @@ -101,7 +101,7 @@ public class RedissonBlockingDeque extends RedissonDeque implements RBlock * @see org.redisson.core.RBlockingQueue#pollFromAny(long, java.util.concurrent.TimeUnit, java.lang.String[]) */ @Override - public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { return blockingQueue.pollFromAny(timeout, unit); } @@ -110,7 +110,7 @@ public class RedissonBlockingDeque extends RedissonDeque implements RBlock * @see org.redisson.core.RBlockingQueueAsync#pollFromAnyAsync(long, java.util.concurrent.TimeUnit, java.lang.String[]) */ @Override - public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { return blockingQueue.pollFromAnyAsync(timeout, unit); } @@ -217,22 +217,22 @@ public class RedissonBlockingDeque extends RedissonDeque implements RBlock } @Override - public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { return get(pollFirstFromAnyAsync(timeout, unit, queueNames)); } @Override - public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { return pollFromAnyAsync(timeout, unit, queueNames); } @Override - public V pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { return get(pollLastFromAnyAsync(timeout, unit, queueNames)); } @Override - public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { return commandExecutor.pollFromAnyAsync(getName(), codec, RedisCommands.BRPOP_VALUE, toSeconds(timeout, unit), queueNames); } diff --git a/redisson/src/main/java/org/redisson/RedissonBlockingQueue.java b/redisson/src/main/java/org/redisson/RedissonBlockingQueue.java index d4d753de0..4f25ba2f6 100644 --- a/redisson/src/main/java/org/redisson/RedissonBlockingQueue.java +++ b/redisson/src/main/java/org/redisson/RedissonBlockingQueue.java @@ -99,7 +99,7 @@ public class RedissonBlockingQueue extends RedissonQueue implements RBlock * @see org.redisson.core.RBlockingQueue#pollFromAny(long, java.util.concurrent.TimeUnit, java.lang.String[]) */ @Override - public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { return get(pollFromAnyAsync(timeout, unit, queueNames)); } @@ -108,7 +108,7 @@ public class RedissonBlockingQueue extends RedissonQueue implements RBlock * @see org.redisson.core.RBlockingQueueAsync#pollFromAnyAsync(long, java.util.concurrent.TimeUnit, java.lang.String[]) */ @Override - public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { return commandExecutor.pollFromAnyAsync(getName(), codec, RedisCommands.BLPOP_VALUE, toSeconds(timeout, unit), queueNames); } diff --git a/redisson/src/main/java/org/redisson/RedissonBoundedBlockingQueue.java b/redisson/src/main/java/org/redisson/RedissonBoundedBlockingQueue.java index c86555944..294dc635d 100644 --- a/redisson/src/main/java/org/redisson/RedissonBoundedBlockingQueue.java +++ b/redisson/src/main/java/org/redisson/RedissonBoundedBlockingQueue.java @@ -222,7 +222,7 @@ public class RedissonBoundedBlockingQueue extends RedissonQueue implements * @see org.redisson.core.RBlockingQueue#pollFromAny(long, java.util.concurrent.TimeUnit, java.lang.String[]) */ @Override - public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { return get(pollFromAnyAsync(timeout, unit, queueNames)); } @@ -231,7 +231,7 @@ public class RedissonBoundedBlockingQueue extends RedissonQueue implements * @see org.redisson.core.RBlockingQueueAsync#pollFromAnyAsync(long, java.util.concurrent.TimeUnit, java.lang.String[]) */ @Override - public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { RFuture takeFuture = commandExecutor.pollFromAnyAsync(getName(), codec, RedisCommands.BLPOP_VALUE, toSeconds(timeout, unit), queueNames); return wrapTakeFuture(takeFuture); } diff --git a/redisson/src/main/java/org/redisson/RedissonExecutorService.java b/redisson/src/main/java/org/redisson/RedissonExecutorService.java index 3abd4ad89..9f33ab968 100644 --- a/redisson/src/main/java/org/redisson/RedissonExecutorService.java +++ b/redisson/src/main/java/org/redisson/RedissonExecutorService.java @@ -328,7 +328,7 @@ public class RedissonExecutorService implements RScheduledExecutorService { } @Override - public void execute(Runnable ...tasks) { + public void execute(Runnable...tasks) { if (tasks.length == 0) { throw new NullPointerException("Tasks are not defined"); } @@ -574,7 +574,7 @@ public class RedissonExecutorService implements RScheduledExecutorService { } @Override - public RExecutorBatchFuture submit(Callable ...tasks) { + public RExecutorBatchFuture submit(Callable...tasks) { if (tasks.length == 0) { throw new NullPointerException("Tasks are not defined"); } @@ -600,7 +600,7 @@ public class RedissonExecutorService implements RScheduledExecutorService { } @Override - public RExecutorBatchFuture submitAsync(Callable ...tasks) { + public RExecutorBatchFuture submitAsync(Callable...tasks) { if (tasks.length == 0) { throw new NullPointerException("Tasks are not defined"); } @@ -690,7 +690,7 @@ public class RedissonExecutorService implements RScheduledExecutorService { } @Override - public RExecutorBatchFuture submit(Runnable ...tasks) { + public RExecutorBatchFuture submit(Runnable...tasks) { if (tasks.length == 0) { throw new NullPointerException("Tasks are not defined"); } @@ -716,7 +716,7 @@ public class RedissonExecutorService implements RScheduledExecutorService { } @Override - public RExecutorBatchFuture submitAsync(Runnable ...tasks) { + public RExecutorBatchFuture submitAsync(Runnable...tasks) { if (tasks.length == 0) { throw new NullPointerException("Tasks are not defined"); } @@ -979,11 +979,6 @@ public class RedissonExecutorService implements RScheduledExecutorService { private RFuture poll(List> futures, long timeout, TimeUnit timeUnit) throws InterruptedException { CountDownLatch latch = new CountDownLatch(1); AtomicReference> result = new AtomicReference<>(); - BiConsumer listener = new BiConsumer() { - @Override - public void accept(T t, Throwable u) { - } - }; for (Future future : futures) { RFuture f = (RFuture) future; f.onComplete((r, e) -> { diff --git a/redisson/src/main/java/org/redisson/RedissonKeys.java b/redisson/src/main/java/org/redisson/RedissonKeys.java index 4585aed5e..9f2c9d922 100644 --- a/redisson/src/main/java/org/redisson/RedissonKeys.java +++ b/redisson/src/main/java/org/redisson/RedissonKeys.java @@ -259,17 +259,17 @@ public class RedissonKeys implements RKeys { } @Override - public long delete(String ... keys) { + public long delete(String... keys) { return commandExecutor.get(deleteAsync(keys)); } @Override - public long delete(RObject ... objects) { + public long delete(RObject... objects) { return commandExecutor.get(deleteAsync(objects)); } @Override - public RFuture deleteAsync(RObject ... objects) { + public RFuture deleteAsync(RObject... objects) { List keys = new ArrayList(); for (RObject obj : objects) { keys.add(obj.getName()); @@ -279,21 +279,21 @@ public class RedissonKeys implements RKeys { } @Override - public long unlink(String ... keys) { + public long unlink(String... keys) { return commandExecutor.get(deleteAsync(keys)); } @Override - public RFuture unlinkAsync(String ... keys) { + public RFuture unlinkAsync(String... keys) { return executeAsync(RedisCommands.UNLINK, keys); } @Override - public RFuture deleteAsync(String ... keys) { + public RFuture deleteAsync(String... keys) { return executeAsync(RedisCommands.DEL, keys); } - private RFuture executeAsync(RedisStrictCommand command, String ... keys) { + private RFuture executeAsync(RedisStrictCommand command, String... keys) { if (!commandExecutor.getConnectionManager().isClusterMode()) { return commandExecutor.writeAsync(null, command, keys); } diff --git a/redisson/src/main/java/org/redisson/RedissonList.java b/redisson/src/main/java/org/redisson/RedissonList.java index 76065669c..ee6260e50 100644 --- a/redisson/src/main/java/org/redisson/RedissonList.java +++ b/redisson/src/main/java/org/redisson/RedissonList.java @@ -308,11 +308,11 @@ public class RedissonList extends RedissonExpirable implements RList { return commandExecutor.readAsync(getName(), codec, LINDEX, getName(), index); } - public List get(int ...indexes) { + public List get(int...indexes) { return get(getAsync(indexes)); } - public RFuture> getAsync(int ...indexes) { + public RFuture> getAsync(int...indexes) { List params = new ArrayList(); for (Integer index : indexes) { params.add(index); diff --git a/redisson/src/main/java/org/redisson/RedissonListMultimapValues.java b/redisson/src/main/java/org/redisson/RedissonListMultimapValues.java index cd4d25bad..35db3f32a 100644 --- a/redisson/src/main/java/org/redisson/RedissonListMultimapValues.java +++ b/redisson/src/main/java/org/redisson/RedissonListMultimapValues.java @@ -365,12 +365,12 @@ public class RedissonListMultimapValues extends RedissonExpirable implements } @Override - public List get(int ...indexes) { + public List get(int...indexes) { return get(getAsync(indexes)); } @Override - public RFuture> getAsync(int ...indexes) { + public RFuture> getAsync(int...indexes) { List params = new ArrayList(); params.add(System.currentTimeMillis()); params.add(encodeMapKey(key)); diff --git a/redisson/src/main/java/org/redisson/RedissonLocalCachedMap.java b/redisson/src/main/java/org/redisson/RedissonLocalCachedMap.java index b5a693d93..e55a37a97 100644 --- a/redisson/src/main/java/org/redisson/RedissonLocalCachedMap.java +++ b/redisson/src/main/java/org/redisson/RedissonLocalCachedMap.java @@ -447,7 +447,7 @@ public class RedissonLocalCachedMap extends RedissonMap implements R } @Override - protected RFuture fastRemoveOperationAsync(K ... keys) { + protected RFuture fastRemoveOperationAsync(K... keys) { if (invalidateEntryOnChange == 1) { List params = new ArrayList(keys.length*2); diff --git a/redisson/src/main/java/org/redisson/RedissonMap.java b/redisson/src/main/java/org/redisson/RedissonMap.java index 7bdc0337f..06924b648 100644 --- a/redisson/src/main/java/org/redisson/RedissonMap.java +++ b/redisson/src/main/java/org/redisson/RedissonMap.java @@ -1028,7 +1028,7 @@ public class RedissonMap extends RedissonExpirable implements RMap { } @Override - public RFuture fastRemoveAsync(K ... keys) { + public RFuture fastRemoveAsync(K... keys) { if (keys == null) { throw new NullPointerException(); } @@ -1112,7 +1112,7 @@ public class RedissonMap extends RedissonExpirable implements RMap { } @Override - public long fastRemove(K ... keys) { + public long fastRemove(K... keys) { return get(fastRemoveAsync(keys)); } diff --git a/redisson/src/main/java/org/redisson/RedissonMapCache.java b/redisson/src/main/java/org/redisson/RedissonMapCache.java index 0eaf08397..8de8ade0d 100644 --- a/redisson/src/main/java/org/redisson/RedissonMapCache.java +++ b/redisson/src/main/java/org/redisson/RedissonMapCache.java @@ -1213,7 +1213,7 @@ public class RedissonMapCache extends RedissonMap implements RMapCac } @Override - protected RFuture fastRemoveOperationAsync(K ... keys) { + protected RFuture fastRemoveOperationAsync(K... keys) { List params = new ArrayList(keys.length); for (K key : keys) { params.add(encodeMapKey(key)); diff --git a/redisson/src/main/java/org/redisson/RedissonMultimap.java b/redisson/src/main/java/org/redisson/RedissonMultimap.java index 51db2e3e7..30bef2719 100644 --- a/redisson/src/main/java/org/redisson/RedissonMultimap.java +++ b/redisson/src/main/java/org/redisson/RedissonMultimap.java @@ -195,12 +195,12 @@ public abstract class RedissonMultimap extends RedissonExpirable implement } @Override - public long fastRemove(K ... keys) { + public long fastRemove(K... keys) { return get(fastRemoveAsync(keys)); } @Override - public RFuture fastRemoveAsync(K ... keys) { + public RFuture fastRemoveAsync(K... keys) { if (keys == null || keys.length == 0) { return RedissonPromise.newSucceededFuture(0L); } diff --git a/redisson/src/main/java/org/redisson/RedissonPriorityBlockingDeque.java b/redisson/src/main/java/org/redisson/RedissonPriorityBlockingDeque.java index b131e3a61..f2b065af4 100644 --- a/redisson/src/main/java/org/redisson/RedissonPriorityBlockingDeque.java +++ b/redisson/src/main/java/org/redisson/RedissonPriorityBlockingDeque.java @@ -80,7 +80,7 @@ public class RedissonPriorityBlockingDeque extends RedissonPriorityDeque i } @Override - public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { throw new UnsupportedOperationException("use poll method"); } @@ -201,22 +201,22 @@ public class RedissonPriorityBlockingDeque extends RedissonPriorityDeque i } @Override - public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { return get(pollFirstFromAnyAsync(timeout, unit, queueNames)); } @Override - public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { return pollFromAnyAsync(timeout, unit, queueNames); } @Override - public V pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { return get(pollLastFromAnyAsync(timeout, unit, queueNames)); } @Override - public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { throw new UnsupportedOperationException(); } diff --git a/redisson/src/main/java/org/redisson/RedissonPriorityBlockingQueue.java b/redisson/src/main/java/org/redisson/RedissonPriorityBlockingQueue.java index 5d122681c..ad9fe8952 100644 --- a/redisson/src/main/java/org/redisson/RedissonPriorityBlockingQueue.java +++ b/redisson/src/main/java/org/redisson/RedissonPriorityBlockingQueue.java @@ -68,7 +68,7 @@ public class RedissonPriorityBlockingQueue extends RedissonPriorityQueue i return result; } - protected void takeAsync(RPromise result, long delay, long timeoutInMicro, RedisCommand command, Object ... params) { + protected void takeAsync(RPromise result, long delay, long timeoutInMicro, RedisCommand command, Object... params) { long start = System.currentTimeMillis(); commandExecutor.getConnectionManager().getGroup().schedule(() -> { RFuture future = pollAsync(command, params); @@ -123,7 +123,7 @@ public class RedissonPriorityBlockingQueue extends RedissonPriorityQueue i } @Override - public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException { throw new UnsupportedOperationException("use poll method"); } diff --git a/redisson/src/main/java/org/redisson/RedissonPriorityQueue.java b/redisson/src/main/java/org/redisson/RedissonPriorityQueue.java index e6bad585d..0a7f150d5 100644 --- a/redisson/src/main/java/org/redisson/RedissonPriorityQueue.java +++ b/redisson/src/main/java/org/redisson/RedissonPriorityQueue.java @@ -288,7 +288,7 @@ public class RedissonPriorityQueue extends RedissonList implements RPriori return pollAsync(RedisCommands.LPOP, getName()); } - protected RFuture pollAsync(RedisCommand command, Object ... params) { + protected RFuture pollAsync(RedisCommand command, Object... params) { long threadId = Thread.currentThread().getId(); RPromise result = new RedissonPromise(); lock.lockAsync(threadId).onComplete((r, exc) -> { diff --git a/redisson/src/main/java/org/redisson/RedissonScoredSortedSet.java b/redisson/src/main/java/org/redisson/RedissonScoredSortedSet.java index 00ed4003b..160b1af91 100644 --- a/redisson/src/main/java/org/redisson/RedissonScoredSortedSet.java +++ b/redisson/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -150,22 +150,22 @@ public class RedissonScoredSortedSet extends RedissonExpirable implements RSc } @Override - public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) { + public V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) { return get(pollFirstFromAnyAsync(timeout, unit, queueNames)); } @Override - public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { return commandExecutor.pollFromAnyAsync(getName(), codec, RedisCommands.BZPOPMIN_VALUE, toSeconds(timeout, unit), queueNames); } @Override - public V pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames) { + public V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) { return get(pollLastFromAnyAsync(timeout, unit, queueNames)); } @Override - public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) { return commandExecutor.pollFromAnyAsync(getName(), codec, RedisCommands.BZPOPMAX_VALUE, toSeconds(timeout, unit), queueNames); } diff --git a/redisson/src/main/java/org/redisson/RedissonScript.java b/redisson/src/main/java/org/redisson/RedissonScript.java index 5d31d0016..485cbc6fa 100644 --- a/redisson/src/main/java/org/redisson/RedissonScript.java +++ b/redisson/src/main/java/org/redisson/RedissonScript.java @@ -176,12 +176,12 @@ public class RedissonScript implements RScript { } @Override - public List scriptExists(String ... shaDigests) { + public List scriptExists(String... shaDigests) { return commandExecutor.get(scriptExistsAsync(shaDigests)); } @Override - public RFuture> scriptExistsAsync(final String ... shaDigests) { + public RFuture> scriptExistsAsync(final String... shaDigests) { return commandExecutor.writeAllAsync(RedisCommands.SCRIPT_EXISTS, new SlotCallback, List>() { volatile List result = new ArrayList(shaDigests.length); @Override @@ -201,11 +201,11 @@ public class RedissonScript implements RScript { }, (Object[])shaDigests); } - public List scriptExists(String key, String ... shaDigests) { + public List scriptExists(String key, String... shaDigests) { return commandExecutor.get(scriptExistsAsync(key, shaDigests)); } - public RFuture> scriptExistsAsync(String key, String ... shaDigests) { + public RFuture> scriptExistsAsync(String key, String... shaDigests) { return commandExecutor.writeAsync(key, RedisCommands.SCRIPT_EXISTS, shaDigests); } diff --git a/redisson/src/main/java/org/redisson/RedissonStream.java b/redisson/src/main/java/org/redisson/RedissonStream.java index 526b9c2bc..c8ff46f38 100644 --- a/redisson/src/main/java/org/redisson/RedissonStream.java +++ b/redisson/src/main/java/org/redisson/RedissonStream.java @@ -758,7 +758,7 @@ public class RedissonStream extends RedissonExpirable implements RStream> read(int count, StreamMessageId ... ids) { + public Map> read(int count, StreamMessageId... ids) { return get(readAsync(count, ids)); } diff --git a/redisson/src/main/java/org/redisson/api/BatchOptions.java b/redisson/src/main/java/org/redisson/api/BatchOptions.java index 2e57441dc..b6759c045 100644 --- a/redisson/src/main/java/org/redisson/api/BatchOptions.java +++ b/redisson/src/main/java/org/redisson/api/BatchOptions.java @@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit; * @author Nikita Koksharov * */ -public class BatchOptions { +public final class BatchOptions { public enum ExecutionMode { diff --git a/redisson/src/main/java/org/redisson/api/ExecutorOptions.java b/redisson/src/main/java/org/redisson/api/ExecutorOptions.java index 12ac0973f..cd113776e 100644 --- a/redisson/src/main/java/org/redisson/api/ExecutorOptions.java +++ b/redisson/src/main/java/org/redisson/api/ExecutorOptions.java @@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit; * @author Nikita Koksharov * */ -public class ExecutorOptions { +public final class ExecutorOptions { private long taskRetryInterval = 5 * 60000; diff --git a/redisson/src/main/java/org/redisson/api/Node.java b/redisson/src/main/java/org/redisson/api/Node.java index 43b59ba93..0df90be38 100644 --- a/redisson/src/main/java/org/redisson/api/Node.java +++ b/redisson/src/main/java/org/redisson/api/Node.java @@ -28,7 +28,7 @@ import org.redisson.client.protocol.Time; */ public interface Node extends NodeAsync { - public enum InfoSection {ALL, DEFAULT, SERVER, CLIENTS, MEMORY, PERSISTENCE, STATS, REPLICATION, CPU, COMMANDSTATS, CLUSTER, KEYSPACE} + enum InfoSection {ALL, DEFAULT, SERVER, CLIENTS, MEMORY, PERSISTENCE, STATS, REPLICATION, CPU, COMMANDSTATS, CLUSTER, KEYSPACE} Map info(InfoSection section); diff --git a/redisson/src/main/java/org/redisson/api/RBlockingDeque.java b/redisson/src/main/java/org/redisson/api/RBlockingDeque.java index ed26669a0..3791321b3 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingDeque.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingDeque.java @@ -40,7 +40,7 @@ public interface RBlockingDeque extends BlockingDeque, RBlockingQueue, * specified waiting time elapses before an element is available * @throws InterruptedException if interrupted while waiting */ - V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException; + V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException; /** * Retrieves and removes first available tail element of any queue, @@ -56,6 +56,6 @@ public interface RBlockingDeque extends BlockingDeque, RBlockingQueue, * specified waiting time elapses before an element is available * @throws InterruptedException if interrupted while waiting */ - V pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException; + V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException; } diff --git a/redisson/src/main/java/org/redisson/api/RBlockingDequeAsync.java b/redisson/src/main/java/org/redisson/api/RBlockingDequeAsync.java index f7e00f0c1..5d8f5e15f 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingDequeAsync.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingDequeAsync.java @@ -39,7 +39,7 @@ public interface RBlockingDequeAsync extends RDequeAsync, RBlockingQueueAs * @return the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames); + RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames); /** * Retrieves and removes first available tail element of any queue in async mode, @@ -54,7 +54,7 @@ public interface RBlockingDequeAsync extends RDequeAsync, RBlockingQueueAs * @return the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames); + RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames); /** * Adds value to the head of queue. diff --git a/redisson/src/main/java/org/redisson/api/RBlockingDequeReactive.java b/redisson/src/main/java/org/redisson/api/RBlockingDequeReactive.java index c3608d574..0f63fbc0d 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingDequeReactive.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingDequeReactive.java @@ -41,7 +41,7 @@ public interface RBlockingDequeReactive extends RDequeReactive, RBlockingQ * @return the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - Mono pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames); + Mono pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Retrieves and removes first available tail element of any queue in reactive mode, @@ -56,7 +56,7 @@ public interface RBlockingDequeReactive extends RDequeReactive, RBlockingQ * @return the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - Mono pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames); + Mono pollLastFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Adds value to the head of queue. diff --git a/redisson/src/main/java/org/redisson/api/RBlockingDequeRx.java b/redisson/src/main/java/org/redisson/api/RBlockingDequeRx.java index b0682166e..74a101cda 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingDequeRx.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingDequeRx.java @@ -40,7 +40,7 @@ public interface RBlockingDequeRx extends RDequeRx, RBlockingQueueRx { * @return the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - Flowable pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames); + Flowable pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Retrieves and removes first available tail element of any queue in reactive mode, @@ -55,7 +55,7 @@ public interface RBlockingDequeRx extends RDequeRx, RBlockingQueueRx { * @return the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - Flowable pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames); + Flowable pollLastFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Adds value to the head of queue. diff --git a/redisson/src/main/java/org/redisson/api/RBlockingQueue.java b/redisson/src/main/java/org/redisson/api/RBlockingQueue.java index 919c30825..399cbae76 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingQueue.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingQueue.java @@ -40,7 +40,7 @@ public interface RBlockingQueue extends BlockingQueue, RQueue, RBlockin * specified waiting time elapses before an element is available * @throws InterruptedException if interrupted while waiting */ - V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException; + V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException; /** * Retrieves and removes last available tail element of any queue and adds it at the head of queueName, diff --git a/redisson/src/main/java/org/redisson/api/RBlockingQueueAsync.java b/redisson/src/main/java/org/redisson/api/RBlockingQueueAsync.java index cf8465f2d..6506509c1 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingQueueAsync.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingQueueAsync.java @@ -40,7 +40,7 @@ public interface RBlockingQueueAsync extends RQueueAsync { * @return Future object with the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames); + RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames); /** * Removes at most the given number of available elements from diff --git a/redisson/src/main/java/org/redisson/api/RBlockingQueueReactive.java b/redisson/src/main/java/org/redisson/api/RBlockingQueueReactive.java index 4602fa74d..c1718185d 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingQueueReactive.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingQueueReactive.java @@ -42,7 +42,7 @@ public interface RBlockingQueueReactive extends RQueueReactive { * @return Mono object with the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - Mono pollFromAny(long timeout, TimeUnit unit, String ... queueNames); + Mono pollFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes at most the given number of available elements from diff --git a/redisson/src/main/java/org/redisson/api/RBlockingQueueRx.java b/redisson/src/main/java/org/redisson/api/RBlockingQueueRx.java index 5ce3413ee..e75348047 100644 --- a/redisson/src/main/java/org/redisson/api/RBlockingQueueRx.java +++ b/redisson/src/main/java/org/redisson/api/RBlockingQueueRx.java @@ -41,7 +41,7 @@ public interface RBlockingQueueRx extends RQueueRx { * @return Flowable object with the head of this queue, or {@code null} if the * specified waiting time elapses before an element is available */ - Flowable pollFromAny(long timeout, TimeUnit unit, String ... queueNames); + Flowable pollFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes at most the given number of available elements from diff --git a/redisson/src/main/java/org/redisson/api/RBuckets.java b/redisson/src/main/java/org/redisson/api/RBuckets.java index 7349fb8eb..181f02e83 100644 --- a/redisson/src/main/java/org/redisson/api/RBuckets.java +++ b/redisson/src/main/java/org/redisson/api/RBuckets.java @@ -33,7 +33,7 @@ public interface RBuckets extends RBucketsAsync { * @param keys - keys * @return Map with name of bucket as key and bucket as value */ - Map get(String ... keys); + Map get(String... keys); /** * Try to save objects mapped by Redis key. diff --git a/redisson/src/main/java/org/redisson/api/RBucketsAsync.java b/redisson/src/main/java/org/redisson/api/RBucketsAsync.java index f1de69393..ac1730dd0 100644 --- a/redisson/src/main/java/org/redisson/api/RBucketsAsync.java +++ b/redisson/src/main/java/org/redisson/api/RBucketsAsync.java @@ -33,7 +33,7 @@ public interface RBucketsAsync { * @param keys - keys * @return Map with name of bucket as key and bucket as value */ - RFuture> getAsync(String ... keys); + RFuture> getAsync(String... keys); /** * Try to save objects mapped by Redis key. diff --git a/redisson/src/main/java/org/redisson/api/RExecutorService.java b/redisson/src/main/java/org/redisson/api/RExecutorService.java index 4b6a3df9a..2aabd83b6 100644 --- a/redisson/src/main/java/org/redisson/api/RExecutorService.java +++ b/redisson/src/main/java/org/redisson/api/RExecutorService.java @@ -52,7 +52,7 @@ public interface RExecutorService extends ExecutorService, RExecutorServiceAsync * @param tasks - tasks to execute * @return Future object */ - RExecutorBatchFuture submit(Callable ...tasks); + RExecutorBatchFuture submit(Callable...tasks); /** * Submits a Runnable task for execution and returns a Future @@ -86,7 +86,7 @@ public interface RExecutorService extends ExecutorService, RExecutorServiceAsync * @param tasks - tasks to execute * @return Future object */ - RExecutorBatchFuture submit(Runnable ...tasks); + RExecutorBatchFuture submit(Runnable...tasks); /** * Returns executor name @@ -141,6 +141,6 @@ public interface RExecutorService extends ExecutorService, RExecutorServiceAsync * * @param tasks - tasks to execute */ - void execute(Runnable ...tasks); + void execute(Runnable...tasks); } diff --git a/redisson/src/main/java/org/redisson/api/RExecutorServiceAsync.java b/redisson/src/main/java/org/redisson/api/RExecutorServiceAsync.java index 3d0f34ceb..9cad6c90c 100644 --- a/redisson/src/main/java/org/redisson/api/RExecutorServiceAsync.java +++ b/redisson/src/main/java/org/redisson/api/RExecutorServiceAsync.java @@ -48,7 +48,7 @@ public interface RExecutorServiceAsync { * @param tasks - tasks to execute * @return Future object */ - RExecutorBatchFuture submitAsync(Callable ...tasks); + RExecutorBatchFuture submitAsync(Callable...tasks); /** * Submits task for execution asynchronously @@ -65,6 +65,6 @@ public interface RExecutorServiceAsync { * @param tasks - tasks to execute * @return Future object */ - RExecutorBatchFuture submitAsync(Runnable ...tasks); + RExecutorBatchFuture submitAsync(Runnable...tasks); } diff --git a/redisson/src/main/java/org/redisson/api/RHyperLogLog.java b/redisson/src/main/java/org/redisson/api/RHyperLogLog.java index 3b09ae00f..5a55f3147 100644 --- a/redisson/src/main/java/org/redisson/api/RHyperLogLog.java +++ b/redisson/src/main/java/org/redisson/api/RHyperLogLog.java @@ -58,13 +58,13 @@ public interface RHyperLogLog extends RExpirable, RHyperLogLogAsync { * @param otherLogNames - name of instances * @return number */ - long countWith(String ... otherLogNames); + long countWith(String... otherLogNames); /** * Merges multiple instances into this instance. * * @param otherLogNames - name of instances */ - void mergeWith(String ... otherLogNames); + void mergeWith(String... otherLogNames); } diff --git a/redisson/src/main/java/org/redisson/api/RHyperLogLogAsync.java b/redisson/src/main/java/org/redisson/api/RHyperLogLogAsync.java index ef633daee..5147f04de 100644 --- a/redisson/src/main/java/org/redisson/api/RHyperLogLogAsync.java +++ b/redisson/src/main/java/org/redisson/api/RHyperLogLogAsync.java @@ -59,7 +59,7 @@ public interface RHyperLogLogAsync extends RExpirableAsync { * @param otherLogNames - name of instances * @return number */ - RFuture countWithAsync(String ... otherLogNames); + RFuture countWithAsync(String... otherLogNames); /** * Merges multiple instances into this instance. @@ -67,6 +67,6 @@ public interface RHyperLogLogAsync extends RExpirableAsync { * @param otherLogNames - name of instances * @return void */ - RFuture mergeWithAsync(String ... otherLogNames); + RFuture mergeWithAsync(String... otherLogNames); } diff --git a/redisson/src/main/java/org/redisson/api/RHyperLogLogReactive.java b/redisson/src/main/java/org/redisson/api/RHyperLogLogReactive.java index ce452c5e4..e04ca0f34 100644 --- a/redisson/src/main/java/org/redisson/api/RHyperLogLogReactive.java +++ b/redisson/src/main/java/org/redisson/api/RHyperLogLogReactive.java @@ -61,7 +61,7 @@ public interface RHyperLogLogReactive extends RExpirableReactive { * @param otherLogNames - name of instances * @return number */ - Mono countWith(String ... otherLogNames); + Mono countWith(String... otherLogNames); /** * Merges multiple instances into this instance. @@ -69,6 +69,6 @@ public interface RHyperLogLogReactive extends RExpirableReactive { * @param otherLogNames - name of instances * @return void */ - Mono mergeWith(String ... otherLogNames); + Mono mergeWith(String... otherLogNames); } diff --git a/redisson/src/main/java/org/redisson/api/RHyperLogLogRx.java b/redisson/src/main/java/org/redisson/api/RHyperLogLogRx.java index 427f78ddf..b4ae21f35 100644 --- a/redisson/src/main/java/org/redisson/api/RHyperLogLogRx.java +++ b/redisson/src/main/java/org/redisson/api/RHyperLogLogRx.java @@ -61,7 +61,7 @@ public interface RHyperLogLogRx extends RExpirableRx { * @param otherLogNames - name of instances * @return number */ - Flowable countWith(String ... otherLogNames); + Flowable countWith(String... otherLogNames); /** * Merges multiple instances into this instance. @@ -69,6 +69,6 @@ public interface RHyperLogLogRx extends RExpirableRx { * @param otherLogNames - name of instances * @return void */ - Flowable mergeWith(String ... otherLogNames); + Flowable mergeWith(String... otherLogNames); } diff --git a/redisson/src/main/java/org/redisson/api/RKeys.java b/redisson/src/main/java/org/redisson/api/RKeys.java index 09631e6b9..e77ea66c9 100644 --- a/redisson/src/main/java/org/redisson/api/RKeys.java +++ b/redisson/src/main/java/org/redisson/api/RKeys.java @@ -290,7 +290,7 @@ public interface RKeys extends RKeysAsync { * @param objects of Redisson * @return number of removed keys */ - long delete(RObject ... objects); + long delete(RObject... objects); /** * Delete multiple objects by name @@ -298,7 +298,7 @@ public interface RKeys extends RKeysAsync { * @param keys - object names * @return number of removed keys */ - long delete(String ... keys); + long delete(String... keys); /** * Delete multiple objects by name. @@ -309,7 +309,7 @@ public interface RKeys extends RKeysAsync { * @param keys of objects * @return number of removed keys */ - long unlink(String ... keys); + long unlink(String... keys); /** * Returns the number of keys in the currently-selected database diff --git a/redisson/src/main/java/org/redisson/api/RKeysAsync.java b/redisson/src/main/java/org/redisson/api/RKeysAsync.java index 8b7441801..6cf34fbda 100644 --- a/redisson/src/main/java/org/redisson/api/RKeysAsync.java +++ b/redisson/src/main/java/org/redisson/api/RKeysAsync.java @@ -185,7 +185,7 @@ public interface RKeysAsync { * @param objects of Redisson * @return number of removed keys */ - RFuture deleteAsync(RObject ... objects); + RFuture deleteAsync(RObject... objects); /** * Delete multiple objects by name @@ -193,7 +193,7 @@ public interface RKeysAsync { * @param keys - object names * @return number of removed keys */ - RFuture deleteAsync(String ... keys); + RFuture deleteAsync(String... keys); /** * Delete multiple objects by name. @@ -204,7 +204,7 @@ public interface RKeysAsync { * @param keys - object names * @return number of removed keys */ - RFuture unlinkAsync(String ... keys); + RFuture unlinkAsync(String... keys); /** * Returns the number of keys in the currently-selected database in async mode diff --git a/redisson/src/main/java/org/redisson/api/RKeysReactive.java b/redisson/src/main/java/org/redisson/api/RKeysReactive.java index d5aa010c9..ecc1984d3 100644 --- a/redisson/src/main/java/org/redisson/api/RKeysReactive.java +++ b/redisson/src/main/java/org/redisson/api/RKeysReactive.java @@ -254,7 +254,7 @@ public interface RKeysReactive { * @param keys - object names * @return deleted objects amount */ - Mono delete(String ... keys); + Mono delete(String... keys); /** * Delete multiple objects by name. @@ -265,7 +265,7 @@ public interface RKeysReactive { * @param keys of objects * @return number of removed keys */ - Mono unlink(String ... keys); + Mono unlink(String... keys); /** * Returns the number of keys in the currently-selected database diff --git a/redisson/src/main/java/org/redisson/api/RKeysRx.java b/redisson/src/main/java/org/redisson/api/RKeysRx.java index be061e96a..317f81c6d 100644 --- a/redisson/src/main/java/org/redisson/api/RKeysRx.java +++ b/redisson/src/main/java/org/redisson/api/RKeysRx.java @@ -253,7 +253,7 @@ public interface RKeysRx { * @param keys - object names * @return deleted objects amount */ - Flowable delete(String ... keys); + Flowable delete(String... keys); /** * Delete multiple objects by name. @@ -264,7 +264,7 @@ public interface RKeysRx { * @param keys of objects * @return number of removed keys */ - Flowable unlink(String ... keys); + Flowable unlink(String... keys); /** * Returns the number of keys in the currently-selected database diff --git a/redisson/src/main/java/org/redisson/api/RList.java b/redisson/src/main/java/org/redisson/api/RList.java index b1e1ef7b9..1133810dd 100644 --- a/redisson/src/main/java/org/redisson/api/RList.java +++ b/redisson/src/main/java/org/redisson/api/RList.java @@ -35,7 +35,7 @@ public interface RList extends List, RExpirable, RListAsync, RSortable< * @param indexes of elements * @return list of elements */ - List get(int ...indexes); + List get(int...indexes); /** * Returns RMapReduce object associated with this map diff --git a/redisson/src/main/java/org/redisson/api/RListAsync.java b/redisson/src/main/java/org/redisson/api/RListAsync.java index b870c0240..22f16211c 100644 --- a/redisson/src/main/java/org/redisson/api/RListAsync.java +++ b/redisson/src/main/java/org/redisson/api/RListAsync.java @@ -34,7 +34,7 @@ public interface RListAsync extends RCollectionAsync, RSortableAsync> getAsync(int ...indexes); + RFuture> getAsync(int...indexes); /** * Add element after elementToFind diff --git a/redisson/src/main/java/org/redisson/api/RListReactive.java b/redisson/src/main/java/org/redisson/api/RListReactive.java index 402aca676..60ebc6c25 100644 --- a/redisson/src/main/java/org/redisson/api/RListReactive.java +++ b/redisson/src/main/java/org/redisson/api/RListReactive.java @@ -37,7 +37,7 @@ public interface RListReactive extends RCollectionReactive, RSortableReact * @param indexes of elements * @return elements */ - Mono> get(int ...indexes); + Mono> get(int...indexes); /** * Add element after elementToFind diff --git a/redisson/src/main/java/org/redisson/api/RListRx.java b/redisson/src/main/java/org/redisson/api/RListRx.java index 1a7996cf4..776f71ac5 100644 --- a/redisson/src/main/java/org/redisson/api/RListRx.java +++ b/redisson/src/main/java/org/redisson/api/RListRx.java @@ -36,7 +36,7 @@ public interface RListRx extends RCollectionRx, RSortableRx> { * @param indexes of elements * @return elements */ - Flowable> get(int ...indexes); + Flowable> get(int...indexes); /** * Add element after elementToFind diff --git a/redisson/src/main/java/org/redisson/api/RMap.java b/redisson/src/main/java/org/redisson/api/RMap.java index a080e1cad..d1187eb17 100644 --- a/redisson/src/main/java/org/redisson/api/RMap.java +++ b/redisson/src/main/java/org/redisson/api/RMap.java @@ -271,7 +271,7 @@ public interface RMap extends ConcurrentMap, RExpirable, RMapAsyncvalue with the specified key. diff --git a/redisson/src/main/java/org/redisson/api/RMapAsync.java b/redisson/src/main/java/org/redisson/api/RMapAsync.java index 84e018cda..f0c706888 100644 --- a/redisson/src/main/java/org/redisson/api/RMapAsync.java +++ b/redisson/src/main/java/org/redisson/api/RMapAsync.java @@ -135,7 +135,7 @@ public interface RMapAsync extends RExpirableAsync { * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ - RFuture fastRemoveAsync(K ... keys); + RFuture fastRemoveAsync(K... keys); /** * Associates the specified value with the specified key diff --git a/redisson/src/main/java/org/redisson/api/RMapReactive.java b/redisson/src/main/java/org/redisson/api/RMapReactive.java index 9bb3cab0b..cbda60cfb 100644 --- a/redisson/src/main/java/org/redisson/api/RMapReactive.java +++ b/redisson/src/main/java/org/redisson/api/RMapReactive.java @@ -107,7 +107,7 @@ public interface RMapReactive extends RExpirableReactive { * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ - Mono fastRemove(K ... keys); + Mono fastRemove(K... keys); /** * Associates the specified value with the specified key diff --git a/redisson/src/main/java/org/redisson/api/RMapRx.java b/redisson/src/main/java/org/redisson/api/RMapRx.java index a994ab1de..13ecf4c6f 100644 --- a/redisson/src/main/java/org/redisson/api/RMapRx.java +++ b/redisson/src/main/java/org/redisson/api/RMapRx.java @@ -106,7 +106,7 @@ public interface RMapRx extends RExpirableRx { * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ - Flowable fastRemove(K ... keys); + Flowable fastRemove(K... keys); /** * Associates the specified value with the specified key diff --git a/redisson/src/main/java/org/redisson/api/RMultimap.java b/redisson/src/main/java/org/redisson/api/RMultimap.java index e8765de1c..9ab282c5f 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimap.java +++ b/redisson/src/main/java/org/redisson/api/RMultimap.java @@ -242,7 +242,7 @@ public interface RMultimap extends RExpirable, RMultimapAsync { * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ - long fastRemove(K ... keys); + long fastRemove(K... keys); /** * Read all keys at once diff --git a/redisson/src/main/java/org/redisson/api/RMultimapAsync.java b/redisson/src/main/java/org/redisson/api/RMultimapAsync.java index f483b19b9..062c4d581 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimapAsync.java +++ b/redisson/src/main/java/org/redisson/api/RMultimapAsync.java @@ -17,6 +17,7 @@ package org.redisson.api; import java.util.Collection; import java.util.Set; + /** * Base asynchronous MultiMap interface. A collection that maps multiple values per one key. * @@ -139,8 +140,7 @@ public interface RMultimapAsync extends RExpirableAsync { RFuture> removeAllAsync(Object key); RFuture> getAllAsync(K key); - - + /** * Returns the number of key-value pairs in this multimap. * @@ -157,7 +157,7 @@ public interface RMultimapAsync extends RExpirableAsync { * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ - RFuture fastRemoveAsync(K ... keys); + RFuture fastRemoveAsync(K... keys); /** * Read all keys at once diff --git a/redisson/src/main/java/org/redisson/api/RMultimapReactive.java b/redisson/src/main/java/org/redisson/api/RMultimapReactive.java index fc60eccbd..94f6ba363 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimapReactive.java +++ b/redisson/src/main/java/org/redisson/api/RMultimapReactive.java @@ -127,7 +127,7 @@ public interface RMultimapReactive extends RExpirableReactive { * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ - Mono fastRemove(K ... keys); + Mono fastRemove(K... keys); /** * Read all keys at once diff --git a/redisson/src/main/java/org/redisson/api/RMultimapRx.java b/redisson/src/main/java/org/redisson/api/RMultimapRx.java index 8490879ec..84de8308e 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimapRx.java +++ b/redisson/src/main/java/org/redisson/api/RMultimapRx.java @@ -127,7 +127,7 @@ public interface RMultimapRx extends RExpirableRx { * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ - Flowable fastRemove(K ... keys); + Flowable fastRemove(K... keys); /** * Read all keys at once diff --git a/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java b/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java index d6feeab04..42db34d3e 100644 --- a/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java +++ b/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java @@ -34,7 +34,7 @@ import org.redisson.client.protocol.ScoredEntry; */ public interface RScoredSortedSet extends RScoredSortedSetAsync, Iterable, RExpirable, RSortable> { - public enum Aggregate { + enum Aggregate { SUM, MAX, MIN @@ -63,7 +63,7 @@ public interface RScoredSortedSet extends RScoredSortedSetAsync, Iterable< * {@code timeout} parameter * @return the tail element, or {@code null} if all sorted sets are empty */ - V pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames); + V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns first available head element of any sorted set, @@ -79,7 +79,7 @@ public interface RScoredSortedSet extends RScoredSortedSetAsync, Iterable< * {@code timeout} parameter * @return the head element, or {@code null} if all sorted sets are empty */ - V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames); + V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns the head element waiting if necessary for an element to become available. diff --git a/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java b/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java index 9840b1c1a..9c3ab9e7b 100644 --- a/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java +++ b/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java @@ -45,7 +45,7 @@ public interface RScoredSortedSetAsync extends RExpirableAsync, RSortableAsyn * {@code timeout} parameter * @return the tail element, or {@code null} if all sorted sets are empty */ - RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames); + RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns first available head element of any sorted set, @@ -62,7 +62,7 @@ public interface RScoredSortedSetAsync extends RExpirableAsync, RSortableAsyn * @return the head element, or {@code null} if all sorted sets are empty * */ - RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames); + RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns the head element or {@code null} if this sorted set is empty. diff --git a/redisson/src/main/java/org/redisson/api/RScoredSortedSetReactive.java b/redisson/src/main/java/org/redisson/api/RScoredSortedSetReactive.java index b45e18a43..4e33c7a1e 100644 --- a/redisson/src/main/java/org/redisson/api/RScoredSortedSetReactive.java +++ b/redisson/src/main/java/org/redisson/api/RScoredSortedSetReactive.java @@ -49,7 +49,7 @@ public interface RScoredSortedSetReactive extends RExpirableReactive, RSortab * {@code timeout} parameter * @return the tail element, or {@code null} if all sorted sets are empty */ - Mono pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames); + Mono pollLastFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns first available head element of any sorted set, @@ -66,7 +66,7 @@ public interface RScoredSortedSetReactive extends RExpirableReactive, RSortab * @return the head element, or {@code null} if all sorted sets are empty * */ - Mono pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames); + Mono pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns the head element or {@code null} if this sorted set is empty. diff --git a/redisson/src/main/java/org/redisson/api/RScoredSortedSetRx.java b/redisson/src/main/java/org/redisson/api/RScoredSortedSetRx.java index 3920cd804..40d23de46 100644 --- a/redisson/src/main/java/org/redisson/api/RScoredSortedSetRx.java +++ b/redisson/src/main/java/org/redisson/api/RScoredSortedSetRx.java @@ -48,7 +48,7 @@ public interface RScoredSortedSetRx extends RExpirableRx, RSortableRx> * {@code timeout} parameter * @return the tail element, or {@code null} if all sorted sets are empty */ - Flowable pollLastFromAny(long timeout, TimeUnit unit, String ... queueNames); + Flowable pollLastFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns first available head element of any sorted set, @@ -65,7 +65,7 @@ public interface RScoredSortedSetRx extends RExpirableRx, RSortableRx> * @return the head element, or {@code null} if all sorted sets are empty * */ - Flowable pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames); + Flowable pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames); /** * Removes and returns the head element or {@code null} if this sorted set is empty. diff --git a/redisson/src/main/java/org/redisson/api/RScript.java b/redisson/src/main/java/org/redisson/api/RScript.java index edfc57f2d..dc02bc3c7 100644 --- a/redisson/src/main/java/org/redisson/api/RScript.java +++ b/redisson/src/main/java/org/redisson/api/RScript.java @@ -40,7 +40,7 @@ public interface RScript extends RScriptAsync { MAPVALUE(RedisCommands.EVAL_MAP_VALUE), MAPVALUELIST(RedisCommands.EVAL_MAP_VALUE_LIST); - RedisCommand command; + private final RedisCommand command; ReturnType(RedisCommand command) { this.command = command; @@ -166,7 +166,7 @@ public interface RScript extends RScriptAsync { * @param shaDigests - collection of SHA-1 digests * @return list of booleans corresponding to collection SHA-1 digests */ - List scriptExists(String ... shaDigests); + List scriptExists(String... shaDigests); /** * Kills currently executed Lua script diff --git a/redisson/src/main/java/org/redisson/api/RScriptAsync.java b/redisson/src/main/java/org/redisson/api/RScriptAsync.java index c1610740a..398d765d0 100644 --- a/redisson/src/main/java/org/redisson/api/RScriptAsync.java +++ b/redisson/src/main/java/org/redisson/api/RScriptAsync.java @@ -171,7 +171,7 @@ public interface RScriptAsync { * @param shaDigests - collection of SHA-1 digests * @return list of booleans corresponding to collection SHA-1 digests */ - RFuture> scriptExistsAsync(String ... shaDigests); + RFuture> scriptExistsAsync(String... shaDigests); /** * Checks for presence Lua scripts in Redis script cache by SHA-1 digest. @@ -180,7 +180,7 @@ public interface RScriptAsync { * @param shaDigests - collection of SHA-1 digests * @return list of booleans corresponding to collection SHA-1 digests */ - RFuture> scriptExistsAsync(String key, String ... shaDigests); + RFuture> scriptExistsAsync(String key, String... shaDigests); /** * Kills currently executed Lua script diff --git a/redisson/src/main/java/org/redisson/api/RScriptReactive.java b/redisson/src/main/java/org/redisson/api/RScriptReactive.java index 814b29f44..4a587070b 100644 --- a/redisson/src/main/java/org/redisson/api/RScriptReactive.java +++ b/redisson/src/main/java/org/redisson/api/RScriptReactive.java @@ -128,7 +128,7 @@ public interface RScriptReactive { * @param shaDigests - collection of SHA-1 digests * @return list of booleans corresponding to collection SHA-1 digests */ - Mono> scriptExists(String ... shaDigests); + Mono> scriptExists(String... shaDigests); /** * Kills currently executed Lua script diff --git a/redisson/src/main/java/org/redisson/api/RScriptRx.java b/redisson/src/main/java/org/redisson/api/RScriptRx.java index 95ea63643..85257995b 100644 --- a/redisson/src/main/java/org/redisson/api/RScriptRx.java +++ b/redisson/src/main/java/org/redisson/api/RScriptRx.java @@ -127,7 +127,7 @@ public interface RScriptRx { * @param shaDigests - collection of SHA-1 digests * @return list of booleans corresponding to collection SHA-1 digests */ - Flowable> scriptExists(String ... shaDigests); + Flowable> scriptExists(String... shaDigests); /** * Kills currently executed Lua script diff --git a/redisson/src/main/java/org/redisson/api/RSortable.java b/redisson/src/main/java/org/redisson/api/RSortable.java index 200b61041..158c90ad9 100644 --- a/redisson/src/main/java/org/redisson/api/RSortable.java +++ b/redisson/src/main/java/org/redisson/api/RSortable.java @@ -138,16 +138,16 @@ public interface RSortable extends RSortableAsync { Collection readSortAlpha(String byPattern, List getPatterns, SortOrder order); /** - * Read data in sorted view lexicographically - * - * @param object type - * @param byPattern that is used to generate the keys that are used for sorting - * @param getPatterns that is used to load values by keys in sorted view - * @param order for sorted data - * @param offset of sorted data - * @param count of sorted data - * @return sorted collection lexicographically - */ + * Read data in sorted view lexicographically + * + * @param object type + * @param byPattern that is used to generate the keys that are used for sorting + * @param getPatterns that is used to load values by keys in sorted view + * @param order for sorted data + * @param offset of sorted data + * @param count of sorted data + * @return sorted collection lexicographically + */ Collection readSortAlpha(String byPattern, List getPatterns, SortOrder order, int offset, int count); /** diff --git a/redisson/src/main/java/org/redisson/api/RSortableAsync.java b/redisson/src/main/java/org/redisson/api/RSortableAsync.java index bc41ed78d..27737cf35 100644 --- a/redisson/src/main/java/org/redisson/api/RSortableAsync.java +++ b/redisson/src/main/java/org/redisson/api/RSortableAsync.java @@ -138,17 +138,17 @@ public interface RSortableAsync { RFuture> readSortAlphaAsync(String byPattern, List getPatterns, SortOrder order); /** - * Read data in sorted view lexicographically - * - * @param object type - * @param byPattern that is used to generate the keys that are used for sorting - * @param getPatterns that is used to load values by keys in sorted view - * @param order for sorted data - * @param offset of sorted data - * @param count of sorted data - * @return sorted collection lexicographically - */ - RFuture> readSortAlphaAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count); + * Read data in sorted view lexicographically + * + * @param object type + * @param byPattern that is used to generate the keys that are used for sorting + * @param getPatterns that is used to load values by keys in sorted view + * @param order for sorted data + * @param offset of sorted data + * @param count of sorted data + * @return sorted collection lexicographically + */ + RFuture> readSortAlphaAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count); /** * Sort data and store to destName list diff --git a/redisson/src/main/java/org/redisson/api/RStream.java b/redisson/src/main/java/org/redisson/api/RStream.java index f5b921f94..a3c5ecf6c 100644 --- a/redisson/src/main/java/org/redisson/api/RStream.java +++ b/redisson/src/main/java/org/redisson/api/RStream.java @@ -132,7 +132,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> claim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId ... ids); + Map> claim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids); /** * Transfers ownership of pending messages by id to a new consumer @@ -145,7 +145,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - Stream Message IDs * @return list of Stream Message IDs */ - List fastClaim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId ... ids); + List fastClaim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream Message IDs. @@ -155,7 +155,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> readGroup(String groupName, String consumerName, StreamMessageId ... ids); + Map> readGroup(String groupName, String consumerName, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream Message IDs. @@ -166,7 +166,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> readGroup(String groupName, String consumerName, int count, StreamMessageId ... ids); + Map> readGroup(String groupName, String consumerName, int count, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream Message IDs. @@ -179,7 +179,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId ... ids); + Map> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream Message IDs. @@ -193,7 +193,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + Map> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName, starting by specified message ids for this and other streams. @@ -470,7 +470,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> read(StreamMessageId ... ids); + Map> read(StreamMessageId... ids); /** * Read stream data by specified collection of Stream Message IDs. @@ -479,7 +479,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> read(int count, StreamMessageId ... ids); + Map> read(int count, StreamMessageId... ids); /** * Read stream data by specified collection of Stream Message IDs. @@ -490,7 +490,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> read(long timeout, TimeUnit unit, StreamMessageId ... ids); + Map> read(long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified collection of Stream Message IDs. @@ -502,7 +502,7 @@ public interface RStream extends RStreamAsync, RExpirable { * @param ids - collection of Stream Message IDs * @return stream data mapped by Stream Message ID */ - Map> read(int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + Map> read(int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified stream name including this stream. diff --git a/redisson/src/main/java/org/redisson/api/RStreamAsync.java b/redisson/src/main/java/org/redisson/api/RStreamAsync.java index 838235bf6..a67a1ae2a 100644 --- a/redisson/src/main/java/org/redisson/api/RStreamAsync.java +++ b/redisson/src/main/java/org/redisson/api/RStreamAsync.java @@ -136,7 +136,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - stream ids * @return stream data mapped by Stream ID */ - RFuture>> claimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId ... ids); + RFuture>> claimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids); /** * Transfers ownership of pending messages by id to a new consumer @@ -149,7 +149,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - Stream Message IDs * @return list of Stream Message IDs */ - RFuture> fastClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId ... ids); + RFuture> fastClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -159,7 +159,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readGroupAsync(String groupName, String consumerName, StreamMessageId ... ids); + RFuture>> readGroupAsync(String groupName, String consumerName, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -170,7 +170,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readGroupAsync(String groupName, String consumerName, int count, StreamMessageId ... ids); + RFuture>> readGroupAsync(String groupName, String consumerName, int count, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -183,7 +183,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readGroupAsync(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId ... ids); + RFuture>> readGroupAsync(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -197,7 +197,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readGroupAsync(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + RFuture>> readGroupAsync(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName, starting by specified message ids for this and other streams. @@ -208,7 +208,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param nameToId - Stream Message ID mapped by stream name * @return stream data mapped by key and Stream Message ID */ - RFuture>>> readGroupAsync(String groupName, String consumerName,StreamMessageId id, Map nameToId); + RFuture>>> readGroupAsync(String groupName, String consumerName, StreamMessageId id, Map nameToId); /** * Read stream data from groupName by consumerName, starting by specified message ids for this and other streams. @@ -462,7 +462,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readAsync(StreamMessageId ... ids); + RFuture>> readAsync(StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -471,7 +471,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readAsync(int count, StreamMessageId ... ids); + RFuture>> readAsync(int count, StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -482,7 +482,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readAsync(long timeout, TimeUnit unit, StreamMessageId ... ids); + RFuture>> readAsync(long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -494,7 +494,7 @@ public interface RStreamAsync extends RExpirableAsync { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - RFuture>> readAsync(int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + RFuture>> readAsync(int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified stream name including this stream. diff --git a/redisson/src/main/java/org/redisson/api/RStreamReactive.java b/redisson/src/main/java/org/redisson/api/RStreamReactive.java index ad644bfce..9a7a14d7f 100644 --- a/redisson/src/main/java/org/redisson/api/RStreamReactive.java +++ b/redisson/src/main/java/org/redisson/api/RStreamReactive.java @@ -138,7 +138,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - stream ids * @return stream data mapped by Stream ID */ - Mono>> claim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId ... ids); + Mono>> claim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -148,7 +148,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> readGroup(String groupName, String consumerName, StreamMessageId ... ids); + Mono>> readGroup(String groupName, String consumerName, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -159,7 +159,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> readGroup(String groupName, String consumerName, int count, StreamMessageId ... ids); + Mono>> readGroup(String groupName, String consumerName, int count, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -172,7 +172,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId ... ids); + Mono>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -186,7 +186,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + Mono>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName, starting by specified message ids for this and other streams. @@ -197,7 +197,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param nameToId - Stream Message ID mapped by stream name * @return stream data mapped by key and Stream Message ID */ - Mono>>> readGroup(String groupName, String consumerName,StreamMessageId id, Map nameToId); + Mono>>> readGroup(String groupName, String consumerName, StreamMessageId id, Map nameToId); /** * Read stream data from groupName by consumerName, starting by specified message ids for this and other streams. @@ -451,7 +451,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> read(StreamMessageId ... ids); + Mono>> read(StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -460,7 +460,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> read(int count, StreamMessageId ... ids); + Mono>> read(int count, StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -471,7 +471,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> read(long timeout, TimeUnit unit, StreamMessageId ... ids); + Mono>> read(long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -483,7 +483,7 @@ public interface RStreamReactive extends RExpirableReactive { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Mono>> read(int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + Mono>> read(int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified stream name including this stream. diff --git a/redisson/src/main/java/org/redisson/api/RStreamRx.java b/redisson/src/main/java/org/redisson/api/RStreamRx.java index 4c383334b..4f09bf4a0 100644 --- a/redisson/src/main/java/org/redisson/api/RStreamRx.java +++ b/redisson/src/main/java/org/redisson/api/RStreamRx.java @@ -138,7 +138,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - stream ids * @return stream data mapped by Stream ID */ - Flowable>> claim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId ... ids); + Flowable>> claim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -148,7 +148,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> readGroup(String groupName, String consumerName, StreamMessageId ... ids); + Flowable>> readGroup(String groupName, String consumerName, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -159,7 +159,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> readGroup(String groupName, String consumerName, int count, StreamMessageId ... ids); + Flowable>> readGroup(String groupName, String consumerName, int count, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -172,7 +172,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId ... ids); + Flowable>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName and specified collection of Stream IDs. @@ -186,7 +186,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + Flowable>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data from groupName by consumerName, starting by specified message ids for this and other streams. @@ -197,7 +197,7 @@ public interface RStreamRx extends RExpirableRx { * @param nameToId - Stream Message ID mapped by stream name * @return stream data mapped by key and Stream Message ID */ - Flowable>>> readGroup(String groupName, String consumerName,StreamMessageId id, Map nameToId); + Flowable>>> readGroup(String groupName, String consumerName, StreamMessageId id, Map nameToId); /** * Read stream data from groupName by consumerName, starting by specified message ids for this and other streams. @@ -451,7 +451,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> read(StreamMessageId ... ids); + Flowable>> read(StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -460,7 +460,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> read(int count, StreamMessageId ... ids); + Flowable>> read(int count, StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -471,7 +471,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> read(long timeout, TimeUnit unit, StreamMessageId ... ids); + Flowable>> read(long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified collection of Stream IDs. @@ -483,7 +483,7 @@ public interface RStreamRx extends RExpirableRx { * @param ids - collection of Stream IDs * @return stream data mapped by Stream ID */ - Flowable>> read(int count, long timeout, TimeUnit unit, StreamMessageId ... ids); + Flowable>> read(int count, long timeout, TimeUnit unit, StreamMessageId... ids); /** * Read stream data by specified stream name including this stream. diff --git a/redisson/src/main/java/org/redisson/api/TransactionOptions.java b/redisson/src/main/java/org/redisson/api/TransactionOptions.java index 89631e0ec..e8554b706 100644 --- a/redisson/src/main/java/org/redisson/api/TransactionOptions.java +++ b/redisson/src/main/java/org/redisson/api/TransactionOptions.java @@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit; * @author Nikita Koksharov * */ -public class TransactionOptions { +public final class TransactionOptions { private long responseTimeout = 3000; private int retryAttempts = 3; diff --git a/redisson/src/main/java/org/redisson/api/annotation/REntity.java b/redisson/src/main/java/org/redisson/api/annotation/REntity.java index 13fb6bde2..c3fdffb7f 100644 --- a/redisson/src/main/java/org/redisson/api/annotation/REntity.java +++ b/redisson/src/main/java/org/redisson/api/annotation/REntity.java @@ -36,7 +36,7 @@ import org.redisson.liveobject.resolver.NamingScheme; @Target({ElementType.TYPE}) public @interface REntity { - public enum TransformationMode { + enum TransformationMode { IMPLEMENTATION_BASED, @@ -68,7 +68,7 @@ public @interface REntity { */ TransformationMode fieldTransformation() default TransformationMode.ANNOTATION_BASED; - static final class DEFAULT extends BaseCodec { + final class DEFAULT extends BaseCodec { @Override public Decoder getValueDecoder() { return null; diff --git a/redisson/src/main/java/org/redisson/api/annotation/RObjectField.java b/redisson/src/main/java/org/redisson/api/annotation/RObjectField.java index ea299dfef..53c4b593b 100644 --- a/redisson/src/main/java/org/redisson/api/annotation/RObjectField.java +++ b/redisson/src/main/java/org/redisson/api/annotation/RObjectField.java @@ -15,8 +15,6 @@ */ package org.redisson.api.annotation; -import org.redisson.liveobject.resolver.NamingScheme; -import org.redisson.liveobject.resolver.DefaultNamingScheme; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -26,7 +24,8 @@ import org.redisson.client.codec.BaseCodec; import org.redisson.client.codec.Codec; import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Encoder; -import org.redisson.codec.JsonJacksonCodec; +import org.redisson.liveobject.resolver.DefaultNamingScheme; +import org.redisson.liveobject.resolver.NamingScheme; /** * By default namingScheme and/or codec parameters specified in {@link REntity} @@ -58,7 +57,7 @@ public @interface RObjectField{ */ Class codec() default DEFAULT.class; - static final class DEFAULT extends BaseCodec { + final class DEFAULT extends BaseCodec { @Override public Decoder getValueDecoder() { return null; diff --git a/redisson/src/main/java/org/redisson/client/RedisConnection.java b/redisson/src/main/java/org/redisson/client/RedisConnection.java index dbba1deb4..8158072ec 100644 --- a/redisson/src/main/java/org/redisson/client/RedisConnection.java +++ b/redisson/src/main/java/org/redisson/client/RedisConnection.java @@ -161,7 +161,7 @@ public class RedisConnection implements RedisCommands { } } - public T sync(RedisCommand command, Object ... params) { + public T sync(RedisCommand command, Object... params) { return sync(null, command, params); } @@ -173,25 +173,25 @@ public class RedisConnection implements RedisCommands { return channel.writeAndFlush(data); } - public R sync(Codec encoder, RedisCommand command, Object ... params) { + public R sync(Codec encoder, RedisCommand command, Object... params) { RPromise promise = new RedissonPromise(); send(new CommandData(promise, encoder, command, params)); return await(promise); } - public RFuture async(RedisCommand command, Object ... params) { + public RFuture async(RedisCommand command, Object... params) { return async(null, command, params); } - public RFuture async(long timeout, RedisCommand command, Object ... params) { + public RFuture async(long timeout, RedisCommand command, Object... params) { return async(null, command, params); } - public RFuture async(Codec encoder, RedisCommand command, Object ... params) { + public RFuture async(Codec encoder, RedisCommand command, Object... params) { return async(-1, encoder, command, params); } - public RFuture async(long timeout, Codec encoder, final RedisCommand command, final Object ... params) { + public RFuture async(long timeout, Codec encoder, final RedisCommand command, final Object... params) { final RPromise promise = new RedissonPromise(); if (timeout == -1) { timeout = redisClient.getCommandTimeout(); @@ -228,7 +228,7 @@ public class RedisConnection implements RedisCommands { return promise; } - public CommandData create(Codec encoder, RedisCommand command, Object ... params) { + public CommandData create(Codec encoder, RedisCommand command, Object... params) { RPromise promise = new RedissonPromise(); return new CommandData(promise, encoder, command, params); } diff --git a/redisson/src/main/java/org/redisson/client/RedisPubSubConnection.java b/redisson/src/main/java/org/redisson/client/RedisPubSubConnection.java index d519099e2..8d4313fb3 100644 --- a/redisson/src/main/java/org/redisson/client/RedisPubSubConnection.java +++ b/redisson/src/main/java/org/redisson/client/RedisPubSubConnection.java @@ -85,21 +85,21 @@ public class RedisPubSubConnection extends RedisConnection { } } - public void subscribe(Codec codec, ChannelName ... channels) { + public void subscribe(Codec codec, ChannelName... channels) { for (ChannelName ch : channels) { this.channels.put(ch, codec); } async(new PubSubMessageDecoder(codec.getValueDecoder()), RedisCommands.SUBSCRIBE, channels); } - public void psubscribe(Codec codec, ChannelName ... channels) { + public void psubscribe(Codec codec, ChannelName... channels) { for (ChannelName ch : channels) { patternChannels.put(ch, codec); } async(new PubSubPatternMessageDecoder(codec.getValueDecoder()), RedisCommands.PSUBSCRIBE, channels); } - public void unsubscribe(final ChannelName ... channels) { + public void unsubscribe(final ChannelName... channels) { synchronized (this) { for (ChannelName ch : channels) { this.channels.remove(ch); @@ -145,7 +145,7 @@ public class RedisPubSubConnection extends RedisConnection { } } - public void punsubscribe(final ChannelName ... channels) { + public void punsubscribe(final ChannelName... channels) { synchronized (this) { for (ChannelName ch : channels) { patternChannels.remove(ch); @@ -166,7 +166,7 @@ public class RedisPubSubConnection extends RedisConnection { }); } - private ChannelFuture async(MultiDecoder messageDecoder, RedisCommand command, Object ... params) { + private ChannelFuture async(MultiDecoder messageDecoder, RedisCommand command, Object... params) { RPromise promise = new RedissonPromise(); return channel.writeAndFlush(new CommandData(promise, messageDecoder, null, command, params)); } diff --git a/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java b/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java index b8df57d66..e68fee006 100644 --- a/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java +++ b/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java @@ -68,6 +68,7 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ReplayingDecoder; import io.netty.util.CharsetUtil; +import io.netty.util.concurrent.FastThreadLocal; /** * Redis protocol command decoder @@ -112,14 +113,14 @@ public class CommandDecoder extends ReplayingDecoder { final ExecutorService executor; private final boolean decodeInExecutor; - private final ThreadLocal decoderStatus = new ThreadLocal() { + private final FastThreadLocal decoderStatus = new FastThreadLocal() { @Override protected Status initialValue() { return Status.NORMAL; }; }; - private final ThreadLocal state = new ThreadLocal(); + private final FastThreadLocal state = new FastThreadLocal(); public CommandDecoder(ExecutorService executor, boolean decodeInExecutor) { this.decodeInExecutor = decodeInExecutor; diff --git a/redisson/src/main/java/org/redisson/client/protocol/decoder/ListMultiDecoder.java b/redisson/src/main/java/org/redisson/client/protocol/decoder/ListMultiDecoder.java index 99fee1ee9..862c43d51 100644 --- a/redisson/src/main/java/org/redisson/client/protocol/decoder/ListMultiDecoder.java +++ b/redisson/src/main/java/org/redisson/client/protocol/decoder/ListMultiDecoder.java @@ -112,13 +112,13 @@ public class ListMultiDecoder implements MultiDecoder { return ds; } - public ListMultiDecoder(MultiDecoder ... decoders) { + public ListMultiDecoder(MultiDecoder... decoders) { this.decoders = decoders; } private Integer fixedIndex; - public ListMultiDecoder(Integer fixedIndex, MultiDecoder ... decoders) { + public ListMultiDecoder(Integer fixedIndex, MultiDecoder... decoders) { this.fixedIndex = fixedIndex; this.decoders = decoders; } diff --git a/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java b/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java index 55a498790..d28dee358 100644 --- a/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java +++ b/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java @@ -529,7 +529,7 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager { RFuture>> future = addMasterEntry(newPart, cfg); future.onComplete((res, e) -> { if (e == null) { - futures.addAll(future.getNow()); + futures.addAll(res); } if (masters.decrementAndGet() == 0) { diff --git a/redisson/src/main/java/org/redisson/codec/SnappyCodec.java b/redisson/src/main/java/org/redisson/codec/SnappyCodec.java index 1f1ec5fe7..9b2821081 100644 --- a/redisson/src/main/java/org/redisson/codec/SnappyCodec.java +++ b/redisson/src/main/java/org/redisson/codec/SnappyCodec.java @@ -26,6 +26,7 @@ import org.redisson.client.protocol.Encoder; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import io.netty.handler.codec.compression.Snappy; +import io.netty.util.concurrent.FastThreadLocal; /** * Snappy compression codec. @@ -39,13 +40,13 @@ import io.netty.handler.codec.compression.Snappy; */ public class SnappyCodec extends BaseCodec { - private static final ThreadLocal snappyDecoder = new ThreadLocal() { + private static final FastThreadLocal snappyDecoder = new FastThreadLocal() { protected Snappy initialValue() { return new Snappy(); }; }; - private static final ThreadLocal snappyEncoder = new ThreadLocal() { + private static final FastThreadLocal snappyEncoder = new FastThreadLocal() { protected Snappy initialValue() { return new Snappy(); }; diff --git a/redisson/src/main/java/org/redisson/command/CommandAsyncExecutor.java b/redisson/src/main/java/org/redisson/command/CommandAsyncExecutor.java index df6dd2690..fe25ded99 100644 --- a/redisson/src/main/java/org/redisson/command/CommandAsyncExecutor.java +++ b/redisson/src/main/java/org/redisson/command/CommandAsyncExecutor.java @@ -59,60 +59,60 @@ public interface CommandAsyncExecutor { V get(RFuture RFuture); - RFuture writeAsync(MasterSlaveEntry entry, Codec codec, RedisCommand command, Object ... params); + RFuture writeAsync(MasterSlaveEntry entry, Codec codec, RedisCommand command, Object... params); RFuture writeAsync(byte[] key, Codec codec, RedisCommand command, Object... params); - RFuture readAsync(RedisClient client, MasterSlaveEntry entry, Codec codec, RedisCommand command, Object ... params); + RFuture readAsync(RedisClient client, MasterSlaveEntry entry, Codec codec, RedisCommand command, Object... params); - RFuture readAsync(RedisClient client, String name, Codec codec, RedisCommand command, Object ... params); + RFuture readAsync(RedisClient client, String name, Codec codec, RedisCommand command, Object... params); RFuture readAsync(RedisClient client, byte[] key, Codec codec, RedisCommand command, Object... params); - RFuture readAsync(RedisClient client, Codec codec, RedisCommand command, Object ... params); + RFuture readAsync(RedisClient client, Codec codec, RedisCommand command, Object... params); - RFuture evalWriteAllAsync(RedisCommand command, SlotCallback callback, String script, List keys, Object ... params); + RFuture evalWriteAllAsync(RedisCommand command, SlotCallback callback, String script, List keys, Object... params); - RFuture writeAllAsync(RedisCommand command, SlotCallback callback, Object ... params); + RFuture writeAllAsync(RedisCommand command, SlotCallback callback, Object... params); RFuture> readAllAsync(Codec codec, RedisCommand command, Object... params); - RFuture readAllAsync(RedisCommand command, SlotCallback callback, Object ... params); + RFuture readAllAsync(RedisCommand command, SlotCallback callback, Object... params); RFuture> readAllAsync(Collection results, Codec codec, RedisCommand command, Object... params); - RFuture evalReadAsync(RedisClient client, String name, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params); + RFuture evalReadAsync(RedisClient client, String name, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params); - RFuture evalReadAsync(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params); + RFuture evalReadAsync(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params); - RFuture evalReadAsync(MasterSlaveEntry entry, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params); + RFuture evalReadAsync(MasterSlaveEntry entry, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params); - RFuture evalWriteAsync(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params); + RFuture evalWriteAsync(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params); - RFuture evalWriteAsync(MasterSlaveEntry entry, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params); + RFuture evalWriteAsync(MasterSlaveEntry entry, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params); RFuture readAsync(byte[] key, Codec codec, RedisCommand command, Object... params); - RFuture readAsync(String key, Codec codec, RedisCommand command, Object ... params); + RFuture readAsync(String key, Codec codec, RedisCommand command, Object... params); - RFuture writeAsync(String key, Codec codec, RedisCommand command, Object ... params); + RFuture writeAsync(String key, Codec codec, RedisCommand command, Object... params); - RFuture> readAllAsync(RedisCommand command, Object ... params); + RFuture> readAllAsync(RedisCommand command, Object... params); RFuture writeAllAsync(Codec codec, RedisCommand command, SlotCallback callback, Object... params); - RFuture writeAllAsync(RedisCommand command, Object ... params); + RFuture writeAllAsync(RedisCommand command, Object... params); - RFuture writeAsync(String key, RedisCommand command, Object ... params); + RFuture writeAsync(String key, RedisCommand command, Object... params); - RFuture readAsync(String key, RedisCommand command, Object ... params); + RFuture readAsync(String key, RedisCommand command, Object... params); - RFuture readAsync(MasterSlaveEntry entry, Codec codec, RedisCommand command, Object ... params); + RFuture readAsync(MasterSlaveEntry entry, Codec codec, RedisCommand command, Object... params); - RFuture readRandomAsync(Codec codec, RedisCommand command, Object ... params); + RFuture readRandomAsync(Codec codec, RedisCommand command, Object... params); RFuture readRandomAsync(MasterSlaveEntry entry, Codec codec, RedisCommand command, Object... params); - RFuture pollFromAnyAsync(String name, Codec codec, RedisCommand command, long secondsTimeout, String ... queueNames); + RFuture pollFromAnyAsync(String name, Codec codec, RedisCommand command, long secondsTimeout, String... queueNames); } diff --git a/redisson/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson/src/main/java/org/redisson/command/CommandAsyncService.java index 4f0e5f690..bee00f51c 100644 --- a/redisson/src/main/java/org/redisson/command/CommandAsyncService.java +++ b/redisson/src/main/java/org/redisson/command/CommandAsyncService.java @@ -1253,7 +1253,7 @@ public class CommandAsyncService implements CommandAsyncExecutor { return objectBuilder; } - public RFuture pollFromAnyAsync(String name, Codec codec, RedisCommand command, long secondsTimeout, String ... queueNames) { + public RFuture pollFromAnyAsync(String name, Codec codec, RedisCommand command, long secondsTimeout, String... queueNames) { if (connectionManager.isClusterMode() && queueNames.length > 0) { RPromise result = new RedissonPromise(); AtomicReference> ref = new AtomicReference>(); diff --git a/redisson/src/main/java/org/redisson/command/CommandSyncExecutor.java b/redisson/src/main/java/org/redisson/command/CommandSyncExecutor.java index 972261f14..926f018ff 100644 --- a/redisson/src/main/java/org/redisson/command/CommandSyncExecutor.java +++ b/redisson/src/main/java/org/redisson/command/CommandSyncExecutor.java @@ -31,17 +31,17 @@ public interface CommandSyncExecutor { V get(RFuture future); - R read(String key, RedisCommand command, Object ... params); + R read(String key, RedisCommand command, Object... params); - R read(String key, Codec codec, RedisCommand command, Object ... params); + R read(String key, Codec codec, RedisCommand command, Object... params); - R evalRead(String key, RedisCommand evalCommandType, String script, List keys, Object ... params); + R evalRead(String key, RedisCommand evalCommandType, String script, List keys, Object... params); - R evalRead(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params); + R evalRead(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params); - R evalWrite(String key, RedisCommand evalCommandType, String script, List keys, Object ... params); + R evalWrite(String key, RedisCommand evalCommandType, String script, List keys, Object... params); - R evalWrite(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params); + R evalWrite(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params); ConnectionManager getConnectionManager(); diff --git a/redisson/src/main/java/org/redisson/command/CommandSyncService.java b/redisson/src/main/java/org/redisson/command/CommandSyncService.java index 188008b52..b23e76e2e 100644 --- a/redisson/src/main/java/org/redisson/command/CommandSyncService.java +++ b/redisson/src/main/java/org/redisson/command/CommandSyncService.java @@ -38,34 +38,34 @@ public class CommandSyncService extends CommandAsyncService implements CommandEx } @Override - public R read(String key, RedisCommand command, Object ... params) { + public R read(String key, RedisCommand command, Object... params) { return read(key, connectionManager.getCodec(), command, params); } @Override - public R read(String key, Codec codec, RedisCommand command, Object ... params) { + public R read(String key, Codec codec, RedisCommand command, Object... params) { RFuture res = readAsync(key, codec, command, params); return get(res); } @Override - public R evalRead(String key, RedisCommand evalCommandType, String script, List keys, Object ... params) { + public R evalRead(String key, RedisCommand evalCommandType, String script, List keys, Object... params) { return evalRead(key, connectionManager.getCodec(), evalCommandType, script, keys, params); } @Override - public R evalRead(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params) { + public R evalRead(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params) { RFuture res = evalReadAsync(key, codec, evalCommandType, script, keys, params); return get(res); } @Override - public R evalWrite(String key, RedisCommand evalCommandType, String script, List keys, Object ... params) { + public R evalWrite(String key, RedisCommand evalCommandType, String script, List keys, Object... params) { return evalWrite(key, connectionManager.getCodec(), evalCommandType, script, keys, params); } @Override - public R evalWrite(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params) { + public R evalWrite(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params) { RFuture res = evalWriteAsync(key, codec, evalCommandType, script, keys, params); return get(res); } diff --git a/redisson/src/main/java/org/redisson/config/ClusterServersConfig.java b/redisson/src/main/java/org/redisson/config/ClusterServersConfig.java index 1811849df..9bdab45ec 100644 --- a/redisson/src/main/java/org/redisson/config/ClusterServersConfig.java +++ b/redisson/src/main/java/org/redisson/config/ClusterServersConfig.java @@ -52,7 +52,7 @@ public class ClusterServersConfig extends BaseMasterSlaveServersConfighost:port format * @return config */ - public ClusterServersConfig addNodeAddress(String ... addresses) { + public ClusterServersConfig addNodeAddress(String... addresses) { for (String address : addresses) { nodeAddresses.add(URIBuilder.create(address)); } diff --git a/redisson/src/main/java/org/redisson/config/MasterSlaveServersConfig.java b/redisson/src/main/java/org/redisson/config/MasterSlaveServersConfig.java index 490aab035..68e48a398 100644 --- a/redisson/src/main/java/org/redisson/config/MasterSlaveServersConfig.java +++ b/redisson/src/main/java/org/redisson/config/MasterSlaveServersConfig.java @@ -84,7 +84,7 @@ public class MasterSlaveServersConfig extends BaseMasterSlaveServersConfighost:port format * @return config */ - public ReplicatedServersConfig addNodeAddress(String ... addresses) { + public ReplicatedServersConfig addNodeAddress(String... addresses) { for (String address : addresses) { nodeAddresses.add(URIBuilder.create(address)); } diff --git a/redisson/src/main/java/org/redisson/config/SentinelServersConfig.java b/redisson/src/main/java/org/redisson/config/SentinelServersConfig.java index 5077f3d90..b1f182e65 100644 --- a/redisson/src/main/java/org/redisson/config/SentinelServersConfig.java +++ b/redisson/src/main/java/org/redisson/config/SentinelServersConfig.java @@ -72,7 +72,7 @@ public class SentinelServersConfig extends BaseMasterSlaveServersConfig newConnectionFuture = connectionWriteOp(commandData.getCommand()); - System.out.println("newConnectionFuture " + newConnectionFuture); - newConnectionFuture.onComplete((newConnection, e) -> { - if (e != null) { - log.error("Can't resubscribe blocking queue " + commandData, e); - return; + RFuture newConnectionFuture = connectionWriteOp(commandData.getCommand()); + newConnectionFuture.onComplete((newConnection, e) -> { + if (e != null) { + log.error("Can't resubscribe blocking queue " + commandData, e); + return; + } + + AtomicBoolean skip = new AtomicBoolean(); + BiConsumer listener = new BiConsumer() { + @Override + public void accept(Object t, Throwable u) { + if (skip.get()) { + return; + } + releaseWrite(newConnection); } - - System.out.println("newConnectionFuture1 " + connection); - AtomicBoolean skip = new AtomicBoolean(); - BiConsumer listener = new BiConsumer() { - @Override - public void accept(Object t, Throwable u) { - if (skip.get()) { - return; - } + }; + commandData.getPromise().onComplete(listener); + if (commandData.getPromise().isDone()) { + return; + } + ChannelFuture channelFuture = newConnection.send(commandData); + channelFuture.addListener(new ChannelFutureListener() { + @Override + public void operationComplete(ChannelFuture future) throws Exception { + if (!future.isSuccess()) { + listener.accept(null, null); + skip.set(true); releaseWrite(newConnection); + log.error("Can't resubscribe blocking queue {}", commandData); } - }; - commandData.getPromise().onComplete(listener); - if (commandData.getPromise().isDone()) { - return; } - System.out.println("newConnectionFuture2 " + connection); - ChannelFuture channelFuture = newConnection.send(commandData); - channelFuture.addListener(new ChannelFutureListener() { - @Override - public void operationComplete(ChannelFuture future) throws Exception { - if (!future.isSuccess()) { - listener.accept(null, null); - skip.set(true); - releaseWrite(newConnection); - log.error("Can't resubscribe blocking queue {}", commandData); - } else { - System.out.println("resubscribed " + connection); - } - } - }); }); - - } catch (Exception e2) { - e2.printStackTrace(); - // TODO: handle exception - } + }); } public boolean hasSlave(RedisClient redisClient) { diff --git a/redisson/src/main/java/org/redisson/jcache/JCache.java b/redisson/src/main/java/org/redisson/jcache/JCache.java index 2ff051a09..2811f1b3c 100644 --- a/redisson/src/main/java/org/redisson/jcache/JCache.java +++ b/redisson/src/main/java/org/redisson/jcache/JCache.java @@ -378,7 +378,7 @@ public class JCache extends RedissonObject implements Cache { return value; } - private R write(String key, RedisCommand command, Object ... params) { + private R write(String key, RedisCommand command, Object... params) { RFuture future = commandExecutor.writeAsync(key, command, params); try { return get(future); @@ -387,7 +387,7 @@ public class JCache extends RedissonObject implements Cache { } } - private R evalWrite(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params) { + private R evalWrite(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params) { RFuture future = commandExecutor.evalWriteAsync(key, codec, evalCommandType, script, keys, params); try { return get(future); @@ -396,7 +396,7 @@ public class JCache extends RedissonObject implements Cache { } } - private R evalRead(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object ... params) { + private R evalRead(String key, Codec codec, RedisCommand evalCommandType, String script, List keys, Object... params) { RFuture future = commandExecutor.evalReadAsync(key, codec, evalCommandType, script, keys, params); try { return get(future); diff --git a/redisson/src/main/java/org/redisson/misc/CompositeIterable.java b/redisson/src/main/java/org/redisson/misc/CompositeIterable.java index 49c4c8f80..f03537d1c 100644 --- a/redisson/src/main/java/org/redisson/misc/CompositeIterable.java +++ b/redisson/src/main/java/org/redisson/misc/CompositeIterable.java @@ -28,7 +28,7 @@ public class CompositeIterable implements Iterable { this.iterablesList = iterables; } - public CompositeIterable(Iterable ... iterables) { + public CompositeIterable(Iterable... iterables) { this.iterables = iterables; }