Skip to content

Commit

Permalink
Polishing #1693
Browse files Browse the repository at this point in the history
Fix javadoc references. Include micrometer in assembly.
  • Loading branch information
mp911de committed Mar 30, 2021
1 parent 5f118d4 commit d2f6ace
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 47 deletions.
7 changes: 3 additions & 4 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ Lettuce 6.1.0 RELEASE NOTES

The Lettuce team is delighted to announce general availability of Lettuce 6.1.

This is a massive release thanks to all the community contributions. This release ships mostly with command updates to support Redis 6.2.

This is a massive release thanks to all the community contributions.
Most notable changes that ship with this release are:

* Support for Redis 6.2 commands and command changes
* Support for Redis 6.2 commands and modifier/argument updates
* Micrometer integration
* `CommandListeners` API to intercept Redis commands
* extended Keep-Alive options
* Coroutine variant of `ScanStream`
* TCP NoDelay enabled by default
* Experimental support for io_uring
* Experimental support for `io_uring`
* Java Flight Recorder Integration for Connection and Cluster Events

Lettuce 6 supports Redis 2.6+ up to Redis 6.x. In terms of Java runtime, Lettuce requires at least Java 8 and works with Java 16.
Expand Down
1 change: 1 addition & 0 deletions src/assembly/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<include>org.apache.commons:*</include>
<include>org.latencyutils:*</include>
<include>org.hdrhistogram:*</include>
<include>io.micrometer:*</include>
</includes>
<outputDirectory>dependencies</outputDirectory>
<unpack>false</unpack>
Expand Down
2 changes: 1 addition & 1 deletion src/main/asciidoc/new-features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Configuration of netty's `AddressResolverGroup` through `ClientResources`.
Uses `DnsAddressResolverGroup` when `netty-resolver-dns` is on the classpath.
* Add support for Redis ACL commands.
* Java Flight Recorder Events
* <<events.flight-recorder,Java Flight Recorder Events>>

