Skip to content

Support Spring-Boot 2.5.x #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public final class RedisCommand {
public static final String LINSERT = "LINSERT";
public static final String LLEN = "LLEN";
public static final String LPOP = "LPOP";
public static final String LPOS = "LPOS";
public static final String LPUSH = "LPUSH";
public static final String LPUSHX = "LPUSHX";
public static final String LRANGE = "LRANGE";
Expand Down Expand Up @@ -247,6 +248,8 @@ public final class RedisCommand {
public static final String HSCAN = "HSCAN";
public static final String ZSCAN = "ZSCAN";
public static final String XADD = "XADD";
public static final String XCLAIM = "XCLAIM";
public static final String XINFO = "XINFO";
public static final String XRANGE = "XRANGE";
public static final String XREVRANGE = "XREVRANGE";
public static final String XLEN = "XLEN";
Expand Down
6 changes: 3 additions & 3 deletions opentracing-redis-spring-data2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<description>OpenTracing Instrumentation for Spring Redis classes</description>

<properties>
<spring.data.redis.version>2.2.4.RELEASE</spring.data.redis.version>
<spring-boot.version>2.2.4.RELEASE</spring-boot.version>
<spring.version>5.2.3.RELEASE</spring.version>
<spring.data.redis.version>2.5.4</spring.data.redis.version>
<spring-boot.version>2.5.3</spring-boot.version>
<spring.version>5.3.9</spring.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
import io.opentracing.contrib.redis.common.RedisCommand;
import io.opentracing.contrib.redis.common.TracingConfiguration;
import io.opentracing.contrib.redis.common.TracingHelper;
import java.nio.ByteBuffer;
import java.util.Collection;
import java.util.Map;
import org.springframework.data.redis.connection.ClusterInfo;
import org.springframework.data.redis.connection.ReactiveClusterGeoCommands;
import org.springframework.data.redis.connection.ReactiveClusterHashCommands;
import org.springframework.data.redis.connection.ReactiveClusterHyperLogLogCommands;
Expand All @@ -31,6 +35,7 @@
import org.springframework.data.redis.connection.ReactiveRedisClusterConnection;
import org.springframework.data.redis.connection.ReactiveScriptingCommands;
import org.springframework.data.redis.connection.RedisClusterNode;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public class TracingReactiveRedisClusterConnection implements ReactiveRedisClusterConnection {
Expand Down Expand Up @@ -129,4 +134,89 @@ public ReactiveScriptingCommands scriptingCommands() {
public Mono<String> ping() {
return helper.doInScope(RedisCommand.PING, () -> reactiveRedisClusterConnection.ping());
}

@Override
public Flux<RedisClusterNode> clusterGetNodes() {
return reactiveRedisClusterConnection.clusterGetNodes();
}

@Override
public Flux<RedisClusterNode> clusterGetSlaves(RedisClusterNode master) {
return reactiveRedisClusterConnection.clusterGetSlaves(master);
}

@Override
public Mono<Map<RedisClusterNode, Collection<RedisClusterNode>>> clusterGetMasterSlaveMap() {
return reactiveRedisClusterConnection.clusterGetMasterSlaveMap();
}

@Override
public Mono<Integer> clusterGetSlotForKey(ByteBuffer key) {
return reactiveRedisClusterConnection.clusterGetSlotForKey(key);
}

@Override
public Mono<RedisClusterNode> clusterGetNodeForSlot(int slot) {
return reactiveRedisClusterConnection.clusterGetNodeForSlot(slot);
}

@Override
public Mono<RedisClusterNode> clusterGetNodeForKey(ByteBuffer key) {
return reactiveRedisClusterConnection.clusterGetNodeForKey(key);
}

@Override
public Mono<ClusterInfo> clusterGetClusterInfo() {
return reactiveRedisClusterConnection.clusterGetClusterInfo();
}

@Override
public Mono<Void> clusterAddSlots(RedisClusterNode node, int... slots) {
return reactiveRedisClusterConnection.clusterAddSlots(node, slots);
}

@Override
public Mono<Void> clusterAddSlots(RedisClusterNode node, RedisClusterNode.SlotRange range) {
return reactiveRedisClusterConnection.clusterAddSlots(node, range);
}

@Override
public Mono<Long> clusterCountKeysInSlot(int slot) {
return reactiveRedisClusterConnection.clusterCountKeysInSlot(slot);
}

@Override
public Mono<Void> clusterDeleteSlots(RedisClusterNode node, int... slots) {
return reactiveRedisClusterConnection.clusterDeleteSlots(node, slots);
}

@Override
public Mono<Void> clusterDeleteSlotsInRange(RedisClusterNode node, RedisClusterNode.SlotRange range) {
return reactiveRedisClusterConnection.clusterDeleteSlotsInRange(node, range);
}

@Override
public Mono<Void> clusterForget(RedisClusterNode node) {
return reactiveRedisClusterConnection.clusterForget(node);
}

@Override
public Mono<Void> clusterMeet(RedisClusterNode node) {
return reactiveRedisClusterConnection.clusterMeet(node);
}

@Override
public Mono<Void> clusterSetSlot(RedisClusterNode node, int slot, AddSlots mode) {
return reactiveRedisClusterConnection.clusterSetSlot(node, slot, mode);
}

@Override
public Flux<ByteBuffer> clusterGetKeysInSlot(int slot, int count) {
return reactiveRedisClusterConnection.clusterGetKeysInSlot(slot, count);
}

@Override
public Mono<Void> clusterReplicate(RedisClusterNode master, RedisClusterNode replica) {
return reactiveRedisClusterConnection.clusterReplicate(master, replica);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import static io.opentracing.contrib.redis.common.RedisCommand.CLUSTER_SLAVES;
import static io.opentracing.contrib.redis.common.RedisCommand.CONFIG_GET;
import static io.opentracing.contrib.redis.common.RedisCommand.CONFIG_RESETSTAT;
import static io.opentracing.contrib.redis.common.RedisCommand.CONFIG_REWRITE;
import static io.opentracing.contrib.redis.common.RedisCommand.CONFIG_SET;
import static io.opentracing.contrib.redis.common.RedisCommand.DBSIZE;
import static io.opentracing.contrib.redis.common.RedisCommand.EXECUTE;
Expand All @@ -55,6 +56,7 @@
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.springframework.data.redis.connection.ClusterInfo;
import org.springframework.data.redis.connection.RedisClusterConnection;
import org.springframework.data.redis.connection.RedisClusterNode;
Expand Down Expand Up @@ -264,11 +266,21 @@ public void resetConfigStats(RedisClusterNode node) {
helper.doInScope(CONFIG_RESETSTAT, () -> connection.resetConfigStats(node));
}

@Override
public void rewriteConfig(RedisClusterNode node) {
helper.doInScope(CONFIG_REWRITE, () -> connection.rewriteConfig(node));
}

@Override
public Long time(RedisClusterNode node) {
return helper.doInScope(TIME, () -> connection.time(node));
}

@Override
public Long time(RedisClusterNode node, TimeUnit timeUnit) {
return helper.doInScope(TIME, () -> connection.time(node, timeUnit));
}

@Override
public List<RedisClientInfo> getClientList(RedisClusterNode node) {
return helper.doInScope(CLIENT_LIST, () -> connection.getClientList(node));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@
import org.springframework.data.redis.connection.stream.ByteRecord;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.PendingMessages;
import org.springframework.data.redis.connection.stream.PendingMessagesSummary;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.RecordId;
import org.springframework.data.redis.connection.stream.StreamInfo;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.connection.stream.StreamReadOptions;
import org.springframework.data.redis.core.Cursor;
Expand Down Expand Up @@ -473,6 +476,11 @@ public Long rPush(byte[] key, byte[]... values) {
return helper.doInScope(RedisCommand.RPUSH, key, () -> connection.rPush(key, values));
}

@Override
public List<Long> lPos(byte[] key, byte[] element, Integer rank, Integer count) {
return helper.doInScope(RedisCommand.LPOS, key, () -> connection.lPos(key, element, rank, count));
}

@Override
public Long lPush(byte[] key, byte[]... values) {
return helper.doInScope(RedisCommand.LPUSH, key, () -> connection.lPush(key, values));
Expand Down Expand Up @@ -651,11 +659,21 @@ public Boolean zAdd(byte[] key, double score, byte[] value) {
return helper.doInScope(RedisCommand.ZADD, key, () -> connection.zAdd(key, score, value));
}

@Override
public Boolean zAdd(byte[] key, double score, byte[] value, ZAddArgs args) {
return helper.doInScope(RedisCommand.ZADD, key, () -> connection.zAdd(key, score, value, args));
}

@Override
public Long zAdd(byte[] key, Set<Tuple> tuples) {
return helper.doInScope(RedisCommand.ZADD, key, () -> connection.zAdd(key, tuples));
}

@Override
public Long zAdd(byte[] key, Set<Tuple> tuples, ZAddArgs args) {
return helper.doInScope(RedisCommand.ZADD, key, () -> connection.zAdd(key, tuples, args));
}

@Override
public Long zRem(byte[] key, byte[]... values) {
return helper.doInScope(RedisCommand.ZREM, key, () -> connection.zRem(key, values));
Expand Down Expand Up @@ -820,6 +838,11 @@ public Long zCount(byte[] key, Range range) {
return helper.doInScope(RedisCommand.ZCOUNT, key, () -> connection.zCount(key, range));
}

@Override
public Long zLexCount(byte[] key, Range range) {
return helper.doInScope(RedisCommand.ZLEXCOUNT, key, () -> connection.zLexCount(key, range));
}

@Override
public Long zCard(byte[] key) {
return helper.doInScope(RedisCommand.ZCARD, key, () -> connection.zCard(key));
Expand All @@ -836,6 +859,12 @@ public Long zRemRange(byte[] key, long start, long end) {
.doInScope(RedisCommand.ZREMRANGE, key, () -> connection.zRemRange(key, start, end));
}

@Override
public Long zRemRangeByLex(byte[] key, Range range) {
return helper
.doInScope(RedisCommand.ZREMRANGEBYLEX, key, () -> connection.zRemRangeByLex(key, range));
}

@Override
public Long zRemRangeByScore(byte[] key, double min, double max) {
return helper.doInScope(RedisCommand.ZREMRANGEBYSCORE,
Expand Down Expand Up @@ -905,6 +934,12 @@ public Set<byte[]> zRangeByLex(byte[] key, Range range, Limit limit) {
.doInScope(RedisCommand.ZRANGEBYLEX, key, () -> connection.zRangeByLex(key, range, limit));
}

@Override
public Set<byte[]> zRevRangeByLex(byte[] key, Range range, Limit limit) {
return helper.doInScope(RedisCommand.ZREVRANGEBYLEX, key,
() -> connection.zRevRangeByLex(key, range, limit));
}

@Override
public Boolean hSet(byte[] key, byte[] field, byte[] value) {
return helper.doInScope(RedisCommand.HSET, key, () -> connection.hSet(key, field, value));
Expand Down Expand Up @@ -1110,11 +1145,21 @@ public void resetConfigStats() {
helper.doInScope(RedisCommand.CONFIG_RESETSTAT, () -> connection.resetConfigStats());
}

@Override
public void rewriteConfig() {
helper.doInScope(RedisCommand.CONFIG_REWRITE, () -> connection.rewriteConfig());
}

@Override
public Long time() {
return helper.doInScope(RedisCommand.TIME, () -> connection.time());
}

@Override
public Long time(TimeUnit timeUnit) {
return helper.doInScope(RedisCommand.TIME, () -> connection.time(timeUnit));
}

@Override
public void killClient(String host, int port) {
helper.doInScope(RedisCommand.CLIENT_KILL, () -> connection.killClient(host, port));
Expand Down Expand Up @@ -1305,6 +1350,23 @@ public RecordId xAdd(MapRecord<byte[], byte[], byte[]> record) {
return helper.doInScope(RedisCommand.XADD, () -> connection.xAdd(record));
}

@Override
public RecordId xAdd(MapRecord<byte[], byte[], byte[]> record, XAddOptions xAddOptions) {
return helper.doInScope(RedisCommand.XADD, () -> connection.xAdd(record, xAddOptions));
}

@Override
public List<RecordId> xClaimJustId(byte[] key, String group, String newOwner, XClaimOptions options) {
return helper.doInScope(RedisCommand.XCLAIM, key,
() -> connection.xClaimJustId(key, group, newOwner, options));
}

@Override
public List<ByteRecord> xClaim(byte[] key, String group, String newOwner, XClaimOptions options) {
return helper.doInScope(RedisCommand.XCLAIM, key,
() -> connection.xClaim(key, group, newOwner, options));
}

@Override
public Long xDel(byte[] key, RecordId... recordIds) {
return helper.doInScope(RedisCommand.XDEL, () -> connection.xDel(key, recordIds));
Expand All @@ -1316,6 +1378,12 @@ public String xGroupCreate(byte[] key, String groupName, ReadOffset readOffset)
() -> connection.xGroupCreate(key, groupName, readOffset));
}

@Override
public String xGroupCreate(byte[] key, String groupName, ReadOffset readOffset, boolean mkStream) {
return helper.doInScope(RedisCommand.XGROUPCREATE,
() -> connection.xGroupCreate(key, groupName, readOffset));
}

@Override
public Boolean xGroupDelConsumer(byte[] key, Consumer consumer) {
return helper.doInScope(RedisCommand.XGROUPDELCONSUMER,
Expand All @@ -1328,11 +1396,36 @@ public Boolean xGroupDestroy(byte[] key, String groupName) {
.doInScope(RedisCommand.XGROUPDESTROY, () -> connection.xGroupDestroy(key, groupName));
}

@Override
public StreamInfo.XInfoStream xInfo(byte[] key) {
return helper.doInScope(RedisCommand.XINFO, () -> connection.xInfo(key));
}

@Override
public StreamInfo.XInfoGroups xInfoGroups(byte[] key) {
return helper.doInScope(RedisCommand.XINFO, () -> connection.xInfoGroups(key));
}

@Override
public StreamInfo.XInfoConsumers xInfoConsumers(byte[] key, String groupName) {
return helper.doInScope(RedisCommand.XINFO, () -> connection.xInfoConsumers(key, groupName));
}

@Override
public Long xLen(byte[] key) {
return helper.doInScope(RedisCommand.XLEN, () -> connection.xLen(key));
}

@Override
public PendingMessagesSummary xPending(byte[] key, String groupName) {
return helper.doInScope(RedisCommand.XPENDING, () -> connection.xPending(key, groupName));
}

@Override
public PendingMessages xPending(byte[] key, String groupName, XPendingOptions options) {
return helper.doInScope(RedisCommand.XPENDING, () -> connection.xPending(key, groupName, options));
}

@Override
public List<ByteRecord> xRange(byte[] key, org.springframework.data.domain.Range<String> range,
Limit limit) {
Expand Down Expand Up @@ -1361,4 +1454,10 @@ public List<ByteRecord> xRevRange(byte[] key, org.springframework.data.domain.Ra
public Long xTrim(byte[] key, long count) {
return helper.doInScope(RedisCommand.XTRIM, () -> connection.xTrim(key, count));
}

@Override
public Long xTrim(byte[] key, long count, boolean approximateTrimming) {
return helper.doInScope(RedisCommand.XTRIM, () -> connection.xTrim(key, count, approximateTrimming));
}

}
Loading