From 0bb2cf6e0f431a278a124726306cbc5537530817 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 30 Jul 2019 13:52:21 +0200 Subject: [PATCH] Polishing #1100 --- pom.xml | 18 +++++++++++------- .../java/io/lettuce/core/BitFieldArgs.java | 2 +- .../java/io/lettuce/core/ClientOptions.java | 4 ++-- src/main/java/io/lettuce/core/GeoArgs.java | 6 +++--- .../io/lettuce/core/GeoRadiusStoreArgs.java | 2 +- src/main/java/io/lettuce/core/KillArgs.java | 2 +- src/main/java/io/lettuce/core/MigrateArgs.java | 2 +- src/main/java/io/lettuce/core/Operators.java | 2 +- src/main/java/io/lettuce/core/RestoreArgs.java | 2 +- src/main/java/io/lettuce/core/ScanArgs.java | 2 +- src/main/java/io/lettuce/core/SetArgs.java | 2 +- .../java/io/lettuce/core/SocketOptions.java | 4 ++-- src/main/java/io/lettuce/core/SortArgs.java | 2 +- src/main/java/io/lettuce/core/XAddArgs.java | 2 +- src/main/java/io/lettuce/core/XClaimArgs.java | 2 +- src/main/java/io/lettuce/core/XReadArgs.java | 2 +- src/main/java/io/lettuce/core/ZAddArgs.java | 2 +- src/main/java/io/lettuce/core/ZStoreArgs.java | 6 +++--- .../api/async/RedisServerAsyncCommands.java | 4 ---- .../models/partitions/RedisClusterNode.java | 4 ++-- .../CompletableEventLatchSupport.java | 2 +- .../lettuce/core/masterslave/Connections.java | 4 ++-- .../lettuce/core/resource/ClientResources.java | 6 +++--- .../core/resource/DefaultClientResources.java | 6 +++--- .../io/lettuce/core/tracing/BraveTracing.java | 2 +- 25 files changed, 46 insertions(+), 46 deletions(-) diff --git a/pom.xml b/pom.xml index 66b0b7c71b..f40657637d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 @@ -77,7 +78,6 @@ scm:git:https://github.com/lettuce-io/lettuce-core.git scm:git:https://github.com/lettuce-io/lettuce-core.git http://github.com/lettuce-io/lettuce-core - HEAD @@ -673,6 +673,7 @@ org.apache.maven.plugins maven-javadoc-plugin + 3.1.1 attach-javadocs @@ -723,6 +724,7 @@ org.apache.maven.plugins maven-assembly-plugin + 3.1.1 src @@ -865,7 +867,7 @@ -Xmx2G -classpath - + org.openjdk.jmh.Main .* -tu @@ -939,7 +941,9 @@ process-resources - + @@ -1006,9 +1010,9 @@ 3 true https://raw.githubusercontent.com/wiki/lettuce-io/lettuce-core/ - - - + + + font coderay diff --git a/src/main/java/io/lettuce/core/BitFieldArgs.java b/src/main/java/io/lettuce/core/BitFieldArgs.java index 82388cc3cd..3e1970bc8a 100644 --- a/src/main/java/io/lettuce/core/BitFieldArgs.java +++ b/src/main/java/io/lettuce/core/BitFieldArgs.java @@ -27,7 +27,7 @@ /** * Argument list builder for the Redis BITFIELD command. - *

+ *