[[new-features.6-0-0]]
== What's new in Lettuce 6.0
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/lettuce/core/GetExArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static GetExArgs pxAt(Instant timestamp) {
* Creates new {@link GetExArgs} and enable {@literal PERSIST}.
*
* @return new {@link GetExArgs} with {@literal PERSIST} enabled.
* @see GetExArgs#nx()
* @see GetExArgs#persist()
*/
public static GetExArgs persist() {
return new GetExArgs().persist();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/lettuce/core/KillArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public KillArgs id(long id) {
}

/**
* This closes the connections of all the clients in the specified {@link Type class}. Note that clients blocked into the
* This closes the connections of all the clients in the specified {@link KillArgs.Type}. Note that clients blocked into the
* {@literal MONITOR} command are considered to belong to the normal class.
*
* @param type must not be {@code null}.
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/io/lettuce/core/RedisURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ public RedisURI() {
* @param host the host
* @param port the port
* @param timeout timeout value
* @param timeout unit of the timeout value
*/
public RedisURI(String host, int port, Duration timeout) {

Expand Down Expand Up @@ -505,7 +504,7 @@ public void setTimeout(Duration timeout) {
/**
* Returns the Redis database number. Databases are only available for Redis Standalone and Redis Master/Slave.
*
* @return
* @return the Redis database number
*/
public int getDatabase() {
return database;
Expand All @@ -526,7 +525,7 @@ public void setDatabase(int database) {
/**
* Returns the client name.
*
* @return
* @return the client name.
* @since 4.4
*/
public String getClientName() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/lettuce/core/XAutoClaimArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private Builder() {
* @param minIdleTime
* @param startId
* @param <K>
* @return
* @return new {@link XAutoClaimArgs} with {@code minIdleTime} and {@code startId} configured.
*/
public static <K> XAutoClaimArgs<K> justid(Consumer<K> consumer, long minIdleTime, String startId) {
return new XAutoClaimArgs<K>().justid().consumer(consumer).minIdleTime(minIdleTime).startId(startId);
Expand All @@ -75,7 +75,7 @@ public static <K> XAutoClaimArgs<K> justid(Consumer<K> consumer, long minIdleTim
* @param minIdleTime
* @param startId
* @param <K>
* @return
* @return new {@link XAutoClaimArgs} with {@code minIdleTime} and {@code startId} configured.
*/
public static <K> XAutoClaimArgs<K> justid(Consumer<K> consumer, Duration minIdleTime, String startId) {
return new XAutoClaimArgs<K>().justid().consumer(consumer).minIdleTime(minIdleTime).startId(startId);
Expand All @@ -88,7 +88,7 @@ public static <K> XAutoClaimArgs<K> justid(Consumer<K> consumer, Duration minIdl
* @param minIdleTime
* @param startId
* @param <K>
* @return
* @return new {@link XAutoClaimArgs} with {@code minIdleTime} and {@code startId} configured.
*/
public static <K> XAutoClaimArgs<K> xautoclaim(Consumer<K> consumer, long minIdleTime, String startId) {
return new XAutoClaimArgs<K>().consumer(consumer).minIdleTime(minIdleTime).startId(startId);
Expand All @@ -101,7 +101,7 @@ public static <K> XAutoClaimArgs<K> xautoclaim(Consumer<K> consumer, long minIdl
* @param minIdleTime
* @param startId
* @param <K>
* @return
* @return new {@link XAutoClaimArgs} with {@code minIdleTime} and {@code startId} configured.
*/
public static <K> XAutoClaimArgs<K> xautoclaim(Consumer<K> consumer, Duration minIdleTime, String startId) {
return new XAutoClaimArgs<K>().consumer(consumer).minIdleTime(minIdleTime).startId(startId);
Expand Down
25 changes: 16 additions & 9 deletions src/main/java/io/lettuce/core/XPendingArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author dengliming
* @since 6.1
*/
public class XPendingArgs<K> {
public class XPendingArgs<K> implements CompositeArgument {

private Consumer<K> consumer;

Expand All @@ -54,30 +54,34 @@ private Builder() {
/**
* Create a new {@link XPendingArgs} .
*
* @param consumer
* @param range
* @param limit
* @param consumer the consumer
* @param range the range of message Id's
* @param limit limit {@code COUNT}
* @return a new {@link XPendingArgs} with {@link Range} and {@link Limit} applied.
*/
public static <K> XPendingArgs<K> xpending(Consumer<K> consumer, Range<String> range, Limit limit) {
return new XPendingArgs<K>().consumer(consumer).range(range).limit(limit);
}
}

public XPendingArgs<K> range(Range<String> range) {

LettuceAssert.notNull(range, "Range must not be null");

this.range = range;
return this;
}

public XPendingArgs<K> consumer(Consumer<K> consumer) {

LettuceAssert.notNull(consumer, "Consumer must not be null");

this.consumer = consumer;
return this;
}

public XPendingArgs<K> limit(Limit limit) {

LettuceAssert.notNull(limit, "Limit must not be null");

this.limit = limit;
Expand All @@ -88,27 +92,30 @@ public XPendingArgs<K> limit(Limit limit) {
* Include only entries that are idle for {@link Duration}.
*
* @param timeout
* @return
* @return {@code this} {@link XPendingArgs}.
*/
public XPendingArgs<K> idle(Duration timeout) {

LettuceAssert.notNull(timeout, "Timeout must not be null");

return idle(timeout.toMillis());
}

/**
* Include only entries that are idle for {@code milliseconds}.
*
* @param milliseconds
* @return
* @return {@code this} {@link XPendingArgs}.
*/
public XPendingArgs<K> idle(long milliseconds) {
this.idle = milliseconds;
return this;
}

public <V> void build(CommandArgs<K, V> args) {
@Override
public <K, V> void build(CommandArgs<K, V> args) {

args.addKey(consumer.group);
args.addKey((K) consumer.group);

if (idle != null) {
args.add(CommandKeyword.IDLE).add(idle);
Expand All @@ -127,6 +134,6 @@ public <V> void build(CommandArgs<K, V> args) {
}

args.add(limit.isLimited() ? limit.getCount() : Long.MAX_VALUE);
args.addKey(consumer.name);
args.addKey((K) consumer.name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public interface RedisGeoAsyncCommands<K, V> {
* Multi geo add.
*
* @param key the key of the geo set.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand All @@ -85,7 +85,7 @@ public interface RedisGeoAsyncCommands<K, V> {
*
* @param key the key of the geo set.
* @param args additional arguments.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public interface RedisGeoReactiveCommands<K, V> {
* Multi geo add.
*
* @param key the key of the geo set.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand All @@ -83,7 +83,7 @@ public interface RedisGeoReactiveCommands<K, V> {
*
* @param key the key of the geo set.
* @param args additional arguments.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/lettuce/core/api/sync/RedisGeoCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public interface RedisGeoCommands<K, V> {
* Multi geo add.
*
* @param key the key of the geo set.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand All @@ -84,7 +84,7 @@ public interface RedisGeoCommands<K, V> {
*
* @param key the key of the geo set.
* @param args additional arguments.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public interface NodeSelectionGeoAsyncCommands<K, V> {
* Multi geo add.
*
* @param key the key of the geo set.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand All @@ -84,7 +84,7 @@ public interface NodeSelectionGeoAsyncCommands<K, V> {
*
* @param key the key of the geo set.
* @param args additional arguments.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public interface NodeSelectionGeoCommands<K, V> {
* Multi geo add.
*
* @param key the key of the geo set.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand All @@ -84,7 +84,7 @@ public interface NodeSelectionGeoCommands<K, V> {
*
* @param key the key of the geo set.
* @param args additional arguments.
* @param values {@link io.lettuce.core.GeoValue} values to add.
* @param lngLatMember triplets of double longitude, double latitude and V member.
* @return Long integer-reply the number of elements that were added to the set.
* @since 6.1
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
package io.lettuce.core.cluster.models.partitions;

import java.io.Serializable;
import java.util.*;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.function.IntConsumer;

import io.lettuce.core.RedisURI;
import io.lettuce.core.cluster.SlotHash;
import io.lettuce.core.internal.LettuceAssert;
import io.lettuce.core.models.role.RedisInstance;
import io.lettuce.core.models.role.RedisNodeDescription;

/**
Expand Down Expand Up @@ -393,7 +399,7 @@ public boolean hasSlot(int slot) {
}

/**
* Returns the {@link Role} of the Redis Cluster node based on the {@link #getFlags() flags}.
* Returns the {@link RedisInstance.Role} of the Redis Cluster node based on the {@link #getFlags() flags}.
*
* @return the Redis Cluster node role
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public interface ClusterTopologyRefresh {
/**
* Create a new {@link ClusterTopologyRefresh} instance.
*
* @param nodeConnectionFactory
* @param clientResources
* @return
* @param nodeConnectionFactory the connection factory to open connections to specific cluster nodes
* @param clientResources shared client resources
* @return a new {@link ClusterTopologyRefresh} instance.
*/
static ClusterTopologyRefresh create(NodeConnectionFactory nodeConnectionFactory, ClientResources clientResources) {
return new DefaultClusterTopologyRefresh(nodeConnectionFactory, clientResources);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@
import java.io.IOException;
import java.net.SocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringJoiner;
import java.util.TreeSet;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -73,6 +86,7 @@ public DefaultClusterTopologyRefresh(NodeConnectionFactory nodeConnectionFactory
* @param discovery {@code true} to discover additional nodes
* @return mapping between {@link RedisURI} and {@link Partitions}
*/
@Override
public CompletionStage<Map<RedisURI, Partitions>> loadViews(Iterable<RedisURI> seed, Duration connectTimeout,
boolean discovery) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface CommandLatencyRecorder {
/**
* Returns a disabled no-op {@link CommandLatencyRecorder}.
*
* @return
* @return a disabled {@link CommandLatencyRecorder}.
*/
static CommandLatencyRecorder disabled() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public DefaultCommandLatencyCollector(CommandLatencyCollectorOptions options) {
* @param firstResponseLatency latency value in {@link TimeUnit#NANOSECONDS} from send to the first response
* @param completionLatency latency value in {@link TimeUnit#NANOSECONDS} from send to the command completion
*/
@Override
public void recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType,
long firstResponseLatency, long completionLatency) {

Expand Down
Loading

0 comments on commit d2f6ace

Please sign in to comment.