* {@link BitFieldArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/ClientOptions.java b/src/main/java/io/lettuce/core/ClientOptions.java index 14151bde42..b101c20d08 100644 --- a/src/main/java/io/lettuce/core/ClientOptions.java +++ b/src/main/java/io/lettuce/core/ClientOptions.java @@ -174,7 +174,7 @@ public Builder cancelCommandsOnReconnectFailure(boolean cancelCommandsOnReconnec /** * Use a dedicated {@link reactor.core.scheduler.Scheduler} to emit reactive data signals. Enabling this option can be * useful for reactive sequences that require a significant amount of processing with a single/a few Redis connections. - *

+ *

* A single Redis connection operates on a single thread. Operations that require a significant amount of processing can * lead to a single-threaded-like behavior for all consumers of the Redis connection. When enabled, data signals will be * emitted using a different thread served by {@link ClientResources#eventExecutorGroup()}. Defaults to {@literal false} @@ -329,7 +329,7 @@ public boolean isCancelCommandsOnReconnectFailure() { /** * Use a dedicated {@link reactor.core.scheduler.Scheduler} to emit reactive data signals. Enabling this option can be * useful for reactive sequences that require a significant amount of processing with a single/a few Redis connections. - *

+ *

* A single Redis connection operates on a single thread. Operations that require a significant amount of processing can * lead to a single-threaded-like behavior for all consumers of the Redis connection. When enabled, data signals will be * emitted using a different thread served by {@link ClientResources#eventExecutorGroup()}. Defaults to {@literal false} , diff --git a/src/main/java/io/lettuce/core/GeoArgs.java b/src/main/java/io/lettuce/core/GeoArgs.java index c8ec6b01ed..a74afd9317 100644 --- a/src/main/java/io/lettuce/core/GeoArgs.java +++ b/src/main/java/io/lettuce/core/GeoArgs.java @@ -21,9 +21,9 @@ /** * - * Argument list builder for the Redis GEORADIUS and GEORADIUSBYMEMBER commands. - *

+ * Argument list builder for the Redis GEORADIUS and + * GEORADIUSBYMEMBER commands. + *

* {@link GeoArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/GeoRadiusStoreArgs.java b/src/main/java/io/lettuce/core/GeoRadiusStoreArgs.java index 8ce17e59a4..4a397f8261 100644 --- a/src/main/java/io/lettuce/core/GeoRadiusStoreArgs.java +++ b/src/main/java/io/lettuce/core/GeoRadiusStoreArgs.java @@ -23,7 +23,7 @@ /** * Argument list builder for the Redis GEORADIUS command to store * {@literal GEORADIUS} results or {@literal GEORADIUS} distances in a sorted set. - *

+ *

* {@link GeoRadiusStoreArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/KillArgs.java b/src/main/java/io/lettuce/core/KillArgs.java index 65b2827d7b..f5313dbb43 100644 --- a/src/main/java/io/lettuce/core/KillArgs.java +++ b/src/main/java/io/lettuce/core/KillArgs.java @@ -27,7 +27,7 @@ * * Argument list builder for the Redis CLIENT KILL command. Static import the * methods from {@link Builder} and chain the method calls: {@code id(1).skipme()}. - *

+ *

* {@link KillArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/MigrateArgs.java b/src/main/java/io/lettuce/core/MigrateArgs.java index 4d157b6def..d5726b1539 100644 --- a/src/main/java/io/lettuce/core/MigrateArgs.java +++ b/src/main/java/io/lettuce/core/MigrateArgs.java @@ -27,7 +27,7 @@ /** * Argument list builder for the Redis MIGRATE command. Static import the methods * from {@link Builder} and chain the method calls: {@code copy().auth("foobar")}. - *

+ *

* {@link MigrateArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/Operators.java b/src/main/java/io/lettuce/core/Operators.java index 034ac71633..802f2503a4 100644 --- a/src/main/java/io/lettuce/core/Operators.java +++ b/src/main/java/io/lettuce/core/Operators.java @@ -39,7 +39,7 @@ /** * Operator utilities to handle noop subscriptions, validate request size and to cap concurrent additive operations to * Long.MAX_VALUE, which is generic to {@link Subscription#request(long)} handling. - *

+ *

* This class duplicates some methods from {@link reactor.core.publisher.Operators} to be independent from Reactor API changes. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/RestoreArgs.java b/src/main/java/io/lettuce/core/RestoreArgs.java index 9f7fe2dcf2..0a7931bacc 100644 --- a/src/main/java/io/lettuce/core/RestoreArgs.java +++ b/src/main/java/io/lettuce/core/RestoreArgs.java @@ -22,7 +22,7 @@ /** * Argument list builder for the Redis RESTORE command. Static import the methods * from {@link RestoreArgs.Builder} and call the methods: {@code ttl(…)} . - *

+ *

* {@link RestoreArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/ScanArgs.java b/src/main/java/io/lettuce/core/ScanArgs.java index f1624b1de0..1be78e2175 100644 --- a/src/main/java/io/lettuce/core/ScanArgs.java +++ b/src/main/java/io/lettuce/core/ScanArgs.java @@ -29,7 +29,7 @@ * Argument list builder for the Redis scan commands ({@literal SCAN, HSCAN, SSCAN, ZSCAN}). Static import the methods from * * {@link Builder} and chain the method calls: {@code matches("weight_*").limit(0, 2)}. - *

+ *

* {@link ScanArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/SetArgs.java b/src/main/java/io/lettuce/core/SetArgs.java index ad2458ef47..b3460831e8 100644 --- a/src/main/java/io/lettuce/core/SetArgs.java +++ b/src/main/java/io/lettuce/core/SetArgs.java @@ -20,7 +20,7 @@ /** * Argument list builder for the Redis SET command starting from Redis 2.6.12. Static * import the methods from {@link Builder} and chain the method calls: {@code ex(10).nx()}. - *

+ *

* {@link SetArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Will Glozer diff --git a/src/main/java/io/lettuce/core/SocketOptions.java b/src/main/java/io/lettuce/core/SocketOptions.java index 40a0fb7a3b..88d4bc2999 100644 --- a/src/main/java/io/lettuce/core/SocketOptions.java +++ b/src/main/java/io/lettuce/core/SocketOptions.java @@ -144,7 +144,7 @@ public Builder keepAlive(boolean keepAlive) { * Sets whether to disable Nagle's algorithm. Defaults to {@literal false} (Nagle enabled). See * {@link #DEFAULT_SO_NO_DELAY}. * - * @param tcpNoDelay {@literal true} to disable Nagle's algorithm, {@link false} to enable Nagle's algorithm. + * @param tcpNoDelay {@literal true} to disable Nagle's algorithm, {@literal false} to enable Nagle's algorithm. * @return {@code this} * @see java.net.SocketOptions#TCP_NODELAY */ @@ -186,7 +186,7 @@ public boolean isKeepAlive() { /** * Returns whether to use TCP NoDelay. * - * @return {@literal true} to disable Nagle's algorithm, {@link false} to enable Nagle's algorithm. + * @return {@literal true} to disable Nagle's algorithm, {@literal false} to enable Nagle's algorithm. * @see java.net.SocketOptions#TCP_NODELAY */ public boolean isTcpNoDelay() { diff --git a/src/main/java/io/lettuce/core/SortArgs.java b/src/main/java/io/lettuce/core/SortArgs.java index 83854f0129..eabb8eafd4 100644 --- a/src/main/java/io/lettuce/core/SortArgs.java +++ b/src/main/java/io/lettuce/core/SortArgs.java @@ -28,7 +28,7 @@ /** * Argument list builder for the Redis SORT command. Static import the methods from * {@link Builder} and chain the method calls: {@code by("weight_*").desc().limit(0, 2)}. - *

+ *

* {@link ScanArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Will Glozer diff --git a/src/main/java/io/lettuce/core/XAddArgs.java b/src/main/java/io/lettuce/core/XAddArgs.java index a102df264f..c4a36cf9e6 100644 --- a/src/main/java/io/lettuce/core/XAddArgs.java +++ b/src/main/java/io/lettuce/core/XAddArgs.java @@ -22,7 +22,7 @@ /** * Argument list builder for the Redis XADD command. Static import the methods from * {@link Builder} and call the methods: {@code maxlen(…)} . - *

+ *

* {@link XAddArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/XClaimArgs.java b/src/main/java/io/lettuce/core/XClaimArgs.java index 0d9743ad6a..47ab109579 100644 --- a/src/main/java/io/lettuce/core/XClaimArgs.java +++ b/src/main/java/io/lettuce/core/XClaimArgs.java @@ -27,7 +27,7 @@ /** * Argument list builder for the Redis XCLAIM command. Static import the methods * from {@link XClaimArgs.Builder} and call the methods: {@code minIdleTime(…)} . - *

+ *

* {@link XClaimArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/XReadArgs.java b/src/main/java/io/lettuce/core/XReadArgs.java index 52104c3127..1ec9c35e9e 100644 --- a/src/main/java/io/lettuce/core/XReadArgs.java +++ b/src/main/java/io/lettuce/core/XReadArgs.java @@ -24,7 +24,7 @@ /** * Argument list builder for the Redis XREAD and {@literal XREADGROUP} commands. * Static import the methods from {@link XReadArgs.Builder} and call the methods: {@code block(…)} . - *

+ *

* {@link XReadArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/ZAddArgs.java b/src/main/java/io/lettuce/core/ZAddArgs.java index cae4dd4952..13ed74971c 100644 --- a/src/main/java/io/lettuce/core/ZAddArgs.java +++ b/src/main/java/io/lettuce/core/ZAddArgs.java @@ -20,7 +20,7 @@ /** * Argument list builder for the improved Redis ZADD command starting from Redis * 3.0.2. Static import the methods from {@link Builder} and call the methods: {@code xx()} or {@code nx()} . - *

+ *

* {@link ZAddArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/ZStoreArgs.java b/src/main/java/io/lettuce/core/ZStoreArgs.java index df3b824b87..c4c69d043b 100644 --- a/src/main/java/io/lettuce/core/ZStoreArgs.java +++ b/src/main/java/io/lettuce/core/ZStoreArgs.java @@ -24,11 +24,11 @@ import io.lettuce.core.protocol.CommandArgs; /** - * Argument list builder for the Redis ZUNIONSTORE and ZINTERSTORE commands. Static import the methods from {@link Builder} and + * Argument list builder for the Redis ZUNIONSTORE and + * ZINTERSTORE commands. Static import the methods from {@link Builder} and * chain the method calls: {@code weights(1, 2).max()}. * - *

+ *

* {@link ZAddArgs} is a mutable object and instances should be used only once to avoid shared mutable state. * * @author Will Glozer diff --git a/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java index 6912cde1bb..fc37b99b1b 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java @@ -200,15 +200,11 @@ public interface RedisServerAsyncCommands { /** * Make the server crash: Out of memory. - * - * @return nothing, because the server crashes before returning. */ void debugOom(); /** * Make the server crash: Invalid pointer access. - * - * @return nothing, because the server crashes before returning. */ void debugSegfault(); diff --git a/src/main/java/io/lettuce/core/cluster/models/partitions/RedisClusterNode.java b/src/main/java/io/lettuce/core/cluster/models/partitions/RedisClusterNode.java index cef19592ae..c5259748ae 100644 --- a/src/main/java/io/lettuce/core/cluster/models/partitions/RedisClusterNode.java +++ b/src/main/java/io/lettuce/core/cluster/models/partitions/RedisClusterNode.java @@ -25,11 +25,11 @@ /** * Representation of a Redis Cluster node. A {@link RedisClusterNode} is identified by its {@code nodeId}. - *

+ *

* A {@link RedisClusterNode} can be a {@link #getRole() responsible master} or slave. Masters can be responsible for zero to * {@link io.lettuce.core.cluster.SlotHash#SLOT_COUNT 16384} slots. Each slave refers to exactly one {@link #getSlaveOf() * master}. Nodes can have different {@link io.lettuce.core.cluster.models.partitions.RedisClusterNode.NodeFlag flags} assigned. - *

+ *

* This class is mutable and not thread-safe if mutated by multiple threads concurrently. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/masterslave/CompletableEventLatchSupport.java b/src/main/java/io/lettuce/core/masterslave/CompletableEventLatchSupport.java index 6ff8f561c9..22dd57f916 100644 --- a/src/main/java/io/lettuce/core/masterslave/CompletableEventLatchSupport.java +++ b/src/main/java/io/lettuce/core/masterslave/CompletableEventLatchSupport.java @@ -23,7 +23,7 @@ * Completable latch support expecting an number of inbound events to trigger an outbound event signalled though a * {@link CompletionStage}. This latch is created by specifying a number of expected events of type {@code T} or exceptions and * synchronized through either a timeout or receiving the matching number of events. - *

+ *

* Inbound events can be consumed through callback hook methods. Events arriving after synchronization are dropped. * * @author Mark Paluch diff --git a/src/main/java/io/lettuce/core/masterslave/Connections.java b/src/main/java/io/lettuce/core/masterslave/Connections.java index e04939dbaa..35426dac82 100644 --- a/src/main/java/io/lettuce/core/masterslave/Connections.java +++ b/src/main/java/io/lettuce/core/masterslave/Connections.java @@ -39,9 +39,9 @@ /** * Connection collector with non-blocking synchronization. This synchronizer emits itself through a {@link Mono} as soon as it * gets synchronized via either receiving connects/exceptions from all connections or timing out. - *

+ *

* It can be used only once via {@link #getOrTimeout(Duration, ScheduledExecutorService)}. - *

+ *

* Synchronizer uses a gate to determine whether it was already emitted or awaiting incoming events (exceptions, successful * connects). Connections arriving after closing the gate are discarded. * diff --git a/src/main/java/io/lettuce/core/resource/ClientResources.java b/src/main/java/io/lettuce/core/resource/ClientResources.java index 9776d3bfa6..6697652199 100644 --- a/src/main/java/io/lettuce/core/resource/ClientResources.java +++ b/src/main/java/io/lettuce/core/resource/ClientResources.java @@ -89,7 +89,7 @@ interface Builder { * Sets the {@link CommandLatencyCollectorOptions} that can that can be used across different instances of the * RedisClient. The options are only effective if no {@code commandLatencyCollector} is provided. * - * @param commandLatencyCollectorOptions the command latency collector options, must not be {@link null}. + * @param commandLatencyCollectorOptions the command latency collector options, must not be {@literal null}. * @return {@code this} {@link Builder}. */ Builder commandLatencyCollectorOptions(CommandLatencyCollectorOptions commandLatencyCollectorOptions); @@ -116,7 +116,7 @@ interface Builder { * Sets the {@link SocketAddressResolver} that is used to resolve {@link io.lettuce.core.RedisURI} to * {@link java.net.SocketAddress}. Defaults to {@link SocketAddressResolver} using the configured {@link DnsResolver}. * - * @param socketAddressResolver the socket address resolver, must not be {@link null}. + * @param socketAddressResolver the socket address resolver, must not be {@literal null}. * @return {@code this} {@link Builder}. * @since 5.1 */ @@ -126,7 +126,7 @@ interface Builder { * Sets the {@link DnsResolver} that is used to resolve hostnames to {@link java.net.InetAddress}. Defaults to * {@link DnsResolvers#JVM_DEFAULT} * - * @param dnsResolver the DNS resolver, must not be {@link null}. + * @param dnsResolver the DNS resolver, must not be {@literal null}. * @return {@code this} {@link Builder}. * @since 4.3 */ diff --git a/src/main/java/io/lettuce/core/resource/DefaultClientResources.java b/src/main/java/io/lettuce/core/resource/DefaultClientResources.java index ffbf7dadfa..7400ee3ea5 100644 --- a/src/main/java/io/lettuce/core/resource/DefaultClientResources.java +++ b/src/main/java/io/lettuce/core/resource/DefaultClientResources.java @@ -395,7 +395,7 @@ public Builder commandLatencyPublisherOptions(EventPublisherOptions commandLaten * Sets the {@link CommandLatencyCollectorOptions} that can that can be used across different instances of the * RedisClient. The options are only effective if no {@code commandLatencyCollector} is provided. * - * @param commandLatencyCollectorOptions the command latency collector options, must not be {@link null}. + * @param commandLatencyCollectorOptions the command latency collector options, must not be {@literal null}. * @return {@code this} {@link Builder}. */ @Override @@ -427,7 +427,7 @@ public Builder commandLatencyCollector(CommandLatencyCollector commandLatencyCol * Sets the {@link SocketAddressResolver} that is used to resolve {@link io.lettuce.core.RedisURI} to * {@link java.net.SocketAddress}. Defaults to {@link SocketAddressResolver} using the configured {@link DnsResolver}. * - * @param socketAddressResolver the socket address resolver, must not be {@link null}. + * @param socketAddressResolver the socket address resolver, must not be {@literal null}. * @return {@code this} {@link ClientResources.Builder}. * @since 5.1 */ @@ -444,7 +444,7 @@ public ClientResources.Builder socketAddressResolver(SocketAddressResolver socke * Sets the {@link DnsResolver} that is used to resolve hostnames to {@link java.net.InetAddress}. Defaults to * {@link DnsResolvers#JVM_DEFAULT} * - * @param dnsResolver the DNS resolver, must not be {@link null}. + * @param dnsResolver the DNS resolver, must not be {@literal null}. * @return {@code this} {@link Builder}. * @since 4.3 */ diff --git a/src/main/java/io/lettuce/core/tracing/BraveTracing.java b/src/main/java/io/lettuce/core/tracing/BraveTracing.java index c978d883bd..0eb267d424 100644 --- a/src/main/java/io/lettuce/core/tracing/BraveTracing.java +++ b/src/main/java/io/lettuce/core/tracing/BraveTracing.java @@ -31,7 +31,7 @@ * {@link io.lettuce.core.tracing.Tracer.Span} to trace the actual command. A parent {@link brave.Span} is picked up for * imperative (synchronous/asynchronous) API usage from {@link brave.Tracing#currentTracer()}. The context is not propagated * across asynchronous call chains resulting from {@link java.util.concurrent.CompletionStage} chaining. - *

+ *

* Reactive API usage leverages Reactor's {@link reactor.util.context.Context} so that subscribers can register one of the * following objects (using their {@link Class} as context key): *