diff --git a/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingRedisAdvancedClusterAsyncCommands.java b/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingRedisAdvancedClusterAsyncCommands.java new file mode 100644 index 0000000..993f196 --- /dev/null +++ b/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingRedisAdvancedClusterAsyncCommands.java @@ -0,0 +1,3103 @@ +/* + * Copyright 2017-2019 The OpenTracing Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package io.opentracing.contrib.redis.lettuce; + +import static io.opentracing.contrib.redis.common.TracingHelper.nullable; +import static io.opentracing.contrib.redis.common.TracingHelper.onError; + +import io.lettuce.core.BitFieldArgs; +import io.lettuce.core.Consumer; +import io.lettuce.core.GeoArgs; +import io.lettuce.core.GeoArgs.Unit; +import io.lettuce.core.GeoCoordinates; +import io.lettuce.core.GeoRadiusStoreArgs; +import io.lettuce.core.GeoWithin; +import io.lettuce.core.KeyScanCursor; +import io.lettuce.core.KeyValue; +import io.lettuce.core.KillArgs; +import io.lettuce.core.Limit; +import io.lettuce.core.MapScanCursor; +import io.lettuce.core.MigrateArgs; +import io.lettuce.core.Range; +import io.lettuce.core.RedisFuture; +import io.lettuce.core.RestoreArgs; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.ScriptOutputType; +import io.lettuce.core.SetArgs; +import io.lettuce.core.SortArgs; +import io.lettuce.core.StreamMessage; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.UnblockType; +import io.lettuce.core.Value; +import io.lettuce.core.ValueScanCursor; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XReadArgs; +import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZStoreArgs; +import io.lettuce.core.cluster.api.StatefulRedisClusterConnection; +import io.lettuce.core.cluster.api.async.AsyncNodeSelection; +import io.lettuce.core.cluster.api.async.RedisAdvancedClusterAsyncCommands; +import io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands; +import io.lettuce.core.cluster.models.partitions.RedisClusterNode; +import io.lettuce.core.output.CommandOutput; +import io.lettuce.core.output.KeyStreamingChannel; +import io.lettuce.core.output.KeyValueStreamingChannel; +import io.lettuce.core.output.ScoredValueStreamingChannel; +import io.lettuce.core.output.ValueStreamingChannel; +import io.lettuce.core.protocol.CommandArgs; +import io.lettuce.core.protocol.CommandType; +import io.lettuce.core.protocol.ProtocolKeyword; +import io.opentracing.Scope; +import io.opentracing.Span; +import io.opentracing.Tracer; +import io.opentracing.contrib.redis.common.TracingConfiguration; +import io.opentracing.contrib.redis.common.TracingHelper; +import java.time.Duration; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; + +public class TracingRedisAdvancedClusterAsyncCommands implements + RedisAdvancedClusterAsyncCommands { + + private final RedisAdvancedClusterAsyncCommands commands; + private final TracingHelper helper; + private final TracingConfiguration tracingConfiguration; + + public TracingRedisAdvancedClusterAsyncCommands( + RedisAdvancedClusterAsyncCommands commands, + TracingConfiguration tracingConfiguration) { + this.commands = commands; + this.helper = new TracingHelper(tracingConfiguration); + this.tracingConfiguration = tracingConfiguration; + } + + @Override + public String auth(String password) { + Span span = helper.buildSpan("auth"); + try { + return commands.auth(password); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public RedisClusterAsyncCommands getConnection(String nodeId) { + return new TracingRedisAsyncCommands<>(commands.getStatefulConnection() + .getConnection(nodeId).async(), tracingConfiguration); + } + + @Override + public RedisClusterAsyncCommands getConnection(String host, int port) { + return new TracingRedisAsyncCommands<>(commands.getStatefulConnection() + .getConnection(host, port).async(), tracingConfiguration); + } + + @Override + public StatefulRedisClusterConnection getStatefulConnection() { + return new TracingStatefulRedisClusterConnection<>(commands.getStatefulConnection(), + tracingConfiguration); + } + + @Override + public AsyncNodeSelection readonly(Predicate predicate) { + return commands.readonly(predicate); + } + + @Override + public AsyncNodeSelection nodes(Predicate predicate) { + return commands.nodes(predicate); + } + + @Override + public AsyncNodeSelection nodes(Predicate predicate, boolean dynamic) { + return commands.nodes(predicate, dynamic); + } + + @Override + public RedisFuture hdel(K key, K... fields) { + Span span = helper.buildSpan("hdel", key); + return prepareRedisFuture(commands.hdel(key, fields), span); + } + + @Override + public RedisFuture hexists(K key, K field) { + Span span = helper.buildSpan("hexists", key); + return prepareRedisFuture(commands.hexists(key, field), span); + } + + @Override + public RedisFuture hget(K key, K field) { + Span span = helper.buildSpan("hget", key); + return prepareRedisFuture(commands.hget(key, field), span); + } + + @Override + public RedisFuture hincrby(K key, K field, long amount) { + Span span = helper.buildSpan("hincrby", key); + span.setTag("amount", amount); + return prepareRedisFuture(commands.hincrby(key, field, amount), span); + } + + @Override + public RedisFuture hincrbyfloat(K key, K field, double amount) { + Span span = helper.buildSpan("hincrbyfloat", key); + span.setTag("amount", amount); + return prepareRedisFuture(commands.hincrbyfloat(key, field, amount), span); + } + + @Override + public RedisFuture> hgetall(K key) { + Span span = helper.buildSpan("hgetall", key); + return prepareRedisFuture(commands.hgetall(key), span); + } + + @Override + public RedisFuture hgetall( + KeyValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("hgetall", key); + return prepareRedisFuture(commands.hgetall(channel, key), span); + } + + @Override + public RedisFuture> hkeys(K key) { + Span span = helper.buildSpan("hkeys", key); + return prepareRedisFuture(commands.hkeys(key), span); + } + + @Override + public RedisFuture hkeys( + KeyStreamingChannel channel, K key) { + Span span = helper.buildSpan("hkeys", key); + return prepareRedisFuture(commands.hkeys(channel, key), span); + } + + @Override + public RedisFuture hlen(K key) { + Span span = helper.buildSpan("hlen", key); + return prepareRedisFuture(commands.hlen(key), span); + } + + @Override + public RedisFuture>> hmget(K key, + K... fields) { + Span span = helper.buildSpan("hmget", key); + return prepareRedisFuture(commands.hmget(key, fields), span); + } + + @Override + public RedisFuture hmget( + KeyValueStreamingChannel channel, K key, K... fields) { + Span span = helper.buildSpan("hmget", key); + return prepareRedisFuture(commands.hmget(channel, key, fields), span); + } + + @Override + public RedisFuture hmset(K key, Map map) { + Span span = helper.buildSpan("hmset", key); + return prepareRedisFuture(commands.hmset(key, map), span); + } + + @Override + public RedisFuture> hscan(K key) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(key), span); + } + + @Override + public RedisFuture> hscan(K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(key, scanArgs), span); + } + + @Override + public RedisFuture> hscan(K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(key, scanCursor, scanArgs), span); + } + + @Override + public RedisFuture> hscan(K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(key, scanCursor), span); + } + + @Override + public RedisFuture hscan( + KeyValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(channel, key), span); + } + + @Override + public RedisFuture hscan( + KeyValueStreamingChannel channel, K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(channel, key, scanArgs), span); + } + + @Override + public RedisFuture hscan( + KeyValueStreamingChannel channel, K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(channel, key, scanCursor, scanArgs), span); + } + + @Override + public RedisFuture hscan( + KeyValueStreamingChannel channel, K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("hscan", key); + return prepareRedisFuture(commands.hscan(channel, key, scanCursor), span); + } + + @Override + public RedisFuture hset(K key, K field, V value) { + Span span = helper.buildSpan("hset", key); + return prepareRedisFuture(commands.hset(key, field, value), span); + } + + @Override + public RedisFuture hsetnx(K key, K field, V value) { + Span span = helper.buildSpan("hsetnx", key); + return prepareRedisFuture(commands.hsetnx(key, field, value), span); + } + + @Override + public RedisFuture hstrlen(K key, K field) { + Span span = helper.buildSpan("hstrlen", key); + return prepareRedisFuture(commands.hstrlen(key, field), span); + } + + @Override + public RedisFuture> hvals(K key) { + Span span = helper.buildSpan("hvals", key); + return prepareRedisFuture(commands.hvals(key), span); + } + + @Override + public RedisFuture hvals( + ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("hvals", key); + return prepareRedisFuture(commands.hvals(channel, key), span); + } + + @Override + public RedisFuture del(K... keys) { + Span span = helper.buildSpan("del", keys); + return prepareRedisFuture(commands.del(keys), span); + } + + @Override + public RedisFuture unlink(K... keys) { + Span span = helper.buildSpan("unlink", keys); + return prepareRedisFuture(commands.unlink(keys), span); + } + + @Override + public RedisFuture dump(K key) { + Span span = helper.buildSpan("dump", key); + return prepareRedisFuture(commands.dump(key), span); + } + + @Override + public RedisFuture exists(K... keys) { + Span span = helper.buildSpan("exists", keys); + return prepareRedisFuture(commands.exists(keys), span); + } + + @Override + public RedisFuture expire(K key, long seconds) { + Span span = helper.buildSpan("expire", key); + span.setTag("seconds", seconds); + return prepareRedisFuture(commands.expire(key, seconds), span); + } + + @Override + public RedisFuture expireat(K key, Date timestamp) { + Span span = helper.buildSpan("expireat", key); + span.setTag("timestamp", nullable(timestamp)); + return prepareRedisFuture(commands.expireat(key, timestamp), span); + } + + @Override + public RedisFuture expireat(K key, long timestamp) { + Span span = helper.buildSpan("expireat", key); + span.setTag("timestamp", timestamp); + return prepareRedisFuture(commands.expireat(key, timestamp), span); + } + + @Override + public RedisFuture> keys(K pattern) { + Span span = helper.buildSpan("keys"); + return prepareRedisFuture(commands.keys(pattern), span); + } + + @Override + public RedisFuture keys(KeyStreamingChannel channel, + K pattern) { + Span span = helper.buildSpan("keys"); + return prepareRedisFuture(commands.keys(channel, pattern), span); + } + + @Override + public RedisFuture migrate(String host, int port, K key, int db, + long timeout) { + Span span = helper.buildSpan("migrate", key); + span.setTag("host", host); + span.setTag("port", port); + span.setTag("db", db); + span.setTag("timeout", timeout); + return prepareRedisFuture(commands.migrate(host, port, key, db, timeout), span); + } + + @Override + public RedisFuture migrate(String host, int port, int db, long timeout, + MigrateArgs migrateArgs) { + Span span = helper.buildSpan("migrate"); + span.setTag("host", host); + span.setTag("port", port); + span.setTag("db", db); + span.setTag("timeout", timeout); + return prepareRedisFuture(commands.migrate(host, port, db, timeout, migrateArgs), span); + } + + @Override + public RedisFuture move(K key, int db) { + Span span = helper.buildSpan("move", key); + span.setTag("db", db); + return prepareRedisFuture(commands.move(key, db), span); + } + + @Override + public RedisFuture objectEncoding(K key) { + Span span = helper.buildSpan("objectEncoding", key); + return prepareRedisFuture(commands.objectEncoding(key), span); + } + + @Override + public RedisFuture objectIdletime(K key) { + Span span = helper.buildSpan("objectIdletime", key); + return prepareRedisFuture(commands.objectIdletime(key), span); + } + + @Override + public RedisFuture objectRefcount(K key) { + Span span = helper.buildSpan("objectRefcount", key); + return prepareRedisFuture(commands.objectRefcount(key), span); + } + + @Override + public RedisFuture persist(K key) { + Span span = helper.buildSpan("persist", key); + return prepareRedisFuture(commands.persist(key), span); + } + + @Override + public RedisFuture pexpire(K key, long milliseconds) { + Span span = helper.buildSpan("pexpire", key); + span.setTag("milliseconds", milliseconds); + return prepareRedisFuture(commands.pexpire(key, milliseconds), span); + } + + @Override + public RedisFuture pexpireat(K key, Date timestamp) { + Span span = helper.buildSpan("pexpireat", key); + span.setTag("timestamp", nullable(timestamp)); + return prepareRedisFuture(commands.pexpireat(key, timestamp), span); + } + + @Override + public RedisFuture pexpireat(K key, long timestamp) { + Span span = helper.buildSpan("pexpireat", key); + span.setTag("timestamp", timestamp); + return prepareRedisFuture(commands.pexpireat(key, timestamp), span); + } + + @Override + public RedisFuture pttl(K key) { + Span span = helper.buildSpan("pttl", key); + return prepareRedisFuture(commands.pttl(key), span); + } + + @Override + public RedisFuture randomkey() { + Span span = helper.buildSpan("randomkey"); + return prepareRedisFuture(commands.randomkey(), span); + } + + @Override + public RedisFuture rename(K key, K newKey) { + Span span = helper.buildSpan("rename", key); + return prepareRedisFuture(commands.rename(key, newKey), span); + } + + @Override + public RedisFuture renamenx(K key, K newKey) { + Span span = helper.buildSpan("renamenx", key); + return prepareRedisFuture(commands.renamenx(key, newKey), span); + } + + @Override + public RedisFuture restore(K key, long ttl, byte[] value) { + Span span = helper.buildSpan("restore", key); + span.setTag("ttl", ttl); + return prepareRedisFuture(commands.restore(key, ttl, value), span); + } + + @Override + public RedisFuture restore(K key, byte[] value, RestoreArgs args) { + Span span = helper.buildSpan("restore", key); + span.setTag("value", Arrays.toString(value)); + return prepareRedisFuture(commands.restore(key, value, args), span); + } + + @Override + public RedisFuture> sort(K key) { + Span span = helper.buildSpan("sort", key); + return prepareRedisFuture(commands.sort(key), span); + } + + @Override + public RedisFuture sort( + ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("sort", key); + return prepareRedisFuture(commands.sort(channel, key), span); + } + + @Override + public RedisFuture> sort(K key, SortArgs sortArgs) { + Span span = helper.buildSpan("sort", key); + return prepareRedisFuture(commands.sort(key, sortArgs), span); + } + + @Override + public RedisFuture sort( + ValueStreamingChannel channel, K key, + SortArgs sortArgs) { + Span span = helper.buildSpan("sort", key); + return prepareRedisFuture(commands.sort(channel, key, sortArgs), span); + } + + @Override + public RedisFuture sortStore(K key, SortArgs sortArgs, + K destination) { + Span span = helper.buildSpan("sortStore", key); + return prepareRedisFuture(commands.sortStore(key, sortArgs, destination), span); + } + + @Override + public RedisFuture touch(K... keys) { + Span span = helper.buildSpan("touch", keys); + return prepareRedisFuture(commands.touch(keys), span); + } + + @Override + public RedisFuture ttl(K key) { + Span span = helper.buildSpan("ttl", key); + return prepareRedisFuture(commands.ttl(key), span); + } + + @Override + public RedisFuture type(K key) { + Span span = helper.buildSpan("type", key); + return prepareRedisFuture(commands.type(key), span); + } + + @Override + public RedisFuture> scan() { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(), span); + } + + @Override + public RedisFuture> scan( + ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(scanArgs), span); + } + + @Override + public RedisFuture> scan( + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(scanCursor, scanArgs), span); + } + + @Override + public RedisFuture> scan( + ScanCursor scanCursor) { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(scanCursor), span); + } + + @Override + public RedisFuture scan( + KeyStreamingChannel channel) { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(channel), span); + } + + @Override + public RedisFuture scan( + KeyStreamingChannel channel, ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(channel, scanArgs), span); + } + + @Override + public RedisFuture scan( + KeyStreamingChannel channel, ScanCursor scanCursor, + ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(channel, scanCursor, scanArgs), span); + } + + @Override + public RedisFuture scan( + KeyStreamingChannel channel, ScanCursor scanCursor) { + Span span = helper.buildSpan("scan"); + return prepareRedisFuture(commands.scan(channel, scanCursor), span); + } + + @Override + public RedisFuture append(K key, V value) { + Span span = helper.buildSpan("append", key); + return prepareRedisFuture(commands.append(key, value), span); + } + + @Override + public RedisFuture bitcount(K key) { + Span span = helper.buildSpan("bitcount", key); + return prepareRedisFuture(commands.bitcount(key), span); + } + + @Override + public RedisFuture bitcount(K key, long start, long end) { + Span span = helper.buildSpan("bitcount", key); + span.setTag("start", start); + span.setTag("end", end); + return prepareRedisFuture(commands.bitcount(key, start, end), span); + } + + @Override + public RedisFuture> bitfield(K key, + BitFieldArgs bitFieldArgs) { + Span span = helper.buildSpan("bitfield", key); + return prepareRedisFuture(commands.bitfield(key, bitFieldArgs), span); + } + + @Override + public RedisFuture bitpos(K key, boolean state) { + Span span = helper.buildSpan("bitpos", key); + span.setTag("state", state); + return prepareRedisFuture(commands.bitpos(key, state), span); + } + + @Override + public RedisFuture bitpos(K key, boolean state, long start) { + Span span = helper.buildSpan("bitpos", key); + span.setTag("state", state); + span.setTag("start", start); + return prepareRedisFuture(commands.bitpos(key, state, start), span); + } + + @Override + public RedisFuture bitpos(K key, boolean state, long start, long end) { + Span span = helper.buildSpan("bitpos", key); + span.setTag("state", state); + span.setTag("start", start); + span.setTag("end", end); + return prepareRedisFuture(commands.bitpos(key, state, start, end), span); + } + + @Override + public RedisFuture bitopAnd(K destination, K... keys) { + Span span = helper.buildSpan("bitopAnd", keys); + return prepareRedisFuture(commands.bitopAnd(destination, keys), span); + } + + @Override + public RedisFuture bitopNot(K destination, K source) { + Span span = helper.buildSpan("bitopNot"); + return prepareRedisFuture(commands.bitopNot(destination, source), span); + } + + @Override + public RedisFuture bitopOr(K destination, K... keys) { + Span span = helper.buildSpan("bitopOr", keys); + return prepareRedisFuture(commands.bitopOr(destination, keys), span); + } + + @Override + public RedisFuture bitopXor(K destination, K... keys) { + Span span = helper.buildSpan("bitopXor", keys); + return prepareRedisFuture(commands.bitopXor(destination, keys), span); + } + + @Override + public RedisFuture decr(K key) { + Span span = helper.buildSpan("decr", key); + return prepareRedisFuture(commands.decr(key), span); + } + + @Override + public RedisFuture decrby(K key, long amount) { + Span span = helper.buildSpan("decrby", key); + span.setTag("amount", amount); + return prepareRedisFuture(commands.decrby(key, amount), span); + } + + @Override + public RedisFuture get(K key) { + Span span = helper.buildSpan("get", key); + return prepareRedisFuture(commands.get(key), span); + } + + @Override + public RedisFuture getbit(K key, long offset) { + Span span = helper.buildSpan("getbit", key); + span.setTag("offset", offset); + return prepareRedisFuture(commands.getbit(key, offset), span); + } + + @Override + public RedisFuture getrange(K key, long start, long end) { + Span span = helper.buildSpan("getrange", key); + span.setTag("start", start); + span.setTag("end", end); + return prepareRedisFuture(commands.getrange(key, start, end), span); + } + + @Override + public RedisFuture getset(K key, V value) { + Span span = helper.buildSpan("getset", key); + return prepareRedisFuture(commands.getset(key, value), span); + } + + @Override + public RedisFuture incr(K key) { + Span span = helper.buildSpan("incr", key); + return prepareRedisFuture(commands.incr(key), span); + } + + @Override + public RedisFuture incrby(K key, long amount) { + Span span = helper.buildSpan("incrby", key); + span.setTag("amount", amount); + return prepareRedisFuture(commands.incrby(key, amount), span); + } + + @Override + public RedisFuture incrbyfloat(K key, double amount) { + Span span = helper.buildSpan("incrbyfloat", key); + span.setTag("amount", amount); + return prepareRedisFuture(commands.incrbyfloat(key, amount), span); + } + + @Override + public RedisFuture>> mget(K... keys) { + Span span = helper.buildSpan("mget", keys); + return prepareRedisFuture(commands.mget(keys), span); + } + + @Override + public RedisFuture mget( + KeyValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("mget", keys); + return prepareRedisFuture(commands.mget(channel, keys), span); + } + + @Override + public RedisFuture mset(Map map) { + Span span = helper.buildSpan("mset"); + return prepareRedisFuture(commands.mset(map), span); + } + + @Override + public RedisFuture msetnx(Map map) { + Span span = helper.buildSpan("msetnx"); + return prepareRedisFuture(commands.msetnx(map), span); + } + + @Override + public RedisFuture set(K key, V value) { + Span span = helper.buildSpan("set", key); + return prepareRedisFuture(commands.set(key, value), span); + } + + @Override + public RedisFuture set(K key, V value, SetArgs setArgs) { + Span span = helper.buildSpan("set", key); + return prepareRedisFuture(commands.set(key, value, setArgs), span); + } + + @Override + public RedisFuture setbit(K key, long offset, int value) { + Span span = helper.buildSpan("setbit", key); + span.setTag("offset", offset); + span.setTag("value", value); + return prepareRedisFuture(commands.setbit(key, offset, value), span); + } + + @Override + public RedisFuture setex(K key, long seconds, V value) { + Span span = helper.buildSpan("setex", key); + span.setTag("seconds", seconds); + return prepareRedisFuture(commands.setex(key, seconds, value), span); + } + + @Override + public RedisFuture psetex(K key, long milliseconds, V value) { + Span span = helper.buildSpan("psetex", key); + span.setTag("milliseconds", milliseconds); + return prepareRedisFuture(commands.psetex(key, milliseconds, value), span); + } + + @Override + public RedisFuture setnx(K key, V value) { + Span span = helper.buildSpan("setnx", key); + return prepareRedisFuture(commands.setnx(key, value), span); + } + + @Override + public RedisFuture setrange(K key, long offset, V value) { + Span span = helper.buildSpan("setrange", key); + span.setTag("offset", offset); + return prepareRedisFuture(commands.setrange(key, offset, value), span); + } + + @Override + public RedisFuture strlen(K key) { + Span span = helper.buildSpan("strlen", key); + return prepareRedisFuture(commands.strlen(key), span); + } + + @Override + public RedisFuture> blpop(long timeout, K... keys) { + Span span = helper.buildSpan("blpop", keys); + span.setTag("timeout", timeout); + return prepareRedisFuture(commands.blpop(timeout, keys), span); + } + + @Override + public RedisFuture> brpop(long timeout, K... keys) { + Span span = helper.buildSpan("brpop", keys); + span.setTag("timeout", timeout); + return prepareRedisFuture(commands.brpop(timeout, keys), span); + } + + @Override + public RedisFuture brpoplpush(long timeout, K source, K destination) { + Span span = helper.buildSpan("brpoplpush"); + span.setTag("timeout", timeout); + return prepareRedisFuture(commands.brpoplpush(timeout, source, destination), span); + } + + @Override + public RedisFuture lindex(K key, long index) { + Span span = helper.buildSpan("lindex", key); + span.setTag("index", index); + return prepareRedisFuture(commands.lindex(key, index), span); + } + + @Override + public RedisFuture linsert(K key, boolean before, V pivot, V value) { + Span span = helper.buildSpan("linsert", key); + span.setTag("before", before); + return prepareRedisFuture(commands.linsert(key, before, pivot, value), span); + } + + @Override + public RedisFuture llen(K key) { + Span span = helper.buildSpan("llen", key); + return prepareRedisFuture(commands.llen(key), span); + } + + @Override + public RedisFuture lpop(K key) { + Span span = helper.buildSpan("lpop", key); + return prepareRedisFuture(commands.lpop(key), span); + } + + @Override + public RedisFuture lpush(K key, V... values) { + Span span = helper.buildSpan("lpush", key); + return prepareRedisFuture(commands.lpush(key, values), span); + } + + @Override + public RedisFuture lpushx(K key, V... values) { + Span span = helper.buildSpan("lpushx", key); + return prepareRedisFuture(commands.lpushx(key, values), span); + } + + @Override + public RedisFuture> lrange(K key, long start, long stop) { + Span span = helper.buildSpan("lrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.lrange(key, start, stop), span); + } + + @Override + public RedisFuture lrange( + ValueStreamingChannel channel, K key, long start, long stop) { + Span span = helper.buildSpan("lrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.lrange(channel, key, start, stop), span); + } + + @Override + public RedisFuture lrem(K key, long count, V value) { + Span span = helper.buildSpan("lrem", key); + span.setTag("count", count); + return prepareRedisFuture(commands.lrem(key, count, value), span); + } + + @Override + public RedisFuture lset(K key, long index, V value) { + Span span = helper.buildSpan("lset", key); + span.setTag("index", index); + return prepareRedisFuture(commands.lset(key, index, value), span); + } + + @Override + public RedisFuture ltrim(K key, long start, long stop) { + Span span = helper.buildSpan("ltrim", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.ltrim(key, start, stop), span); + } + + @Override + public RedisFuture rpop(K key) { + Span span = helper.buildSpan("rpop", key); + return prepareRedisFuture(commands.rpop(key), span); + } + + @Override + public RedisFuture rpoplpush(K source, K destination) { + Span span = helper.buildSpan("rpoplpush"); + return prepareRedisFuture(commands.rpoplpush(source, destination), span); + } + + @Override + public RedisFuture rpush(K key, V... values) { + Span span = helper.buildSpan("rpush", key); + return prepareRedisFuture(commands.rpush(key, values), span); + } + + @Override + public RedisFuture rpushx(K key, V... values) { + Span span = helper.buildSpan("rpushx", key); + return prepareRedisFuture(commands.rpushx(key, values), span); + } + + @Override + public RedisFuture sadd(K key, V... members) { + Span span = helper.buildSpan("sadd", key); + return prepareRedisFuture(commands.sadd(key, members), span); + } + + @Override + public RedisFuture scard(K key) { + Span span = helper.buildSpan("scard", key); + return prepareRedisFuture(commands.scard(key), span); + } + + @Override + public RedisFuture> sdiff(K... keys) { + Span span = helper.buildSpan("sdiff", keys); + return prepareRedisFuture(commands.sdiff(keys), span); + } + + @Override + public RedisFuture sdiff( + ValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("sdiff", keys); + return prepareRedisFuture(commands.sdiff(channel, keys), span); + } + + @Override + public RedisFuture sdiffstore(K destination, K... keys) { + Span span = helper.buildSpan("sdiffstore", keys); + return prepareRedisFuture(commands.sdiffstore(destination, keys), span); + } + + @Override + public RedisFuture> sinter(K... keys) { + Span span = helper.buildSpan("sinter", keys); + return prepareRedisFuture(commands.sinter(keys), span); + } + + @Override + public RedisFuture sinter( + ValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("sinter", keys); + return prepareRedisFuture(commands.sinter(channel, keys), span); + } + + @Override + public RedisFuture sinterstore(K destination, K... keys) { + Span span = helper.buildSpan("sinterstore", keys); + return prepareRedisFuture(commands.sinterstore(destination, keys), span); + } + + @Override + public RedisFuture sismember(K key, V member) { + Span span = helper.buildSpan("sismember", key); + return prepareRedisFuture(commands.sismember(key, member), span); + } + + @Override + public RedisFuture smove(K source, K destination, V member) { + Span span = helper.buildSpan("smove"); + return prepareRedisFuture(commands.smove(source, destination, member), span); + } + + @Override + public RedisFuture> smembers(K key) { + Span span = helper.buildSpan("smembers", key); + return prepareRedisFuture(commands.smembers(key), span); + } + + @Override + public RedisFuture smembers( + ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("smembers", key); + return prepareRedisFuture(commands.smembers(channel, key), span); + } + + @Override + public RedisFuture spop(K key) { + Span span = helper.buildSpan("spop", key); + return prepareRedisFuture(commands.spop(key), span); + } + + @Override + public RedisFuture> spop(K key, long count) { + Span span = helper.buildSpan("spop", key); + span.setTag("count", count); + return prepareRedisFuture(commands.spop(key, count), span); + } + + @Override + public RedisFuture srandmember(K key) { + Span span = helper.buildSpan("srandmember", key); + return prepareRedisFuture(commands.srandmember(key), span); + } + + @Override + public RedisFuture> srandmember(K key, long count) { + Span span = helper.buildSpan("srandmember", key); + span.setTag("count", count); + return prepareRedisFuture(commands.srandmember(key, count), span); + } + + @Override + public RedisFuture srandmember( + ValueStreamingChannel channel, K key, long count) { + Span span = helper.buildSpan("srandmember", key); + span.setTag("count", count); + return prepareRedisFuture(commands.srandmember(channel, key, count), span); + } + + @Override + public RedisFuture srem(K key, V... members) { + Span span = helper.buildSpan("srem", key); + return prepareRedisFuture(commands.srem(key, members), span); + } + + @Override + public RedisFuture> sunion(K... keys) { + Span span = helper.buildSpan("sunion", keys); + return prepareRedisFuture(commands.sunion(keys), span); + } + + @Override + public RedisFuture sunion( + ValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("sunion", keys); + return prepareRedisFuture(commands.sunion(channel, keys), span); + } + + @Override + public RedisFuture sunionstore(K destination, K... keys) { + Span span = helper.buildSpan("sunionstore", keys); + return prepareRedisFuture(commands.sunionstore(destination, keys), span); + } + + @Override + public RedisFuture> sscan(K key) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(key), span); + } + + @Override + public RedisFuture> sscan(K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(key, scanArgs), span); + } + + @Override + public RedisFuture> sscan(K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(key, scanCursor, scanArgs), span); + } + + @Override + public RedisFuture> sscan(K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(key, scanCursor), span); + } + + @Override + public RedisFuture sscan( + ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(channel, key), span); + } + + @Override + public RedisFuture sscan( + ValueStreamingChannel channel, K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(channel, key, scanArgs), span); + } + + @Override + public RedisFuture sscan( + ValueStreamingChannel channel, K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(channel, key, scanCursor, scanArgs), span); + } + + @Override + public RedisFuture sscan( + ValueStreamingChannel channel, K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("sscan", key); + return prepareRedisFuture(commands.sscan(channel, key, scanCursor), span); + } + + @Override + public RedisFuture>> bzpopmin(long timeout, K... keys) { + Span span = helper.buildSpan("bzpopmin", keys); + span.setTag("timeout", timeout); + return prepareRedisFuture(commands.bzpopmin(timeout, keys), span); + } + + @Override + public RedisFuture>> bzpopmax(long timeout, K... keys) { + Span span = helper.buildSpan("bzpopmax", keys); + span.setTag("timeout", timeout); + return prepareRedisFuture(commands.bzpopmax(timeout, keys), span); + } + + @Override + public RedisFuture zadd(K key, double score, V member) { + Span span = helper.buildSpan("zadd", key); + span.setTag("score", score); + return prepareRedisFuture(commands.zadd(key, score, member), span); + } + + @Override + public RedisFuture zadd(K key, Object... scoresAndValues) { + Span span = helper.buildSpan("zadd", key); + return prepareRedisFuture(commands.zadd(key, scoresAndValues), span); + } + + @Override + public RedisFuture zadd(K key, ScoredValue... scoredValues) { + Span span = helper.buildSpan("zadd", key); + return prepareRedisFuture(commands.zadd(key, scoredValues), span); + } + + @Override + public RedisFuture zadd(K key, ZAddArgs zAddArgs, + double score, V member) { + Span span = helper.buildSpan("zadd", key); + span.setTag("score", score); + return prepareRedisFuture(commands.zadd(key, zAddArgs, score, member), span); + } + + @Override + public RedisFuture zadd(K key, ZAddArgs zAddArgs, + Object... scoresAndValues) { + Span span = helper.buildSpan("zadd", key); + return prepareRedisFuture(commands.zadd(key, zAddArgs, scoresAndValues), span); + } + + @Override + public RedisFuture zadd(K key, ZAddArgs zAddArgs, + ScoredValue... scoredValues) { + Span span = helper.buildSpan("zadd", key); + return prepareRedisFuture(commands.zadd(key, zAddArgs, scoredValues), span); + } + + @Override + public RedisFuture zaddincr(K key, double score, V member) { + Span span = helper.buildSpan("zaddincr", key); + span.setTag("score", score); + return prepareRedisFuture(commands.zaddincr(key, score, member), span); + } + + @Override + public RedisFuture zaddincr(K key, ZAddArgs zAddArgs, + double score, V member) { + Span span = helper.buildSpan("zaddincr", key); + span.setTag("score", score); + return prepareRedisFuture(commands.zaddincr(key, zAddArgs, score, member), span); + } + + @Override + public RedisFuture zcard(K key) { + Span span = helper.buildSpan("zcard", key); + return prepareRedisFuture(commands.zcard(key), span); + } + + @Override + @Deprecated + public RedisFuture zcount(K key, double min, double max) { + Span span = helper.buildSpan("zcount", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zcount(key, min, max), span); + } + + @Override + @Deprecated + public RedisFuture zcount(K key, String min, String max) { + Span span = helper.buildSpan("zcount", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zcount(key, min, max), span); + } + + @Override + public RedisFuture zcount(K key, + Range range) { + Span span = helper.buildSpan("zcount", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zcount(key, range), span); + } + + @Override + public RedisFuture zincrby(K key, double amount, V member) { + Span span = helper.buildSpan("zincrby", key); + span.setTag("amount", amount); + return prepareRedisFuture(commands.zincrby(key, amount, member), span); + } + + @Override + public RedisFuture zinterstore(K destination, K... keys) { + Span span = helper.buildSpan("zinterstore", keys); + return prepareRedisFuture(commands.zinterstore(destination, keys), span); + } + + @Override + public RedisFuture zinterstore(K destination, + ZStoreArgs storeArgs, K... keys) { + Span span = helper.buildSpan("zinterstore", keys); + return prepareRedisFuture(commands.zinterstore(destination, storeArgs, keys), span); + } + + @Override + @Deprecated + public RedisFuture zlexcount(K key, String min, String max) { + Span span = helper.buildSpan("zlexcount", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zlexcount(key, min, max), span); + } + + @Override + public RedisFuture zlexcount(K key, Range range) { + Span span = helper.buildSpan("zlexcount", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zlexcount(key, range), span); + } + + @Override + public RedisFuture> zpopmin(K key) { + Span span = helper.buildSpan("zpopmin", key); + return prepareRedisFuture(commands.zpopmin(key), span); + } + + @Override + public RedisFuture>> zpopmin(K key, long count) { + Span span = helper.buildSpan("zpopmin", key); + span.setTag("count", count); + return prepareRedisFuture(commands.zpopmin(key, count), span); + } + + @Override + public RedisFuture> zpopmax(K key) { + Span span = helper.buildSpan("zpopmax", key); + return prepareRedisFuture(commands.zpopmax(key), span); + } + + @Override + public RedisFuture>> zpopmax(K key, long count) { + Span span = helper.buildSpan("zpopmax", key); + span.setTag("count", count); + return prepareRedisFuture(commands.zpopmax(key, count), span); + } + + @Override + public RedisFuture> zrange(K key, long start, long stop) { + Span span = helper.buildSpan("zrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrange(key, start, stop), span); + } + + @Override + public RedisFuture zrange( + ValueStreamingChannel channel, K key, long start, long stop) { + Span span = helper.buildSpan("zrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrange(channel, key, start, stop), span); + } + + @Override + public RedisFuture>> zrangeWithScores( + K key, long start, long stop) { + Span span = helper.buildSpan("zrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrangeWithScores(key, start, stop), span); + } + + @Override + public RedisFuture zrangeWithScores( + ScoredValueStreamingChannel channel, K key, long start, long stop) { + Span span = helper.buildSpan("zrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrangeWithScores(channel, key, start, stop), span); + } + + @Override + @Deprecated + public RedisFuture> zrangebylex(K key, String min, + String max) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebylex(key, min, max), span); + } + + @Override + public RedisFuture> zrangebylex(K key, + Range range) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrangebylex(key, range), span); + } + + @Override + @Deprecated + public RedisFuture> zrangebylex(K key, String min, + String max, long offset, long count) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrangebylex(key, min, max, offset, count), span); + } + + @Override + public RedisFuture> zrangebylex(K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrangebylex(key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture> zrangebyscore(K key, double min, double max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscore(key, min, max), span); + } + + @Override + @Deprecated + public RedisFuture> zrangebyscore(K key, String min, + String max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscore(key, min, max), span); + } + + @Override + public RedisFuture> zrangebyscore(K key, + Range range) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrangebyscore(key, range), span); + } + + @Override + @Deprecated + public RedisFuture> zrangebyscore(K key, double min, double max, + long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrangebyscore(key, min, max, offset, count), span); + } + + @Override + @Deprecated + public RedisFuture> zrangebyscore(K key, String min, + String max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrangebyscore(key, min, max, offset, count), span); + } + + @Override + public RedisFuture> zrangebyscore(K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrangebyscore(key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscore( + ValueStreamingChannel channel, K key, double min, double max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscore(channel, key, min, max), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscore( + ValueStreamingChannel channel, K key, String min, + String max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscore(channel, key, min, max), span); + } + + @Override + public RedisFuture zrangebyscore( + ValueStreamingChannel channel, K key, + Range range) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrangebyscore(channel, key, range), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscore( + ValueStreamingChannel channel, K key, double min, double max, + long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrangebyscore(channel, key, min, max, offset, count), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscore( + ValueStreamingChannel channel, K key, String min, + String max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrangebyscore(channel, key, min, max, offset, count), span); + } + + @Override + public RedisFuture zrangebyscore( + ValueStreamingChannel channel, K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrangebyscore(channel, key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture>> zrangebyscoreWithScores( + K key, double min, double max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscoreWithScores(key, min, max), span); + } + + @Override + @Deprecated + public RedisFuture>> zrangebyscoreWithScores( + K key, String min, String max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscoreWithScores(key, min, max), span); + } + + @Override + public RedisFuture>> zrangebyscoreWithScores( + K key, Range range) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrangebyscoreWithScores(key, range), span); + } + + @Override + @Deprecated + public RedisFuture>> zrangebyscoreWithScores( + K key, double min, double max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrangebyscoreWithScores(key, min, max, offset, count), span); + } + + @Override + @Deprecated + public RedisFuture>> zrangebyscoreWithScores( + K key, String min, String max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrangebyscoreWithScores(key, min, max, offset, count), span); + } + + @Override + public RedisFuture>> zrangebyscoreWithScores( + K key, Range range, Limit limit) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrangebyscoreWithScores(key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, double min, double max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscoreWithScores(channel, key, min, max), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, String min, + String max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zrangebyscoreWithScores(channel, key, min, max), span); + } + + @Override + public RedisFuture zrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, + Range range) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrangebyscoreWithScores(channel, key, range), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, double min, double max, + long offset, long count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture( + commands.zrangebyscoreWithScores(channel, key, min, max, offset, count), span); + } + + @Override + @Deprecated + public RedisFuture zrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, String min, + String max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture( + commands.zrangebyscoreWithScores(channel, key, min, max, offset, count), span); + } + + @Override + public RedisFuture zrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrangebyscoreWithScores(channel, key, range, limit), span); + } + + @Override + public RedisFuture zrank(K key, V member) { + Span span = helper.buildSpan("zrank", key); + return prepareRedisFuture(commands.zrank(key, member), span); + } + + @Override + public RedisFuture zrem(K key, V... members) { + Span span = helper.buildSpan("zrem", key); + return prepareRedisFuture(commands.zrem(key, members), span); + } + + @Override + @Deprecated + public RedisFuture zremrangebylex(K key, String min, String max) { + Span span = helper.buildSpan("zremrangebylex", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zremrangebylex(key, min, max), span); + } + + @Override + public RedisFuture zremrangebylex(K key, + Range range) { + Span span = helper.buildSpan("zremrangebylex", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zremrangebylex(key, range), span); + } + + @Override + public RedisFuture zremrangebyrank(K key, long start, long stop) { + Span span = helper.buildSpan("zremrangebyrank", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zremrangebyrank(key, start, stop), span); + } + + @Override + @Deprecated + public RedisFuture zremrangebyscore(K key, double min, double max) { + Span span = helper.buildSpan("zremrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zremrangebyscore(key, min, max), span); + } + + @Override + @Deprecated + public RedisFuture zremrangebyscore(K key, String min, String max) { + Span span = helper.buildSpan("zremrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + return prepareRedisFuture(commands.zremrangebyscore(key, min, max), span); + } + + @Override + public RedisFuture zremrangebyscore(K key, + Range range) { + Span span = helper.buildSpan("zremrangebyscore", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zremrangebyscore(key, range), span); + } + + @Override + public RedisFuture> zrevrange(K key, long start, long stop) { + Span span = helper.buildSpan("zrevrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrevrange(key, start, stop), span); + } + + @Override + public RedisFuture zrevrange( + ValueStreamingChannel channel, K key, long start, long stop) { + Span span = helper.buildSpan("zrevrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrevrange(channel, key, start, stop), span); + } + + @Override + public RedisFuture>> zrevrangeWithScores( + K key, long start, long stop) { + Span span = helper.buildSpan("zrevrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrevrangeWithScores(key, start, stop), span); + } + + @Override + public RedisFuture zrevrangeWithScores( + ScoredValueStreamingChannel channel, K key, long start, long stop) { + Span span = helper.buildSpan("zrevrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + return prepareRedisFuture(commands.zrevrangeWithScores(channel, key, start, stop), span); + } + + @Override + public RedisFuture> zrevrangebylex(K key, + Range range) { + Span span = helper.buildSpan("zrevrangebylex", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrevrangebylex(key, range), span); + } + + @Override + public RedisFuture> zrevrangebylex(K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebylex", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrevrangebylex(key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture> zrevrangebyscore(K key, double max, + double min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscore(key, max, min), span); + } + + @Override + @Deprecated + public RedisFuture> zrevrangebyscore(K key, String max, + String min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscore(key, max, min), span); + } + + @Override + public RedisFuture> zrevrangebyscore(K key, + Range range) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrevrangebyscore(key, range), span); + } + + @Override + @Deprecated + public RedisFuture> zrevrangebyscore(K key, double max, + double min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrevrangebyscore(key, max, min, offset, count), span); + } + + @Override + @Deprecated + public RedisFuture> zrevrangebyscore(K key, String max, + String min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrevrangebyscore(key, max, min, offset, count), span); + } + + @Override + public RedisFuture> zrevrangebyscore(K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrevrangebyscore(key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscore( + ValueStreamingChannel channel, K key, double max, double min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscore(channel, key, max, min), span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscore( + ValueStreamingChannel channel, K key, String max, + String min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscore(channel, key, max, min), span); + } + + @Override + public RedisFuture zrevrangebyscore( + ValueStreamingChannel channel, K key, + Range range) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrevrangebyscore(channel, key, range), span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscore( + ValueStreamingChannel channel, K key, double max, double min, + long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrevrangebyscore(channel, key, max, min, offset, count), + span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscore( + ValueStreamingChannel channel, K key, String max, + String min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrevrangebyscore(channel, key, max, min, offset, count), + span); + } + + @Override + public RedisFuture zrevrangebyscore( + ValueStreamingChannel channel, K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrevrangebyscore(channel, key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture>> zrevrangebyscoreWithScores( + K key, double max, double min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(key, max, min), span); + } + + @Override + @Deprecated + public RedisFuture>> zrevrangebyscoreWithScores( + K key, String max, String min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(key, max, min), span); + } + + @Override + public RedisFuture>> zrevrangebyscoreWithScores( + K key, Range range) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(key, range), span); + } + + @Override + @Deprecated + public RedisFuture>> zrevrangebyscoreWithScores( + K key, double max, double min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(key, max, min, offset, count), + span); + } + + @Override + @Deprecated + public RedisFuture>> zrevrangebyscoreWithScores( + K key, String max, String min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(key, max, min, offset, count), + span); + } + + @Override + public RedisFuture>> zrevrangebyscoreWithScores( + K key, Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(key, range, limit), span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, double max, double min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(channel, key, max, min), span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, String max, + String min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(channel, key, max, min), span); + } + + @Override + public RedisFuture zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, + Range range) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(channel, key, range), span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, double max, double min, + long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture( + commands.zrevrangebyscoreWithScores(channel, key, max, min, offset, count), span); + } + + @Override + @Deprecated + public RedisFuture zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, String max, + String min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + return prepareRedisFuture( + commands.zrevrangebyscoreWithScores(channel, key, max, min, offset, count), span); + } + + @Override + public RedisFuture zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.zrevrangebyscoreWithScores(channel, key, range, limit), + span); + } + + @Override + public RedisFuture zrevrank(K key, V member) { + Span span = helper.buildSpan("zrevrank", key); + return prepareRedisFuture(commands.zrevrank(key, member), span); + } + + @Override + public RedisFuture> zscan(K key) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(key), span); + } + + @Override + public RedisFuture> zscan(K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(key, scanArgs), span); + } + + @Override + public RedisFuture> zscan(K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(key, scanCursor, scanArgs), span); + } + + @Override + public RedisFuture> zscan(K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(key, scanCursor), span); + } + + @Override + public RedisFuture zscan( + ScoredValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(channel, key), span); + } + + @Override + public RedisFuture zscan( + ScoredValueStreamingChannel channel, K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(channel, key, scanArgs), span); + } + + @Override + public RedisFuture zscan( + ScoredValueStreamingChannel channel, K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(channel, key, scanCursor, scanArgs), span); + } + + @Override + public RedisFuture zscan( + ScoredValueStreamingChannel channel, K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("zscan", key); + return prepareRedisFuture(commands.zscan(channel, key, scanCursor), span); + } + + @Override + public RedisFuture zscore(K key, V member) { + Span span = helper.buildSpan("zscore", key); + return prepareRedisFuture(commands.zscore(key, member), span); + } + + @Override + public RedisFuture zunionstore(K destination, K... keys) { + Span span = helper.buildSpan("zunionstore", keys); + return prepareRedisFuture(commands.zunionstore(destination, keys), span); + } + + @Override + public RedisFuture zunionstore(K destination, + ZStoreArgs storeArgs, K... keys) { + Span span = helper.buildSpan("zunionstore", keys); + return prepareRedisFuture(commands.zunionstore(destination, storeArgs, keys), span); + } + + @Override + public RedisFuture xack(K key, K group, String... messageIds) { + Span span = helper.buildSpan("xack", key); + span.setTag("group", nullable(group)); + span.setTag("messageIds", Arrays.toString(messageIds)); + return prepareRedisFuture(commands.xack(key, group, messageIds), span); + } + + @Override + public RedisFuture xadd(K key, Map body) { + Span span = helper.buildSpan("xadd", key); + span.setTag("body", TracingHelper.mapToString(body)); + return prepareRedisFuture(commands.xadd(key, body), span); + } + + @Override + public RedisFuture xadd(K key, XAddArgs args, Map body) { + Span span = helper.buildSpan("xadd", key); + span.setTag("body", TracingHelper.mapToString(body)); + return prepareRedisFuture(commands.xadd(key, args, body), span); + } + + @Override + public RedisFuture xadd(K key, Object... keysAndValues) { + Span span = helper.buildSpan("xadd", key); + span.setTag("keysAndValues", Arrays.toString(keysAndValues)); + return prepareRedisFuture(commands.xadd(key, keysAndValues), span); + } + + @Override + public RedisFuture xadd(K key, XAddArgs args, Object... keysAndValues) { + Span span = helper.buildSpan("xadd", key); + span.setTag("keysAndValues", Arrays.toString(keysAndValues)); + return prepareRedisFuture(commands.xadd(key, args, keysAndValues), span); + } + + @Override + public RedisFuture>> xclaim(K key, Consumer consumer, + long minIdleTime, String... messageIds) { + Span span = helper.buildSpan("xclaim", key); + span.setTag("minIdleTime", minIdleTime); + span.setTag("consumer", nullable(consumer)); + span.setTag("messageIds", Arrays.toString(messageIds)); + return prepareRedisFuture(commands.xclaim(key, consumer, minIdleTime, messageIds), span); + } + + @Override + public RedisFuture>> xclaim(K key, Consumer consumer, XClaimArgs args, + String... messageIds) { + Span span = helper.buildSpan("xclaim", key); + span.setTag("consumer", nullable(consumer)); + span.setTag("messageIds", Arrays.toString(messageIds)); + return prepareRedisFuture(commands.xclaim(key, consumer, args, messageIds), span); + } + + @Override + public RedisFuture xdel(K key, String... messageIds) { + Span span = helper.buildSpan("xdel", key); + span.setTag("messageIds", Arrays.toString(messageIds)); + return prepareRedisFuture(commands.xdel(key, messageIds), span); + } + + @Override + public RedisFuture xgroupCreate(StreamOffset streamOffset, K group) { + Span span = helper.buildSpan("xgroupCreate"); + span.setTag("streamOffset", nullable(streamOffset)); + span.setTag("group", nullable(group)); + return prepareRedisFuture(commands.xgroupCreate(streamOffset, group), span); + } + + @Override + public RedisFuture xgroupDelconsumer(K key, Consumer consumer) { + Span span = helper.buildSpan("xgroupDelconsumer", key); + span.setTag("consumer", nullable(consumer)); + return prepareRedisFuture(commands.xgroupDelconsumer(key, consumer), span); + } + + @Override + public RedisFuture xgroupDestroy(K key, K group) { + Span span = helper.buildSpan("xgroupDestroy", key); + span.setTag("group", nullable(group)); + return prepareRedisFuture(commands.xgroupDestroy(key, group), span); + } + + @Override + public RedisFuture xgroupSetid(StreamOffset streamOffset, K group) { + Span span = helper.buildSpan("xgroupSetid"); + span.setTag("streamOffset", nullable(streamOffset)); + span.setTag("group", nullable(group)); + return prepareRedisFuture(commands.xgroupSetid(streamOffset, group), span); + } + + @Override + public RedisFuture xlen(K key) { + Span span = helper.buildSpan("xlen", key); + return prepareRedisFuture(commands.xlen(key), span); + } + + @Override + public RedisFuture> xpending(K key, K group) { + Span span = helper.buildSpan("xpending", key); + span.setTag("group", nullable(group)); + return prepareRedisFuture(commands.xpending(key, group), span); + } + + @Override + public RedisFuture> xpending(K key, K group, Range range, Limit limit) { + Span span = helper.buildSpan("xpending", key); + span.setTag("group", nullable(group)); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.xpending(key, group, range, limit), span); + } + + @Override + public RedisFuture> xpending(K key, Consumer consumer, Range range, + Limit limit) { + Span span = helper.buildSpan("xpending", key); + span.setTag("consumer", nullable(consumer)); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.xpending(key, consumer, range, limit), span); + } + + @Override + public RedisFuture>> xrange(K key, Range range) { + Span span = helper.buildSpan("xrange", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.xrange(key, range), span); + } + + @Override + public RedisFuture>> xrange(K key, Range range, Limit limit) { + Span span = helper.buildSpan("xrange", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.xrange(key, range, limit), span); + } + + @Override + public RedisFuture>> xread(StreamOffset... streams) { + Span span = helper.buildSpan("xread"); + span.setTag("streams", Arrays.toString(streams)); + return prepareRedisFuture(commands.xread(streams), span); + } + + @Override + public RedisFuture>> xread(XReadArgs args, StreamOffset... streams) { + Span span = helper.buildSpan("xread"); + span.setTag("streams", Arrays.toString(streams)); + return prepareRedisFuture(commands.xread(args, streams), span); + } + + @Override + public RedisFuture>> xreadgroup(Consumer consumer, + StreamOffset... streams) { + Span span = helper.buildSpan("xreadgroup"); + span.setTag("consumer", nullable(consumer)); + span.setTag("streams", Arrays.toString(streams)); + return prepareRedisFuture(commands.xreadgroup(consumer, streams), span); + } + + @Override + public RedisFuture>> xreadgroup(Consumer consumer, XReadArgs args, + StreamOffset... streams) { + Span span = helper.buildSpan("xreadgroup"); + span.setTag("consumer", nullable(consumer)); + span.setTag("streams", Arrays.toString(streams)); + return prepareRedisFuture(commands.xreadgroup(consumer, args, streams), span); + } + + @Override + public RedisFuture>> xrevrange(K key, Range range) { + Span span = helper.buildSpan("xrevrange", key); + span.setTag("range", nullable(range)); + return prepareRedisFuture(commands.xrevrange(key, range), span); + } + + @Override + public RedisFuture>> xrevrange(K key, Range range, Limit limit) { + Span span = helper.buildSpan("xrevrange", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return prepareRedisFuture(commands.xrevrange(key, range, limit), span); + } + + @Override + public RedisFuture xtrim(K key, long count) { + Span span = helper.buildSpan("xtrim", key); + span.setTag("count", count); + return prepareRedisFuture(commands.xtrim(key, count), span); + } + + @Override + public RedisFuture xtrim(K key, boolean approximateTrimming, long count) { + Span span = helper.buildSpan("xtrim", key); + span.setTag("approximateTrimming", approximateTrimming); + span.setTag("count", count); + return prepareRedisFuture(commands.xtrim(key, approximateTrimming, count), span); + } + + @Override + public RedisFuture eval(String script, ScriptOutputType type, + K... keys) { + Span span = helper.buildSpan("eval", keys); + return prepareRedisFuture(commands.eval(script, type, keys), span); + } + + @Override + public RedisFuture eval(String script, ScriptOutputType type, + K[] keys, V... values) { + Span span = helper.buildSpan("eval", keys); + return prepareRedisFuture(commands.eval(script, type, keys, values), span); + } + + @Override + public RedisFuture evalsha(String digest, + ScriptOutputType type, K... keys) { + Span span = helper.buildSpan("evalsha", keys); + return prepareRedisFuture(commands.evalsha(digest, type, keys), span); + } + + @Override + public RedisFuture evalsha(String digest, + ScriptOutputType type, K[] keys, V... values) { + Span span = helper.buildSpan("evalsha", keys); + return prepareRedisFuture(commands.evalsha(digest, type, keys, values), span); + } + + @Override + public RedisFuture> scriptExists( + String... digests) { + Span span = helper.buildSpan("scriptExists"); + return prepareRedisFuture(commands.scriptExists(digests), span); + } + + @Override + public RedisFuture scriptFlush() { + Span span = helper.buildSpan("scriptFlush"); + return prepareRedisFuture(commands.scriptFlush(), span); + } + + @Override + public RedisFuture scriptKill() { + Span span = helper.buildSpan("scriptKill"); + return prepareRedisFuture(commands.scriptKill(), span); + } + + @Override + public RedisFuture scriptLoad(V script) { + Span span = helper.buildSpan("scriptLoad"); + return prepareRedisFuture(commands.scriptLoad(script), span); + } + + @Override + public String digest(V script) { + Span span = helper.buildSpan("digest"); + try { + return commands.digest(script); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public RedisFuture bgrewriteaof() { + Span span = helper.buildSpan("bgrewriteaof"); + return prepareRedisFuture(commands.bgrewriteaof(), span); + } + + @Override + public RedisFuture bgsave() { + Span span = helper.buildSpan("bgsave"); + return prepareRedisFuture(commands.bgsave(), span); + } + + @Override + public RedisFuture clientGetname() { + Span span = helper.buildSpan("clientGetname"); + return prepareRedisFuture(commands.clientGetname(), span); + } + + @Override + public RedisFuture clientSetname(K name) { + Span span = helper.buildSpan("clientSetname"); + return prepareRedisFuture(commands.clientSetname(name), span); + } + + @Override + public RedisFuture clientKill(String addr) { + Span span = helper.buildSpan("clientKill"); + return prepareRedisFuture(commands.clientKill(addr), span); + } + + @Override + public RedisFuture clientKill(KillArgs killArgs) { + Span span = helper.buildSpan("clientKill"); + return prepareRedisFuture(commands.clientKill(killArgs), span); + } + + @Override + public RedisFuture clientUnblock(long id, UnblockType type) { + Span span = helper.buildSpan("clientUnblock"); + span.setTag("id", id); + span.setTag("type", nullable(type)); + return prepareRedisFuture(commands.clientUnblock(id, type), span); + } + + @Override + public RedisFuture clientPause(long timeout) { + Span span = helper.buildSpan("clientPause"); + return prepareRedisFuture(commands.clientPause(timeout), span); + } + + @Override + public RedisFuture clientList() { + Span span = helper.buildSpan("clientList"); + return prepareRedisFuture(commands.clientList(), span); + } + + @Override + public RedisFuture> command() { + Span span = helper.buildSpan("command"); + return prepareRedisFuture(commands.command(), span); + } + + @Override + public RedisFuture> commandInfo(String... commands) { + Span span = helper.buildSpan("commandInfo"); + return this.commands.commandInfo(commands); + } + + @Override + public RedisFuture> commandInfo( + CommandType... commands) { + Span span = helper.buildSpan("commandInfo"); + return this.commands.commandInfo(commands); + } + + @Override + public RedisFuture commandCount() { + Span span = helper.buildSpan("commandCount"); + return prepareRedisFuture(commands.commandCount(), span); + } + + @Override + public RedisFuture> configGet( + String parameter) { + Span span = helper.buildSpan("configGet"); + return prepareRedisFuture(commands.configGet(parameter), span); + } + + @Override + public RedisFuture configResetstat() { + Span span = helper.buildSpan("configResetstat"); + return prepareRedisFuture(commands.configResetstat(), span); + } + + @Override + public RedisFuture configRewrite() { + Span span = helper.buildSpan("configRewrite"); + return prepareRedisFuture(commands.configRewrite(), span); + } + + @Override + public RedisFuture configSet(String parameter, String value) { + Span span = helper.buildSpan("configSet"); + return prepareRedisFuture(commands.configSet(parameter, value), span); + } + + @Override + public RedisFuture dbsize() { + Span span = helper.buildSpan("dbsize"); + return prepareRedisFuture(commands.dbsize(), span); + } + + @Override + public RedisFuture debugCrashAndRecover(Long delay) { + Span span = helper.buildSpan("debugCrashAndRecover"); + return prepareRedisFuture(commands.debugCrashAndRecover(delay), span); + } + + @Override + public RedisFuture debugHtstats(int db) { + Span span = helper.buildSpan("debugHtstats"); + return prepareRedisFuture(commands.debugHtstats(db), span); + } + + @Override + public RedisFuture debugObject(K key) { + Span span = helper.buildSpan("debugObject", key); + return prepareRedisFuture(commands.debugObject(key), span); + } + + @Override + public void debugOom() { + Span span = helper.buildSpan("debugOom"); + try { + debugOom(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void debugSegfault() { + Span span = helper.buildSpan("debugSegfault"); + try { + commands.debugSegfault(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public RedisFuture debugReload() { + Span span = helper.buildSpan("debugReload"); + return prepareRedisFuture(commands.debugReload(), span); + } + + @Override + public RedisFuture debugRestart(Long delay) { + Span span = helper.buildSpan("debugRestart"); + return prepareRedisFuture(commands.debugRestart(delay), span); + } + + @Override + public RedisFuture debugSdslen(K key) { + Span span = helper.buildSpan("debugSdslen", key); + return prepareRedisFuture(commands.debugSdslen(key), span); + } + + @Override + public RedisFuture flushall() { + Span span = helper.buildSpan("flushall"); + return prepareRedisFuture(commands.flushall(), span); + } + + @Override + public RedisFuture flushallAsync() { + Span span = helper.buildSpan("flushallAsync"); + return prepareRedisFuture(commands.flushallAsync(), span); + } + + @Override + public RedisFuture flushdb() { + Span span = helper.buildSpan("flushdb"); + return prepareRedisFuture(commands.flushdb(), span); + } + + @Override + public RedisFuture flushdbAsync() { + Span span = helper.buildSpan("flushdbAsync"); + return prepareRedisFuture(commands.flushdbAsync(), span); + } + + @Override + public RedisFuture info() { + Span span = helper.buildSpan("info"); + return prepareRedisFuture(commands.info(), span); + } + + @Override + public RedisFuture info(String section) { + Span span = helper.buildSpan("info"); + return prepareRedisFuture(commands.info(section), span); + } + + @Override + public RedisFuture lastsave() { + Span span = helper.buildSpan("lastsave"); + return prepareRedisFuture(commands.lastsave(), span); + } + + @Override + public RedisFuture save() { + Span span = helper.buildSpan("save"); + return prepareRedisFuture(commands.save(), span); + } + + @Override + public void shutdown(boolean save) { + Span span = helper.buildSpan("shutdown"); + try { + commands.shutdown(save); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public RedisFuture slaveof(String host, int port) { + Span span = helper.buildSpan("slaveof"); + return prepareRedisFuture(commands.slaveof(host, port), span); + } + + @Override + public RedisFuture slaveofNoOne() { + Span span = helper.buildSpan("slaveofNoOne"); + return prepareRedisFuture(commands.slaveofNoOne(), span); + } + + @Override + public RedisFuture> slowlogGet() { + Span span = helper.buildSpan("slowlogGet"); + return prepareRedisFuture(commands.slowlogGet(), span); + } + + @Override + public RedisFuture> slowlogGet(int count) { + Span span = helper.buildSpan("slowlogGet"); + return prepareRedisFuture(commands.slowlogGet(count), span); + } + + @Override + public RedisFuture slowlogLen() { + Span span = helper.buildSpan("slowlogLen"); + return prepareRedisFuture(commands.slowlogLen(), span); + } + + @Override + public RedisFuture slowlogReset() { + Span span = helper.buildSpan("slowlogReset"); + return prepareRedisFuture(commands.slowlogReset(), span); + } + + @Override + public RedisFuture> time() { + Span span = helper.buildSpan("time"); + return prepareRedisFuture(commands.time(), span); + } + + @Override + public RedisFuture pfadd(K key, V... values) { + Span span = helper.buildSpan("pfadd", key); + return prepareRedisFuture(commands.pfadd(key, values), span); + } + + @Override + public RedisFuture pfmerge(K destkey, K... sourcekeys) { + Span span = helper.buildSpan("pfmerge"); + return prepareRedisFuture(commands.pfmerge(destkey, sourcekeys), span); + } + + @Override + public RedisFuture pfcount(K... keys) { + Span span = helper.buildSpan("pfcount", keys); + return prepareRedisFuture(commands.pfcount(keys), span); + } + + @Override + public RedisFuture publish(K channel, V message) { + Span span = helper.buildSpan("publish"); + return prepareRedisFuture(commands.publish(channel, message), span); + } + + @Override + public RedisFuture> pubsubChannels() { + Span span = helper.buildSpan("pubsubChannels"); + return prepareRedisFuture(commands.pubsubChannels(), span); + } + + @Override + public RedisFuture> pubsubChannels(K channel) { + Span span = helper.buildSpan("pubsubChannels"); + return prepareRedisFuture(commands.pubsubChannels(channel), span); + } + + @Override + public RedisFuture> pubsubNumsub(K... channels) { + Span span = helper.buildSpan("pubsubNumsub"); + return prepareRedisFuture(commands.pubsubNumsub(channels), span); + } + + @Override + public RedisFuture pubsubNumpat() { + Span span = helper.buildSpan("pubsubNumpat"); + return prepareRedisFuture(commands.pubsubNumpat(), span); + } + + @Override + public RedisFuture echo(V msg) { + Span span = helper.buildSpan("echo"); + return prepareRedisFuture(commands.echo(msg), span); + } + + @Override + public RedisFuture> role() { + Span span = helper.buildSpan("role"); + return prepareRedisFuture(commands.role(), span); + } + + @Override + public RedisFuture ping() { + Span span = helper.buildSpan("ping"); + return prepareRedisFuture(commands.ping(), span); + } + + @Override + public RedisFuture readOnly() { + Span span = helper.buildSpan("readOnly"); + return prepareRedisFuture(commands.readOnly(), span); + } + + @Override + public RedisFuture readWrite() { + Span span = helper.buildSpan("readWrite"); + return prepareRedisFuture(commands.readWrite(), span); + } + + @Override + public RedisFuture quit() { + Span span = helper.buildSpan("quit"); + return prepareRedisFuture(commands.quit(), span); + } + + @Override + public RedisFuture waitForReplication(int replicas, long timeout) { + Span span = helper.buildSpan("waitForReplication"); + return prepareRedisFuture(commands.waitForReplication(replicas, timeout), span); + } + + @Override + public RedisFuture dispatch(ProtocolKeyword type, + CommandOutput output) { + Span span = helper.buildSpan("dispatch"); + return prepareRedisFuture(commands.dispatch(type, output), span); + } + + @Override + public RedisFuture dispatch(ProtocolKeyword type, + CommandOutput output, + CommandArgs args) { + Span span = helper.buildSpan("dispatch"); + return prepareRedisFuture(commands.dispatch(type, output, args), span); + } + + @Override + public boolean isOpen() { + Span span = helper.buildSpan("isOpen"); + try { + return commands.isOpen(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void reset() { + Span span = helper.buildSpan("reset"); + try { + commands.reset(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void setAutoFlushCommands(boolean autoFlush) { + Span span = helper.buildSpan("setAutoFlushCommands"); + try { + commands.setAutoFlushCommands(autoFlush); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void flushCommands() { + Span span = helper.buildSpan("flushCommands"); + try { + commands.flushCommands(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void setTimeout(Duration timeout) { + Span span = helper.buildSpan("setTimeout"); + try { + commands.setTimeout(timeout); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public void setTimeout(long timeout, TimeUnit unit) { + Span span = helper.buildSpan("setTimeout"); + span.setTag("unit", nullable(unit)); + try { + commands.setTimeout(timeout, unit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + + } + + @Override + public RedisFuture clusterBumpepoch() { + Span span = helper.buildSpan("clusterBumpepoch"); + return prepareRedisFuture(commands.clusterBumpepoch(), span); + } + + @Override + public RedisFuture clusterMeet(String ip, int port) { + Span span = helper.buildSpan("clusterMeet"); + return prepareRedisFuture(commands.clusterMeet(ip, port), span); + } + + @Override + public RedisFuture clusterForget(String nodeId) { + Span span = helper.buildSpan("clusterForget"); + span.setTag("nodeId", nodeId); + return prepareRedisFuture(commands.clusterForget(nodeId), span); + } + + @Override + public RedisFuture clusterAddSlots(int... slots) { + Span span = helper.buildSpan("clusterAddSlots"); + span.setTag("slots", Arrays.toString(slots)); + return prepareRedisFuture(commands.clusterAddSlots(slots), span); + } + + @Override + public RedisFuture clusterDelSlots(int... slots) { + Span span = helper.buildSpan("clusterDelSlots"); + span.setTag("slots", Arrays.toString(slots)); + return prepareRedisFuture(commands.clusterDelSlots(slots), span); + } + + @Override + public RedisFuture clusterSetSlotNode(int slot, String nodeId) { + Span span = helper.buildSpan("clusterSetSlotNode"); + span.setTag("slot", slot); + span.setTag("nodeId", nodeId); + return prepareRedisFuture(commands.clusterSetSlotNode(slot, nodeId), span); + } + + @Override + public RedisFuture clusterSetSlotStable(int slot) { + Span span = helper.buildSpan("clusterSetSlotStable"); + span.setTag("slot", slot); + return prepareRedisFuture(commands.clusterSetSlotStable(slot), span); + } + + @Override + public RedisFuture clusterSetSlotMigrating(int slot, + String nodeId) { + Span span = helper.buildSpan("clusterSetSlotMigrating"); + span.setTag("slot", slot); + span.setTag("nodeId", nodeId); + return prepareRedisFuture(commands.clusterSetSlotMigrating(slot, nodeId), span); + } + + @Override + public RedisFuture clusterSetSlotImporting(int slot, + String nodeId) { + Span span = helper.buildSpan("clusterSetSlotImporting"); + span.setTag("slot", slot); + span.setTag("nodeId", nodeId); + return prepareRedisFuture(commands.clusterSetSlotImporting(slot, nodeId), span); + } + + @Override + public RedisFuture clusterInfo() { + Span span = helper.buildSpan("clusterInfo"); + return prepareRedisFuture(commands.clusterInfo(), span); + } + + @Override + public RedisFuture clusterMyId() { + Span span = helper.buildSpan("clusterMyId"); + return prepareRedisFuture(commands.clusterMyId(), span); + } + + @Override + public RedisFuture clusterNodes() { + Span span = helper.buildSpan("clusterNodes"); + return prepareRedisFuture(commands.clusterNodes(), span); + } + + @Override + public RedisFuture> clusterSlaves(String nodeId) { + Span span = helper.buildSpan("clusterSlaves"); + span.setTag("nodeId", nodeId); + return prepareRedisFuture(commands.clusterSlaves(nodeId), span); + } + + @Override + public RedisFuture> clusterGetKeysInSlot(int slot, int count) { + Span span = helper.buildSpan("clusterGetKeysInSlot"); + span.setTag("slot", slot); + return prepareRedisFuture(commands.clusterGetKeysInSlot(slot, count), span); + } + + @Override + public RedisFuture clusterCountKeysInSlot(int slot) { + Span span = helper.buildSpan("clusterCountKeysInSlot"); + span.setTag("slot", slot); + return prepareRedisFuture(commands.clusterCountKeysInSlot(slot), span); + } + + @Override + public RedisFuture clusterCountFailureReports(String nodeId) { + Span span = helper.buildSpan("clusterCountFailureReports"); + span.setTag("nodeId", nodeId); + return prepareRedisFuture(commands.clusterCountFailureReports(nodeId), span); + } + + @Override + public RedisFuture clusterKeyslot(K key) { + Span span = helper.buildSpan("clusterKeyslot", key); + return prepareRedisFuture(commands.clusterKeyslot(key), span); + } + + @Override + public RedisFuture clusterSaveconfig() { + Span span = helper.buildSpan("clusterSaveconfig"); + return prepareRedisFuture(commands.clusterSaveconfig(), span); + } + + @Override + public RedisFuture clusterSetConfigEpoch(long configEpoch) { + Span span = helper.buildSpan("clusterSetConfigEpoch"); + return prepareRedisFuture(commands.clusterSetConfigEpoch(configEpoch), span); + } + + @Override + public RedisFuture> clusterSlots() { + Span span = helper.buildSpan("clusterSlots"); + return prepareRedisFuture(commands.clusterSlots(), span); + } + + @Override + public RedisFuture asking() { + Span span = helper.buildSpan("asking"); + return prepareRedisFuture(commands.asking(), span); + } + + @Override + public RedisFuture clusterReplicate(String nodeId) { + Span span = helper.buildSpan("clusterReplicate"); + span.setTag("nodeId", nodeId); + return prepareRedisFuture(commands.clusterReplicate(nodeId), span); + } + + @Override + public RedisFuture clusterFailover(boolean force) { + Span span = helper.buildSpan("clusterFailover"); + span.setTag("force", force); + return prepareRedisFuture(commands.clusterFailover(force), span); + } + + @Override + public RedisFuture clusterReset(boolean hard) { + Span span = helper.buildSpan("clusterReset"); + span.setTag("hard", hard); + return prepareRedisFuture(commands.clusterReset(hard), span); + } + + @Override + public RedisFuture clusterFlushslots() { + Span span = helper.buildSpan("clusterFlushslots"); + return prepareRedisFuture(commands.clusterFlushslots(), span); + } + + @Override + public RedisFuture geoadd(K key, double longitude, double latitude, V member) { + Span span = helper.buildSpan("geoadd", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + return prepareRedisFuture(commands.geoadd(key, longitude, latitude, member), span); + } + + @Override + public RedisFuture geoadd(K key, Object... lngLatMember) { + Span span = helper.buildSpan("geoadd", key); + return prepareRedisFuture(commands.geoadd(key, lngLatMember), span); + } + + @Override + public RedisFuture>> geohash(K key, + V... members) { + Span span = helper.buildSpan("geohash", key); + return prepareRedisFuture(commands.geohash(key, members), span); + } + + @Override + public RedisFuture> georadius(K key, double longitude, + double latitude, double distance, Unit unit) { + Span span = helper.buildSpan("georadius", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + span.setTag("unit", nullable(unit)); + span.setTag("distance", distance); + return prepareRedisFuture(commands.georadius(key, longitude, latitude, distance, unit), span); + } + + @Override + public RedisFuture>> georadius(K key, + double longitude, double latitude, double distance, Unit unit, + GeoArgs geoArgs) { + Span span = helper.buildSpan("georadius", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + span.setTag("unit", nullable(unit)); + span.setTag("distance", distance); + return prepareRedisFuture(commands.georadius(key, longitude, latitude, distance, unit, geoArgs), + span); + } + + @Override + public RedisFuture georadius(K key, double longitude, double latitude, + double distance, Unit unit, + GeoRadiusStoreArgs geoRadiusStoreArgs) { + Span span = helper.buildSpan("georadius", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + span.setTag("unit", nullable(unit)); + span.setTag("distance", distance); + return prepareRedisFuture( + commands.georadius(key, longitude, latitude, distance, unit, geoRadiusStoreArgs), span); + } + + @Override + public RedisFuture> georadiusbymember(K key, V member, + double distance, Unit unit) { + Span span = helper.buildSpan("georadiusbymember", key); + span.setTag("unit", nullable(unit)); + span.setTag("distance", distance); + return prepareRedisFuture(commands.georadiusbymember(key, member, distance, unit), span); + } + + @Override + public RedisFuture>> georadiusbymember( + K key, V member, double distance, Unit unit, + GeoArgs geoArgs) { + Span span = helper.buildSpan("georadiusbymember", key); + span.setTag("unit", nullable(unit)); + span.setTag("distance", distance); + return prepareRedisFuture(commands.georadiusbymember(key, member, distance, unit, geoArgs), + span); + } + + @Override + public RedisFuture georadiusbymember(K key, V member, double distance, + Unit unit, GeoRadiusStoreArgs geoRadiusStoreArgs) { + Span span = helper.buildSpan("georadiusbymember", key); + span.setTag("unit", nullable(unit)); + span.setTag("distance", distance); + return prepareRedisFuture( + commands.georadiusbymember(key, member, distance, unit, geoRadiusStoreArgs), span); + } + + @Override + public RedisFuture> geopos(K key, + V... members) { + Span span = helper.buildSpan("geopos", key); + return prepareRedisFuture(commands.geopos(key, members), span); + } + + @Override + public RedisFuture geodist(K key, V from, V to, + Unit unit) { + Span span = helper.buildSpan("geodist", key); + span.setTag("unit", nullable(unit)); + return prepareRedisFuture(commands.geodist(key, from, to, unit), span); + } + + private RedisFuture prepareRedisFuture(RedisFuture future, Span span) { + return continueScopeSpan(setCompleteAction(future, span)); + } + + private RedisFuture setCompleteAction(RedisFuture future, Span span) { + future.whenComplete((v, throwable) -> { + if (throwable != null) { + onError(throwable, span); + } + span.finish(); + }); + + return future; + } + + private RedisFuture continueScopeSpan(RedisFuture redisFuture) { + Tracer tracer = TracingHelper.getNullSafeTracer(tracingConfiguration.getTracer()); + Span span = tracer.activeSpan(); + CompletableRedisFuture customRedisFuture = new CompletableRedisFuture<>(redisFuture); + redisFuture.whenComplete((v, throwable) -> { + try (Scope ignored = tracer.scopeManager().activate(span)) { + if (throwable != null) { + customRedisFuture.completeExceptionally(throwable); + } else { + customRedisFuture.complete(v); + } + } + }); + return customRedisFuture; + } +} diff --git a/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingRedisAdvancedClusterCommands.java b/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingRedisAdvancedClusterCommands.java new file mode 100644 index 0000000..36a1e5f --- /dev/null +++ b/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingRedisAdvancedClusterCommands.java @@ -0,0 +1,5381 @@ +/* + * Copyright 2017-2019 The OpenTracing Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package io.opentracing.contrib.redis.lettuce; + +import static io.opentracing.contrib.redis.common.TracingHelper.nullable; +import static io.opentracing.contrib.redis.common.TracingHelper.onError; + +import io.lettuce.core.BitFieldArgs; +import io.lettuce.core.Consumer; +import io.lettuce.core.GeoArgs; +import io.lettuce.core.GeoArgs.Unit; +import io.lettuce.core.GeoCoordinates; +import io.lettuce.core.GeoRadiusStoreArgs; +import io.lettuce.core.GeoWithin; +import io.lettuce.core.KeyScanCursor; +import io.lettuce.core.KeyValue; +import io.lettuce.core.KillArgs; +import io.lettuce.core.Limit; +import io.lettuce.core.MapScanCursor; +import io.lettuce.core.MigrateArgs; +import io.lettuce.core.Range; +import io.lettuce.core.RestoreArgs; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.ScriptOutputType; +import io.lettuce.core.SetArgs; +import io.lettuce.core.SortArgs; +import io.lettuce.core.StreamMessage; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.UnblockType; +import io.lettuce.core.Value; +import io.lettuce.core.ValueScanCursor; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XReadArgs; +import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZStoreArgs; +import io.lettuce.core.cluster.api.StatefulRedisClusterConnection; +import io.lettuce.core.cluster.api.sync.NodeSelection; +import io.lettuce.core.cluster.api.sync.RedisAdvancedClusterCommands; +import io.lettuce.core.cluster.api.sync.RedisClusterCommands; +import io.lettuce.core.cluster.models.partitions.RedisClusterNode; +import io.lettuce.core.output.CommandOutput; +import io.lettuce.core.output.KeyStreamingChannel; +import io.lettuce.core.output.KeyValueStreamingChannel; +import io.lettuce.core.output.ScoredValueStreamingChannel; +import io.lettuce.core.output.ValueStreamingChannel; +import io.lettuce.core.protocol.CommandArgs; +import io.lettuce.core.protocol.CommandType; +import io.lettuce.core.protocol.ProtocolKeyword; +import io.opentracing.Span; +import io.opentracing.contrib.redis.common.TracingConfiguration; +import io.opentracing.contrib.redis.common.TracingHelper; +import java.time.Duration; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; + +public class TracingRedisAdvancedClusterCommands implements + RedisAdvancedClusterCommands { + + private final RedisAdvancedClusterCommands commands; + private final TracingHelper helper; + private final TracingConfiguration tracingConfiguration; + + public TracingRedisAdvancedClusterCommands(RedisAdvancedClusterCommands commands, + TracingConfiguration tracingConfiguration) { + + this.commands = commands; + this.helper = new TracingHelper(tracingConfiguration); + this.tracingConfiguration = tracingConfiguration; + } + + @Override + public String auth(String password) { + Span span = helper.buildSpan("auth"); + try { + return commands.auth(password); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public RedisClusterCommands getConnection(String nodeId) { + return new TracingRedisCommands<>(commands.getStatefulConnection() + .getConnection(nodeId).sync(), + tracingConfiguration); + } + + @Override + public RedisClusterCommands getConnection(String host, int port) { + return new TracingRedisCommands<>(commands.getStatefulConnection() + .getConnection(host, port).sync(), + tracingConfiguration); + } + + @Override + public StatefulRedisClusterConnection getStatefulConnection() { + return new TracingStatefulRedisClusterConnection<>(commands.getStatefulConnection(), + tracingConfiguration); + } + + @Override + public NodeSelection readonly(Predicate predicate) { + return commands.readonly(predicate); + } + + @Override + public NodeSelection nodes(Predicate predicate) { + return commands.nodes(predicate); + } + + @Override + public NodeSelection nodes(Predicate predicate, boolean dynamic) { + return commands.nodes(predicate, dynamic); + } + + @Override + public Long hdel(K key, K... fields) { + Span span = helper.buildSpan("hdel", key); + try { + return commands.hdel(key, fields); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean hexists(K key, K field) { + Span span = helper.buildSpan("hexists", key); + try { + return commands.hexists(key, field); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V hget(K key, K field) { + Span span = helper.buildSpan("hget", key); + try { + return commands.hget(key, field); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long hincrby(K key, K field, long amount) { + Span span = helper.buildSpan("hincrby", key); + span.setTag("amount", amount); + try { + return commands.hincrby(key, field, amount); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Double hincrbyfloat(K key, K field, double amount) { + Span span = helper.buildSpan("hincrbyfloat", key); + span.setTag("amount", amount); + try { + return commands.hincrbyfloat(key, field, amount); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Map hgetall(K key) { + Span span = helper.buildSpan("hgetall", key); + try { + return commands.hgetall(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long hgetall(KeyValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("hgetall", key); + try { + return commands.hgetall(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List hkeys(K key) { + Span span = helper.buildSpan("hkeys", key); + try { + return commands.hkeys(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long hkeys(KeyStreamingChannel channel, K key) { + Span span = helper.buildSpan("hkeys", key); + try { + return commands.hkeys(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long hlen(K key) { + Span span = helper.buildSpan("hlen", key); + try { + return commands.hlen(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> hmget(K key, K... fields) { + Span span = helper.buildSpan("hmget", key); + try { + return commands.hmget(key, fields); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long hmget(KeyValueStreamingChannel channel, K key, K... fields) { + Span span = helper.buildSpan("hmget", key); + try { + return commands.hmget(channel, key, fields); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String hmset(K key, Map map) { + Span span = helper.buildSpan("hmset", key); + try { + return commands.hmset(key, map); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public MapScanCursor hscan(K key) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public MapScanCursor hscan(K key, ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(key, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public MapScanCursor hscan(K key, ScanCursor scanCursor, + ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(key, scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public MapScanCursor hscan(K key, ScanCursor scanCursor) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(key, scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor hscan( + KeyValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor hscan( + KeyValueStreamingChannel channel, K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(channel, key, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor hscan( + KeyValueStreamingChannel channel, K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(channel, key, scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor hscan( + KeyValueStreamingChannel channel, K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("hscan", key); + try { + return commands.hscan(channel, key, scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean hset(K key, K field, V value) { + Span span = helper.buildSpan("hset", key); + try { + return commands.hset(key, field, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean hsetnx(K key, K field, V value) { + Span span = helper.buildSpan("hsetnx", key); + try { + return commands.hsetnx(key, field, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long hstrlen(K key, K field) { + Span span = helper.buildSpan("hstrlen", key); + try { + return commands.hstrlen(key, field); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List hvals(K key) { + Span span = helper.buildSpan("hvals", key); + try { + return commands.hvals(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long hvals(ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("hvals", key); + try { + return commands.hvals(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long del(K... keys) { + Span span = helper.buildSpan("del", keys); + try { + return commands.del(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long unlink(K... keys) { + Span span = helper.buildSpan("unlink", keys); + try { + return commands.unlink(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public byte[] dump(K key) { + Span span = helper.buildSpan("dump", key); + try { + return commands.dump(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long exists(K... keys) { + Span span = helper.buildSpan("exists", keys); + try { + return commands.exists(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean expire(K key, long seconds) { + Span span = helper.buildSpan("expire", key); + span.setTag("seconds", seconds); + try { + return commands.expire(key, seconds); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean expireat(K key, Date timestamp) { + Span span = helper.buildSpan("expireat", key); + span.setTag("timestamp", nullable(timestamp)); + try { + return commands.expireat(key, timestamp); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean expireat(K key, long timestamp) { + Span span = helper.buildSpan("expireat", key); + span.setTag("timestamp", timestamp); + try { + return commands.expireat(key, timestamp); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List keys(K pattern) { + Span span = helper.buildSpan("keys"); + span.setTag("pattern", nullable(pattern)); + try { + return commands.keys(pattern); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long keys(KeyStreamingChannel channel, K pattern) { + Span span = helper.buildSpan("keys"); + span.setTag("pattern", nullable(pattern)); + try { + return commands.keys(channel, pattern); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String migrate(String host, int port, K key, int db, long timeout) { + Span span = helper.buildSpan("migrate", key); + span.setTag("host", host); + span.setTag("port", port); + span.setTag("db", db); + span.setTag("timeout", timeout); + try { + return commands.migrate(host, port, key, db, timeout); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String migrate(String host, int port, int db, long timeout, + MigrateArgs migrateArgs) { + Span span = helper.buildSpan("migrate"); + span.setTag("host", host); + span.setTag("port", port); + span.setTag("db", db); + span.setTag("timeout", timeout); + try { + return commands.migrate(host, port, db, timeout, migrateArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean move(K key, int db) { + Span span = helper.buildSpan("move", key); + span.setTag("db", db); + try { + return commands.move(key, db); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String objectEncoding(K key) { + Span span = helper.buildSpan("objectEncoding", key); + try { + return commands.objectEncoding(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long objectIdletime(K key) { + Span span = helper.buildSpan("objectIdletime", key); + try { + return commands.objectIdletime(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long objectRefcount(K key) { + Span span = helper.buildSpan("objectRefcount", key); + try { + return commands.objectRefcount(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean persist(K key) { + Span span = helper.buildSpan("persist", key); + try { + return commands.persist(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean pexpire(K key, long milliseconds) { + Span span = helper.buildSpan("pexpire", key); + span.setTag("milliseconds", milliseconds); + try { + return commands.pexpire(key, milliseconds); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean pexpireat(K key, Date timestamp) { + Span span = helper.buildSpan("pexpireat", key); + span.setTag("timestamp", timestamp == null ? "null" : timestamp.toString()); + try { + return commands.pexpireat(key, timestamp); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean pexpireat(K key, long timestamp) { + Span span = helper.buildSpan("pexpireat", key); + span.setTag("timestamp", timestamp); + try { + return commands.pexpireat(key, timestamp); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long pttl(K key) { + Span span = helper.buildSpan("pttl", key); + try { + return commands.pttl(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V randomkey() { + Span span = helper.buildSpan("randomkey"); + try { + return commands.randomkey(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String rename(K key, K newKey) { + Span span = helper.buildSpan("rename", key); + span.setTag("newKey", nullable(newKey)); + try { + return commands.rename(key, newKey); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean renamenx(K key, K newKey) { + Span span = helper.buildSpan("renamenx", key); + span.setTag("newKey", nullable(newKey)); + try { + return commands.renamenx(key, newKey); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String restore(K key, long ttl, byte[] value) { + Span span = helper.buildSpan("restore", key); + span.setTag("ttl", ttl); + try { + return commands.restore(key, ttl, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String restore(K key, byte[] value, RestoreArgs args) { + Span span = helper.buildSpan("restore", key); + span.setTag("value", Arrays.toString(value)); + return helper.decorate(span, () -> commands.restore(key, value, args)); + } + + @Override + public List sort(K key) { + Span span = helper.buildSpan("sort", key); + try { + return commands.sort(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sort(ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("sort", key); + try { + return commands.sort(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List sort(K key, SortArgs sortArgs) { + Span span = helper.buildSpan("sort", key); + try { + return commands.sort(key, sortArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sort(ValueStreamingChannel channel, K key, + SortArgs sortArgs) { + Span span = helper.buildSpan("sort", key); + try { + return commands.sort(channel, key, sortArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sortStore(K key, SortArgs sortArgs, K destination) { + Span span = helper.buildSpan("sortStore", key); + try { + return commands.sortStore(key, sortArgs, destination); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long touch(K... keys) { + Span span = helper.buildSpan("touch", keys); + try { + return commands.touch(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long ttl(K key) { + Span span = helper.buildSpan("ttl", key); + try { + return commands.ttl(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String type(K key) { + Span span = helper.buildSpan("type", key); + try { + return commands.type(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public KeyScanCursor scan() { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public KeyScanCursor scan(ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public KeyScanCursor scan(ScanCursor scanCursor, + ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public KeyScanCursor scan(ScanCursor scanCursor) { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor scan(KeyStreamingChannel channel) { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(channel); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor scan(KeyStreamingChannel channel, + ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(channel, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor scan(KeyStreamingChannel channel, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(channel, scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor scan(KeyStreamingChannel channel, + ScanCursor scanCursor) { + Span span = helper.buildSpan("scan"); + try { + return commands.scan(channel, scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long append(K key, V value) { + Span span = helper.buildSpan("append", key); + try { + return commands.append(key, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitcount(K key) { + Span span = helper.buildSpan("bitcount", key); + try { + return commands.bitcount(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitcount(K key, long start, long end) { + Span span = helper.buildSpan("bitcount", key); + span.setTag("start", start); + span.setTag("end", end); + try { + return commands.bitcount(key, start, end); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List bitfield(K key, BitFieldArgs bitFieldArgs) { + Span span = helper.buildSpan("bitfield", key); + try { + return commands.bitfield(key, bitFieldArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitpos(K key, boolean state) { + Span span = helper.buildSpan("bitpos", key); + span.setTag("state", state); + try { + return commands.bitpos(key, state); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitpos(K key, boolean state, long start) { + Span span = helper.buildSpan("bitpos", key); + span.setTag("state", state); + span.setTag("start", start); + try { + return commands.bitpos(key, state, start); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitpos(K key, boolean state, long start, long end) { + Span span = helper.buildSpan("bitpos", key); + span.setTag("state", state); + span.setTag("start", start); + span.setTag("end", end); + try { + return commands.bitpos(key, state, start, end); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitopAnd(K destination, K... keys) { + Span span = helper.buildSpan("bitopAnd", keys); + try { + return commands.bitopAnd(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitopNot(K destination, K source) { + Span span = helper.buildSpan("bitopNot"); + try { + return commands.bitopNot(destination, source); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitopOr(K destination, K... keys) { + Span span = helper.buildSpan("bitopOr", keys); + try { + return commands.bitopOr(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long bitopXor(K destination, K... keys) { + Span span = helper.buildSpan("bitopXor", keys); + try { + return commands.bitopXor(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long decr(K key) { + Span span = helper.buildSpan("decr", key); + try { + return commands.decr(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long decrby(K key, long amount) { + Span span = helper.buildSpan("decrby", key); + span.setTag("amount", amount); + try { + return commands.decrby(key, amount); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V get(K key) { + Span span = helper.buildSpan("get", key); + try { + return commands.get(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long getbit(K key, long offset) { + Span span = helper.buildSpan("getbit", key); + span.setTag("offset", offset); + try { + return commands.getbit(key, offset); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V getrange(K key, long start, long end) { + Span span = helper.buildSpan("getrange", key); + span.setTag("start", start); + span.setTag("end", end); + try { + return commands.getrange(key, start, end); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V getset(K key, V value) { + Span span = helper.buildSpan("getset", key); + try { + return commands.getset(key, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long incr(K key) { + Span span = helper.buildSpan("incr", key); + try { + return commands.incr(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long incrby(K key, long amount) { + Span span = helper.buildSpan("incrby", key); + span.setTag("amount", amount); + try { + return commands.incrby(key, amount); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Double incrbyfloat(K key, double amount) { + Span span = helper.buildSpan("incrbyfloat", key); + span.setTag("amount", amount); + try { + return commands.incrbyfloat(key, amount); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> mget(K... keys) { + Span span = helper.buildSpan("mget", keys); + try { + return commands.mget(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long mget(KeyValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("mget", keys); + try { + return commands.mget(channel, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String mset(Map map) { + Span span = helper.buildSpan("mset"); + try { + return commands.mset(map); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean msetnx(Map map) { + Span span = helper.buildSpan("msetnx"); + try { + return commands.msetnx(map); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String set(K key, V value) { + Span span = helper.buildSpan("set", key); + try { + return commands.set(key, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String set(K key, V value, SetArgs setArgs) { + Span span = helper.buildSpan("set", key); + try { + return commands.set(key, value, setArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long setbit(K key, long offset, int value) { + Span span = helper.buildSpan("setbit", key); + span.setTag("offset", offset); + span.setTag("value", value); + try { + return commands.setbit(key, offset, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String setex(K key, long seconds, V value) { + Span span = helper.buildSpan("setex", key); + span.setTag("seconds", seconds); + try { + return commands.setex(key, seconds, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String psetex(K key, long milliseconds, V value) { + Span span = helper.buildSpan("psetex", key); + span.setTag("milliseconds", milliseconds); + try { + return commands.psetex(key, milliseconds, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean setnx(K key, V value) { + Span span = helper.buildSpan("setnx", key); + try { + return commands.setnx(key, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long setrange(K key, long offset, V value) { + Span span = helper.buildSpan("setrange", key); + span.setTag("offset", offset); + try { + return commands.setrange(key, offset, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long strlen(K key) { + Span span = helper.buildSpan("strlen", key); + try { + return commands.strlen(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public KeyValue blpop(long timeout, K... keys) { + Span span = helper.buildSpan("blpop", keys); + span.setTag("timeout", timeout); + try { + return commands.blpop(timeout, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public KeyValue brpop(long timeout, K... keys) { + Span span = helper.buildSpan("brpop", keys); + span.setTag("timeout", timeout); + try { + return commands.brpop(timeout, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V brpoplpush(long timeout, K source, K destination) { + Span span = helper.buildSpan("brpoplpush"); + span.setTag("timeout", timeout); + try { + return commands.brpoplpush(timeout, source, destination); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V lindex(K key, long index) { + Span span = helper.buildSpan("lindex", key); + span.setTag("index", index); + try { + return commands.lindex(key, index); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long linsert(K key, boolean before, V pivot, V value) { + Span span = helper.buildSpan("linsert", key); + span.setTag("before", before); + try { + return commands.linsert(key, before, pivot, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long llen(K key) { + Span span = helper.buildSpan("llen", key); + try { + return commands.llen(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V lpop(K key) { + Span span = helper.buildSpan("lpop", key); + try { + return commands.lpop(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long lpush(K key, V... values) { + Span span = helper.buildSpan("lpush", key); + try { + return commands.lpush(key, values); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long lpushx(K key, V... values) { + Span span = helper.buildSpan("lpushx", key); + try { + return commands.lpushx(key, values); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List lrange(K key, long start, long stop) { + Span span = helper.buildSpan("lrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.lrange(key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long lrange(ValueStreamingChannel channel, K key, long start, + long stop) { + Span span = helper.buildSpan("lrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.lrange(channel, key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long lrem(K key, long count, V value) { + Span span = helper.buildSpan("lrem", key); + span.setTag("count", count); + try { + return commands.lrem(key, count, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String lset(K key, long index, V value) { + Span span = helper.buildSpan("lset", key); + span.setTag("index", index); + try { + return commands.lset(key, index, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String ltrim(K key, long start, long stop) { + Span span = helper.buildSpan("ltrim", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.ltrim(key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V rpop(K key) { + Span span = helper.buildSpan("rpop", key); + try { + return commands.rpop(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V rpoplpush(K source, K destination) { + Span span = helper.buildSpan("rpoplpush"); + try { + return commands.rpoplpush(source, destination); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long rpush(K key, V... values) { + Span span = helper.buildSpan("rpush", key); + try { + return commands.rpush(key, values); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long rpushx(K key, V... values) { + Span span = helper.buildSpan("rpushx", key); + try { + return commands.rpushx(key, values); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sadd(K key, V... members) { + Span span = helper.buildSpan("sadd", key); + try { + return commands.sadd(key, members); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long scard(K key) { + Span span = helper.buildSpan("scard", key); + try { + return commands.scard(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Set sdiff(K... keys) { + Span span = helper.buildSpan("sdiff", keys); + try { + return commands.sdiff(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sdiff(ValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("sdiff", keys); + try { + return commands.sdiff(channel, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sdiffstore(K destination, K... keys) { + Span span = helper.buildSpan("sdiffstore", keys); + try { + return commands.sdiffstore(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Set sinter(K... keys) { + Span span = helper.buildSpan("sinter", keys); + try { + return commands.sinter(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sinter(ValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("sinter", keys); + try { + return commands.sinter(channel, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sinterstore(K destination, K... keys) { + Span span = helper.buildSpan("sinterstore", keys); + try { + return commands.sinterstore(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean sismember(K key, V member) { + Span span = helper.buildSpan("sismember", key); + try { + return commands.sismember(key, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Boolean smove(K source, K destination, V member) { + Span span = helper.buildSpan("smove"); + try { + return commands.smove(source, destination, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Set smembers(K key) { + Span span = helper.buildSpan("smembers", key); + try { + return commands.smembers(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long smembers(ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("smembers", key); + try { + return commands.smembers(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V spop(K key) { + Span span = helper.buildSpan("spop", key); + try { + return commands.spop(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Set spop(K key, long count) { + Span span = helper.buildSpan("spop", key); + span.setTag("count", count); + try { + return commands.spop(key, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V srandmember(K key) { + Span span = helper.buildSpan("srandmember", key); + try { + return commands.srandmember(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List srandmember(K key, long count) { + Span span = helper.buildSpan("srandmember", key); + span.setTag("count", count); + try { + return commands.srandmember(key, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long srandmember(ValueStreamingChannel channel, K key, long count) { + Span span = helper.buildSpan("srandmember", key); + span.setTag("count", count); + try { + return commands.srandmember(channel, key, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long srem(K key, V... members) { + Span span = helper.buildSpan("srem", key); + try { + return commands.srem(key, members); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Set sunion(K... keys) { + Span span = helper.buildSpan("sunion", keys); + try { + return commands.sunion(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sunion(ValueStreamingChannel channel, K... keys) { + Span span = helper.buildSpan("sunion", keys); + try { + return commands.sunion(channel, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long sunionstore(K destination, K... keys) { + Span span = helper.buildSpan("sunionstore", keys); + try { + return commands.sunionstore(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ValueScanCursor sscan(K key) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ValueScanCursor sscan(K key, ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(key, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ValueScanCursor sscan(K key, ScanCursor scanCursor, + ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(key, scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ValueScanCursor sscan(K key, ScanCursor scanCursor) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(key, scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor sscan( + ValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor sscan( + ValueStreamingChannel channel, K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(channel, key, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor sscan( + ValueStreamingChannel channel, K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(channel, key, scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor sscan( + ValueStreamingChannel channel, K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("sscan", key); + try { + return commands.sscan(channel, key, scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public KeyValue> bzpopmin(long timeout, K... keys) { + Span span = helper.buildSpan("bzpopmin", keys); + span.setTag("timeout", timeout); + return helper.decorate(span, () -> commands.bzpopmin(timeout, keys)); + } + + @Override + public KeyValue> bzpopmax(long timeout, K... keys) { + Span span = helper.buildSpan("bzpopmax", keys); + span.setTag("timeout", timeout); + return helper.decorate(span, () -> commands.bzpopmax(timeout, keys)); + } + + @Override + public Long zadd(K key, double score, V member) { + Span span = helper.buildSpan("zadd", key); + span.setTag("score", score); + try { + return commands.zadd(key, score, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zadd(K key, Object... scoresAndValues) { + Span span = helper.buildSpan("zadd", key); + try { + return commands.zadd(key, scoresAndValues); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zadd(K key, ScoredValue... scoredValues) { + Span span = helper.buildSpan("zadd", key); + try { + return commands.zadd(key, scoredValues); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zadd(K key, ZAddArgs zAddArgs, double score, V member) { + Span span = helper.buildSpan("zadd", key); + span.setTag("score", score); + try { + return commands.zadd(key, zAddArgs, score, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zadd(K key, ZAddArgs zAddArgs, Object... scoresAndValues) { + Span span = helper.buildSpan("zadd", key); + try { + return commands.zadd(key, zAddArgs, scoresAndValues); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zadd(K key, ZAddArgs zAddArgs, + ScoredValue... scoredValues) { + Span span = helper.buildSpan("zadd", key); + try { + return commands.zadd(key, zAddArgs, scoredValues); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Double zaddincr(K key, double score, V member) { + Span span = helper.buildSpan("zaddincr", key); + span.setTag("score", score); + try { + return commands.zaddincr(key, score, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Double zaddincr(K key, ZAddArgs zAddArgs, double score, V member) { + Span span = helper.buildSpan("zaddincr", key); + span.setTag("score", score); + try { + return commands.zaddincr(key, zAddArgs, score, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zcard(K key) { + Span span = helper.buildSpan("zcard", key); + try { + return commands.zcard(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zcount(K key, double min, double max) { + Span span = helper.buildSpan("zcount", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zcount(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zcount(K key, String min, String max) { + Span span = helper.buildSpan("zcount", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zcount(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zcount(K key, Range range) { + Span span = helper.buildSpan("zcount", key); + try { + return commands.zcount(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Double zincrby(K key, double amount, V member) { + Span span = helper.buildSpan("zincrby", key); + span.setTag("amount", amount); + try { + return commands.zincrby(key, amount, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zinterstore(K destination, K... keys) { + Span span = helper.buildSpan("zinterstore", keys); + try { + return commands.zinterstore(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zinterstore(K destination, ZStoreArgs storeArgs, K... keys) { + Span span = helper.buildSpan("zinterstore", keys); + try { + return commands.zinterstore(destination, storeArgs, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zlexcount(K key, String min, String max) { + Span span = helper.buildSpan("zlexcount", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zlexcount(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zlexcount(K key, Range range) { + Span span = helper.buildSpan("zlexcount", key); + span.setTag("range", range == null ? "null" : range.toString()); + try { + return commands.zlexcount(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ScoredValue zpopmin(K key) { + Span span = helper.buildSpan("zpopmin", key); + return helper.decorate(span, () -> commands.zpopmin(key)); + } + + @Override + public List> zpopmin(K key, long count) { + Span span = helper.buildSpan("zpopmin", key); + span.setTag("count", count); + return helper.decorate(span, () -> commands.zpopmin(key, count)); + } + + @Override + public ScoredValue zpopmax(K key) { + Span span = helper.buildSpan("zpopmax", key); + return helper.decorate(span, () -> commands.zpopmax(key)); + } + + @Override + public List> zpopmax(K key, long count) { + Span span = helper.buildSpan("zpopmax", key); + span.setTag("count", count); + return helper.decorate(span, () -> commands.zpopmax(key, count)); + } + + @Override + public List zrange(K key, long start, long stop) { + Span span = helper.buildSpan("zrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrange(key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrange(ValueStreamingChannel channel, K key, long start, + long stop) { + Span span = helper.buildSpan("zrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrange(channel, key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> zrangeWithScores(K key, long start, long stop) { + Span span = helper.buildSpan("zrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrangeWithScores(key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrangeWithScores(ScoredValueStreamingChannel channel, K key, + long start, long stop) { + Span span = helper.buildSpan("zrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrangeWithScores(channel, key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrangebylex(K key, String min, String max) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebylex(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrangebylex(K key, Range range) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("range", range == null ? "null" : range.toString()); + try { + return commands.zrangebylex(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrangebylex(K key, String min, String max, long offset, long count) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebylex(key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrangebylex(K key, Range range, + Limit limit) { + Span span = helper.buildSpan("zrangebylex", key); + span.setTag("range", range == null ? "null" : range.toString()); + span.setTag("limit", limit == null ? "null" : limit.toString()); + try { + return commands.zrangebylex(key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrangebyscore(K key, double min, double max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscore(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrangebyscore(K key, String min, String max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscore(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrangebyscore(K key, + Range range) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", range == null ? "null" : range.toString()); + try { + return commands.zrangebyscore(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrangebyscore(K key, double min, double max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscore(key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrangebyscore(K key, String min, String max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscore(key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrangebyscore(K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", range == null ? "null" : range.toString()); + span.setTag("limit", limit == null ? "null" : limit.toString()); + try { + return commands.zrangebyscore(key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscore(ValueStreamingChannel channel, K key, + double min, double max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscore(channel, key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscore(ValueStreamingChannel channel, K key, + String min, String max) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscore(channel, key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrangebyscore(ValueStreamingChannel channel, K key, + Range range) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", range == null ? "null" : range.toString()); + try { + return commands.zrangebyscore(channel, key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscore(ValueStreamingChannel channel, K key, + double min, double max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscore(channel, key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscore(ValueStreamingChannel channel, K key, + String min, String max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscore(channel, key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrangebyscore(ValueStreamingChannel channel, K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrangebyscore", key); + span.setTag("range", range == null ? "null" : range.toString()); + span.setTag("limit", limit == null ? "null" : limit.toString()); + try { + return commands.zrangebyscore(channel, key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrangebyscoreWithScores(K key, double min, + double max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscoreWithScores(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrangebyscoreWithScores(K key, + String min, String max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscoreWithScores(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> zrangebyscoreWithScores(K key, + Range range) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", range == null ? "null" : range.toString()); + try { + return commands.zrangebyscoreWithScores(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrangebyscoreWithScores(K key, double min, + double max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscoreWithScores(key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrangebyscoreWithScores(K key, + String min, String max, long offset, long + count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscoreWithScores(key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> zrangebyscoreWithScores(K key, + Range range, Limit + limit) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", range == null ? "null" : range.toString()); + span.setTag("limit", limit == null ? "null" : limit.toString()); + try { + return commands.zrangebyscoreWithScores(key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscoreWithScores(ScoredValueStreamingChannel channel, + K key, double min, double max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscoreWithScores(channel, key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscoreWithScores(ScoredValueStreamingChannel channel, + K key, String min, String max) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zrangebyscoreWithScores(channel, key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrangebyscoreWithScores(ScoredValueStreamingChannel channel, + K key, Range range) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", range == null ? "null" : range.toString()); + try { + return commands.zrangebyscoreWithScores(channel, key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscoreWithScores(ScoredValueStreamingChannel channel, + K key, double min, double max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscoreWithScores(channel, key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrangebyscoreWithScores(ScoredValueStreamingChannel channel, + K key, String min, String max, long offset, long count) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("min", min); + span.setTag("max", max); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrangebyscoreWithScores(channel, key, min, max, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrangebyscoreWithScores(ScoredValueStreamingChannel channel, + K key, Range range, Limit limit) { + Span span = helper.buildSpan("zrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + try { + return commands.zrangebyscoreWithScores(channel, key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrank(K key, V member) { + Span span = helper.buildSpan("zrank", key); + try { + return commands.zrank(key, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrem(K key, V... members) { + Span span = helper.buildSpan("zrem", key); + try { + return commands.zrem(key, members); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zremrangebylex(K key, String min, String max) { + Span span = helper.buildSpan("zremrangebylex", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zremrangebylex(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zremrangebylex(K key, Range range) { + Span span = helper.buildSpan("zremrangebylex", key); + span.setTag("range", nullable(range)); + try { + return commands.zremrangebylex(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zremrangebyrank(K key, long start, long stop) { + Span span = helper.buildSpan("zremrangebyrank", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zremrangebyrank(key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zremrangebyscore(K key, double min, double max) { + Span span = helper.buildSpan("zremrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zremrangebyscore(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zremrangebyscore(K key, String min, String max) { + Span span = helper.buildSpan("zremrangebyscore", key); + span.setTag("min", min); + span.setTag("max", max); + try { + return commands.zremrangebyscore(key, min, max); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zremrangebyscore(K key, Range range) { + Span span = helper.buildSpan("zremrangebyscore", key); + span.setTag("range", nullable(range)); + try { + return commands.zremrangebyscore(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrevrange(K key, long start, long stop) { + Span span = helper.buildSpan("zrevrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrevrange(key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrevrange(ValueStreamingChannel channel, K key, long start, + long stop) { + Span span = helper.buildSpan("zrevrange", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrevrange(channel, key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> zrevrangeWithScores(K key, long start, + long stop) { + Span span = helper.buildSpan("zrevrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrevrangeWithScores(key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrevrangeWithScores(ScoredValueStreamingChannel channel, + K key, long start, long stop) { + Span span = helper.buildSpan("zrevrangeWithScores", key); + span.setTag("start", start); + span.setTag("stop", stop); + try { + return commands.zrevrangeWithScores(channel, key, start, stop); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrevrangebylex(K key, Range range) { + Span span = helper.buildSpan("zrevrangebylex", key); + span.setTag("range", nullable(range)); + try { + return commands.zrevrangebylex(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrevrangebylex(K key, Range range, + Limit limit) { + Span span = helper.buildSpan("zrevrangebylex", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + try { + return commands.zrevrangebylex(key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrevrangebyscore(K key, double max, double min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscore(key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrevrangebyscore(K key, String max, String min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscore(key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrevrangebyscore(K key, + Range range) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + try { + return commands.zrevrangebyscore(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrevrangebyscore(K key, double max, double min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscore(key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List zrevrangebyscore(K key, String max, String min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscore(key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List zrevrangebyscore(K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + try { + return commands.zrevrangebyscore(key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscore(ValueStreamingChannel channel, K key, + double max, double min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscore(channel, key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscore(ValueStreamingChannel channel, K key, + String max, String min) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscore(channel, key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrevrangebyscore(ValueStreamingChannel channel, K key, + Range range) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + try { + return commands.zrevrangebyscore(channel, key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscore(ValueStreamingChannel channel, K key, + double max, double min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscore(channel, key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscore(ValueStreamingChannel channel, K key, + String max, String min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscore(channel, key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrevrangebyscore(ValueStreamingChannel channel, K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebyscore", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + try { + return commands.zrevrangebyscore(channel, key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrevrangebyscoreWithScores(K key, double max, + double min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscoreWithScores(key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrevrangebyscoreWithScores(K key, + String max, String min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscoreWithScores(key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> zrevrangebyscoreWithScores(K key, + Range range) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + try { + return commands.zrevrangebyscoreWithScores(key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrevrangebyscoreWithScores(K key, double max, + double min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscoreWithScores(key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public List> zrevrangebyscoreWithScores(K key, + String max, String min, long offset, + long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscoreWithScores(key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> zrevrangebyscoreWithScores(K key, + Range range, Limit + limit) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + try { + return commands.zrevrangebyscoreWithScores(key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, double max, double min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscoreWithScores(channel, key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, String max, + String min) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + try { + return commands.zrevrangebyscoreWithScores(channel, key, max, min); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, + Range range) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + try { + return commands.zrevrangebyscoreWithScores(channel, key, range); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, double max, double min, + long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscoreWithScores(channel, key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public Long zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, String max, + String min, long offset, long count) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("max", max); + span.setTag("min", min); + span.setTag("offset", offset); + span.setTag("count", count); + try { + return commands.zrevrangebyscoreWithScores(channel, key, max, min, offset, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrevrangebyscoreWithScores( + ScoredValueStreamingChannel channel, K key, + Range range, Limit limit) { + Span span = helper.buildSpan("zrevrangebyscoreWithScores", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + try { + return commands.zrevrangebyscoreWithScores(channel, key, range, limit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zrevrank(K key, V member) { + Span span = helper.buildSpan("zrevrank", key); + try { + return commands.zrevrank(key, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ScoredValueScanCursor zscan(K key) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ScoredValueScanCursor zscan(K key, ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(key, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ScoredValueScanCursor zscan(K key, ScanCursor scanCursor, + ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(key, scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public ScoredValueScanCursor zscan(K key, ScanCursor scanCursor) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(key, scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor zscan( + ScoredValueStreamingChannel channel, K key) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(channel, key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor zscan( + ScoredValueStreamingChannel channel, K key, + ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(channel, key, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor zscan( + ScoredValueStreamingChannel channel, K key, + ScanCursor scanCursor, ScanArgs scanArgs) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(channel, key, scanCursor, scanArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public StreamScanCursor zscan( + ScoredValueStreamingChannel channel, K key, + ScanCursor scanCursor) { + Span span = helper.buildSpan("zscan", key); + try { + return commands.zscan(channel, key, scanCursor); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Double zscore(K key, V member) { + Span span = helper.buildSpan("zscore", key); + try { + return commands.zscore(key, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zunionstore(K destination, K... keys) { + Span span = helper.buildSpan("zunionstore", keys); + try { + return commands.zunionstore(destination, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long zunionstore(K destination, ZStoreArgs storeArgs, K... keys) { + Span span = helper.buildSpan("zunionstore", keys); + try { + return commands.zunionstore(destination, storeArgs, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long xack(K key, K group, String... messageIds) { + Span span = helper.buildSpan("xack", key); + span.setTag("group", nullable(group)); + span.setTag("messageIds", Arrays.toString(messageIds)); + return helper.decorate(span, () -> commands.xack(key, group, messageIds)); + } + + @Override + public String xadd(K key, Map body) { + Span span = helper.buildSpan("xadd", key); + span.setTag("body", TracingHelper.mapToString(body)); + return helper.decorate(span, () -> commands.xadd(key, body)); + } + + @Override + public String xadd(K key, XAddArgs args, Map body) { + Span span = helper.buildSpan("xadd", key); + span.setTag("body", TracingHelper.mapToString(body)); + return helper.decorate(span, () -> commands.xadd(key, args, body)); + } + + @Override + public String xadd(K key, Object... keysAndValues) { + Span span = helper.buildSpan("xadd", key); + span.setTag("keysAndValues", Arrays.toString(keysAndValues)); + return helper.decorate(span, () -> commands.xadd(key, keysAndValues)); + } + + @Override + public String xadd(K key, XAddArgs args, Object... keysAndValues) { + Span span = helper.buildSpan("xadd", key); + span.setTag("keysAndValues", Arrays.toString(keysAndValues)); + return helper.decorate(span, () -> commands.xadd(key, args, keysAndValues)); + } + + @Override + public List> xclaim(K key, Consumer consumer, long minIdleTime, + String... messageIds) { + Span span = helper.buildSpan("xclaim", key); + span.setTag("minIdleTime", minIdleTime); + span.setTag("consumer", nullable(consumer)); + span.setTag("messageIds", Arrays.toString(messageIds)); + return helper.decorate(span, () -> commands.xclaim(key, consumer, minIdleTime, messageIds)); + } + + @Override + public List> xclaim(K key, Consumer consumer, XClaimArgs args, + String... messageIds) { + Span span = helper.buildSpan("xclaim", key); + span.setTag("consumer", nullable(consumer)); + span.setTag("messageIds", Arrays.toString(messageIds)); + return helper.decorate(span, () -> commands.xclaim(key, consumer, args, messageIds)); + } + + @Override + public Long xdel(K key, String... messageIds) { + Span span = helper.buildSpan("xdel", key); + span.setTag("messageIds", Arrays.toString(messageIds)); + return helper.decorate(span, () -> commands.xdel(key, messageIds)); + } + + @Override + public String xgroupCreate(StreamOffset streamOffset, K group) { + Span span = helper.buildSpan("xgroupCreate"); + span.setTag("streamOffset", nullable(streamOffset)); + span.setTag("group", nullable(group)); + return helper.decorate(span, () -> commands.xgroupCreate(streamOffset, group)); + } + + @Override + public Boolean xgroupDelconsumer(K key, Consumer consumer) { + Span span = helper.buildSpan("xgroupDelconsumer", key); + span.setTag("consumer", nullable(consumer)); + return helper.decorate(span, () -> commands.xgroupDelconsumer(key, consumer)); + } + + @Override + public Boolean xgroupDestroy(K key, K group) { + Span span = helper.buildSpan("xgroupDestroy", key); + span.setTag("group", nullable(group)); + return helper.decorate(span, () -> commands.xgroupDestroy(key, group)); + } + + @Override + public String xgroupSetid(StreamOffset streamOffset, K group) { + Span span = helper.buildSpan("xgroupSetid"); + span.setTag("streamOffset", nullable(streamOffset)); + span.setTag("group", nullable(group)); + return helper.decorate(span, () -> commands.xgroupSetid(streamOffset, group)); + } + + @Override + public Long xlen(K key) { + Span span = helper.buildSpan("xlen", key); + return helper.decorate(span, () -> commands.xlen(key)); + } + + @Override + public List xpending(K key, K group) { + Span span = helper.buildSpan("xpending", key); + span.setTag("group", nullable(group)); + return helper.decorate(span, () -> commands.xpending(key, group)); + } + + @Override + public List xpending(K key, K group, Range range, Limit limit) { + Span span = helper.buildSpan("xpending", key); + span.setTag("group", nullable(group)); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return helper.decorate(span, () -> commands.xpending(key, group, range, limit)); + } + + @Override + public List xpending(K key, Consumer consumer, Range range, Limit limit) { + Span span = helper.buildSpan("xpending", key); + span.setTag("consumer", nullable(consumer)); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return helper.decorate(span, () -> commands.xpending(key, consumer, range, limit)); + } + + @Override + public List> xrange(K key, Range range) { + Span span = helper.buildSpan("xrange", key); + span.setTag("range", nullable(range)); + return helper.decorate(span, () -> commands.xrange(key, range)); + } + + @Override + public List> xrange(K key, Range range, Limit limit) { + Span span = helper.buildSpan("xrange", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return helper.decorate(span, () -> commands.xrange(key, range, limit)); + } + + @Override + public List> xread(StreamOffset... streams) { + Span span = helper.buildSpan("xread"); + span.setTag("streams", Arrays.toString(streams)); + return helper.decorate(span, () -> commands.xread(streams)); + } + + @Override + public List> xread(XReadArgs args, StreamOffset... streams) { + Span span = helper.buildSpan("xread"); + span.setTag("streams", Arrays.toString(streams)); + return helper.decorate(span, () -> commands.xread(args, streams)); + } + + @Override + public List> xreadgroup(Consumer consumer, StreamOffset... streams) { + Span span = helper.buildSpan("xreadgroup"); + span.setTag("consumer", nullable(consumer)); + span.setTag("streams", Arrays.toString(streams)); + return helper.decorate(span, () -> commands.xreadgroup(consumer, streams)); + } + + @Override + public List> xreadgroup(Consumer consumer, XReadArgs args, + StreamOffset... streams) { + Span span = helper.buildSpan("xreadgroup"); + span.setTag("consumer", nullable(consumer)); + span.setTag("streams", Arrays.toString(streams)); + return helper.decorate(span, () -> commands.xreadgroup(consumer, args, streams)); + } + + @Override + public List> xrevrange(K key, Range range) { + Span span = helper.buildSpan("xrevrange", key); + span.setTag("range", nullable(range)); + return helper.decorate(span, () -> commands.xrevrange(key, range)); + } + + @Override + public List> xrevrange(K key, Range range, Limit limit) { + Span span = helper.buildSpan("xrevrange", key); + span.setTag("range", nullable(range)); + span.setTag("limit", nullable(limit)); + return helper.decorate(span, () -> commands.xrevrange(key, range, limit)); + } + + @Override + public Long xtrim(K key, long count) { + Span span = helper.buildSpan("xtrim", key); + span.setTag("count", count); + return helper.decorate(span, () -> commands.xtrim(key, count)); + } + + @Override + public Long xtrim(K key, boolean approximateTrimming, long count) { + Span span = helper.buildSpan("xtrim", key); + span.setTag("approximateTrimming", approximateTrimming); + span.setTag("count", count); + return helper.decorate(span, () -> commands.xtrim(key, approximateTrimming, count)); + } + + @Override + public T eval(String script, ScriptOutputType type, K... keys) { + Span span = helper.buildSpan("eval", keys); + try { + return commands.eval(script, type, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public T eval(String script, ScriptOutputType type, K[] keys, V... values) { + Span span = helper.buildSpan("eval", keys); + try { + return commands.eval(script, type, keys, values); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public T evalsha(String digest, ScriptOutputType type, K... keys) { + Span span = helper.buildSpan("evalsha", keys); + try { + return commands.evalsha(digest, type, keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public T evalsha(String digest, ScriptOutputType type, K[] keys, V... values) { + Span span = helper.buildSpan("evalsha", keys); + try { + return commands.evalsha(digest, type, keys, values); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List scriptExists(String... digests) { + Span span = helper.buildSpan("scriptExists"); + try { + return commands.scriptExists(digests); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String scriptFlush() { + Span span = helper.buildSpan("scriptFlush"); + try { + return commands.scriptFlush(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String scriptKill() { + Span span = helper.buildSpan("scriptKill"); + try { + return commands.scriptKill(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String scriptLoad(V script) { + Span span = helper.buildSpan("scriptLoad"); + try { + return commands.scriptLoad(script); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String digest(V script) { + Span span = helper.buildSpan("digest"); + try { + return commands.digest(script); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String bgrewriteaof() { + Span span = helper.buildSpan("bgrewriteaof"); + try { + return commands.bgrewriteaof(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String bgsave() { + Span span = helper.buildSpan("bgsave"); + try { + return commands.bgsave(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public K clientGetname() { + Span span = helper.buildSpan("clientGetname"); + try { + return commands.clientGetname(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clientSetname(K name) { + Span span = helper.buildSpan("clientSetname"); + try { + return commands.clientSetname(name); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clientKill(String addr) { + Span span = helper.buildSpan("clientKill"); + span.setTag("addr", addr); + try { + return commands.clientKill(addr); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long clientKill(KillArgs killArgs) { + Span span = helper.buildSpan("clientKill"); + try { + return commands.clientKill(killArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long clientUnblock(long id, UnblockType type) { + Span span = helper.buildSpan("clientUnblock"); + span.setTag("id", id); + span.setTag("type", nullable(type)); + return helper.decorate(span, () -> commands.clientUnblock(id, type)); + } + + @Override + public String clientPause(long timeout) { + Span span = helper.buildSpan("clientPause"); + span.setTag("timeout", timeout); + try { + return commands.clientPause(timeout); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clientList() { + Span span = helper.buildSpan("clientList"); + try { + return commands.clientList(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List command() { + Span span = helper.buildSpan("command"); + try { + return commands.command(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List commandInfo(String... commands) { + Span span = helper.buildSpan("commandInfo"); + try { + return this.commands.commandInfo(commands); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List commandInfo(CommandType... commands) { + Span span = helper.buildSpan("commandInfo"); + try { + return this.commands.commandInfo(commands); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long commandCount() { + Span span = helper.buildSpan("commandCount"); + try { + return commands.commandCount(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Map configGet(String parameter) { + Span span = helper.buildSpan("configGet"); + span.setTag("parameter", parameter); + try { + return commands.configGet(parameter); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String configResetstat() { + Span span = helper.buildSpan("configResetstat"); + try { + return commands.configResetstat(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String configRewrite() { + Span span = helper.buildSpan("configRewrite"); + try { + return commands.configRewrite(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String configSet(String parameter, String value) { + Span span = helper.buildSpan("configSet"); + span.setTag("parameter", parameter); + try { + return commands.configSet(parameter, value); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long dbsize() { + Span span = helper.buildSpan("dbsize"); + try { + return commands.dbsize(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String debugCrashAndRecover(Long delay) { + Span span = helper.buildSpan("debugCrashAndRecover"); + span.setTag("delay", nullable(delay)); + try { + return commands.debugCrashAndRecover(delay); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String debugHtstats(int db) { + Span span = helper.buildSpan("debugHtstats"); + span.setTag("db", db); + try { + return commands.debugHtstats(db); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String debugObject(K key) { + Span span = helper.buildSpan("debugObject", key); + try { + return commands.debugObject(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void debugOom() { + Span span = helper.buildSpan("debugOom"); + try { + commands.debugOom(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void debugSegfault() { + Span span = helper.buildSpan("debugSegfault"); + try { + commands.debugSegfault(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String debugReload() { + Span span = helper.buildSpan("debugReload"); + try { + return commands.debugReload(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String debugRestart(Long delay) { + Span span = helper.buildSpan("debugRestart"); + span.setTag("delay", nullable(delay)); + try { + return commands.debugRestart(delay); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String debugSdslen(K key) { + Span span = helper.buildSpan("debugSdslen", key); + try { + return commands.debugSdslen(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String flushall() { + Span span = helper.buildSpan("flushall"); + try { + return commands.flushall(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String flushallAsync() { + Span span = helper.buildSpan("flushallAsync"); + try { + return commands.flushallAsync(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String flushdb() { + Span span = helper.buildSpan("flushdb"); + try { + return commands.flushdb(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String flushdbAsync() { + Span span = helper.buildSpan("flushdbAsync"); + try { + return commands.flushdbAsync(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String info() { + Span span = helper.buildSpan("info"); + try { + return commands.info(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String info(String section) { + Span span = helper.buildSpan("info"); + span.setTag("section", section); + try { + return commands.info(section); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Date lastsave() { + Span span = helper.buildSpan("lastsave"); + try { + return commands.lastsave(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String save() { + Span span = helper.buildSpan("save"); + try { + return commands.save(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void shutdown(boolean save) { + Span span = helper.buildSpan("save"); + span.setTag("save", save); + try { + commands.shutdown(save); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String slaveof(String host, int port) { + Span span = helper.buildSpan("slaveof"); + span.setTag("host", host); + span.setTag("port", port); + try { + return commands.slaveof(host, port); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String slaveofNoOne() { + Span span = helper.buildSpan("slaveofNoOne"); + try { + return commands.slaveofNoOne(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List slowlogGet() { + Span span = helper.buildSpan("slowlogGet"); + try { + return commands.slowlogGet(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List slowlogGet(int count) { + Span span = helper.buildSpan("slowlogGet"); + span.setTag("count", count); + try { + return commands.slowlogGet(count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long slowlogLen() { + Span span = helper.buildSpan("slowlogLen"); + try { + return commands.slowlogLen(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String slowlogReset() { + Span span = helper.buildSpan("slowlogReset"); + try { + return commands.slowlogReset(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List time() { + Span span = helper.buildSpan("time"); + try { + return commands.time(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long pfadd(K key, V... values) { + Span span = helper.buildSpan("pfadd", key); + try { + return commands.pfadd(key, values); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String pfmerge(K destkey, K... sourcekeys) { + Span span = helper.buildSpan("pfmerge"); + try { + return commands.pfmerge(destkey, sourcekeys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long pfcount(K... keys) { + Span span = helper.buildSpan("pfcount", keys); + try { + return commands.pfcount(keys); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long publish(K channel, V message) { + Span span = helper.buildSpan("publish"); + try { + return commands.publish(channel, message); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List pubsubChannels() { + Span span = helper.buildSpan("pubsubChannels"); + try { + return commands.pubsubChannels(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List pubsubChannels(K channel) { + Span span = helper.buildSpan("pubsubChannels"); + try { + return commands.pubsubChannels(channel); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Map pubsubNumsub(K... channels) { + Span span = helper.buildSpan("pubsubNumsub"); + try { + return commands.pubsubNumsub(channels); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long pubsubNumpat() { + Span span = helper.buildSpan("pubsubNumpat"); + try { + return commands.pubsubNumpat(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public V echo(V msg) { + Span span = helper.buildSpan("echo"); + try { + return commands.echo(msg); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List role() { + Span span = helper.buildSpan("role"); + try { + return commands.role(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String ping() { + Span span = helper.buildSpan("ping"); + try { + return commands.ping(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String readOnly() { + Span span = helper.buildSpan("readOnly"); + try { + return commands.readOnly(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String readWrite() { + Span span = helper.buildSpan("readWrite"); + try { + return commands.readWrite(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String quit() { + Span span = helper.buildSpan("quit"); + try { + return commands.quit(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long waitForReplication(int replicas, long timeout) { + Span span = helper.buildSpan("waitForReplication"); + span.setTag("replicas", replicas); + span.setTag("timeout", timeout); + try { + return commands.waitForReplication(replicas, timeout); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public T dispatch(ProtocolKeyword type, + CommandOutput output) { + Span span = helper.buildSpan("dispatch"); + try { + return commands.dispatch(type, output); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public T dispatch(ProtocolKeyword type, + CommandOutput output, + CommandArgs args) { + Span span = helper.buildSpan("dispatch"); + try { + return commands.dispatch(type, output, args); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public boolean isOpen() { + Span span = helper.buildSpan("isOpen"); + try { + return commands.isOpen(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void reset() { + Span span = helper.buildSpan("reset"); + try { + commands.reset(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public void setTimeout(Duration timeout) { + Span span = helper.buildSpan("setTimeout"); + span.setTag("timeout", nullable(timeout)); + try { + commands.setTimeout(timeout); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + @Deprecated + public void setTimeout(long timeout, TimeUnit unit) { + Span span = helper.buildSpan("setTimeout"); + span.setTag("timeout", timeout); + span.setTag("unit", nullable(unit)); + try { + commands.setTimeout(timeout, unit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterBumpepoch() { + Span span = helper.buildSpan("clusterBumpepoch"); + try { + return commands.clusterBumpepoch(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterMeet(String ip, int port) { + Span span = helper.buildSpan("clusterMeet"); + span.setTag("ip", ip); + span.setTag("port", port); + try { + return commands.clusterMeet(ip, port); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterForget(String nodeId) { + Span span = helper.buildSpan("clusterForget"); + span.setTag("nodeId", nodeId); + try { + return commands.clusterForget(nodeId); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterAddSlots(int... slots) { + Span span = helper.buildSpan("clusterAddSlots"); + span.setTag("slots", Arrays.toString(slots)); + try { + return commands.clusterAddSlots(slots); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterDelSlots(int... slots) { + Span span = helper.buildSpan("clusterDelSlots"); + span.setTag("slots", Arrays.toString(slots)); + try { + return commands.clusterDelSlots(slots); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterSetSlotNode(int slot, String nodeId) { + Span span = helper.buildSpan("clusterSetSlotNode"); + span.setTag("slot", slot); + span.setTag("nodeId", nodeId); + try { + return commands.clusterSetSlotNode(slot, nodeId); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterSetSlotStable(int slot) { + Span span = helper.buildSpan("clusterSetSlotStable"); + span.setTag("slot", slot); + try { + return commands.clusterSetSlotStable(slot); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterSetSlotMigrating(int slot, String nodeId) { + Span span = helper.buildSpan("clusterSetSlotMigrating"); + span.setTag("slot", slot); + span.setTag("nodeId", nodeId); + try { + return commands.clusterSetSlotMigrating(slot, nodeId); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterSetSlotImporting(int slot, String nodeId) { + Span span = helper.buildSpan("clusterSetSlotImporting"); + span.setTag("slot", slot); + span.setTag("nodeId", nodeId); + try { + return commands.clusterSetSlotImporting(slot, nodeId); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterInfo() { + Span span = helper.buildSpan("clusterInfo"); + try { + return commands.clusterInfo(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterMyId() { + Span span = helper.buildSpan("clusterMyId"); + try { + return commands.clusterMyId(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterNodes() { + Span span = helper.buildSpan("clusterNodes"); + try { + return commands.clusterNodes(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List clusterSlaves(String nodeId) { + Span span = helper.buildSpan("clusterSlaves"); + span.setTag("nodeId", nodeId); + try { + return commands.clusterSlaves(nodeId); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List clusterGetKeysInSlot(int slot, int count) { + Span span = helper.buildSpan("clusterGetKeysInSlot"); + span.setTag("slot", slot); + span.setTag("count", count); + try { + return commands.clusterGetKeysInSlot(slot, count); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long clusterCountKeysInSlot(int slot) { + Span span = helper.buildSpan("clusterCountKeysInSlot"); + span.setTag("slot", slot); + try { + return commands.clusterCountKeysInSlot(slot); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long clusterCountFailureReports(String nodeId) { + Span span = helper.buildSpan("clusterCountFailureReports"); + span.setTag("nodeId", nodeId); + try { + return commands.clusterCountFailureReports(nodeId); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long clusterKeyslot(K key) { + Span span = helper.buildSpan("clusterKeyslot"); + try { + return commands.clusterKeyslot(key); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterSaveconfig() { + Span span = helper.buildSpan("clusterSaveconfig"); + try { + return commands.clusterSaveconfig(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterSetConfigEpoch(long configEpoch) { + Span span = helper.buildSpan("clusterSetConfigEpoch"); + span.setTag("configEpoch", configEpoch); + try { + return commands.clusterSetConfigEpoch(configEpoch); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List clusterSlots() { + Span span = helper.buildSpan("clusterSlots"); + try { + return commands.clusterSlots(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String asking() { + Span span = helper.buildSpan("asking"); + try { + return commands.asking(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterReplicate(String nodeId) { + Span span = helper.buildSpan("clusterReplicate"); + span.setTag("nodeId", nodeId); + try { + return commands.clusterReplicate(nodeId); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterFailover(boolean force) { + Span span = helper.buildSpan("clusterFailover"); + span.setTag("force", force); + try { + return commands.clusterFailover(force); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterReset(boolean hard) { + Span span = helper.buildSpan("clusterReset"); + span.setTag("hard", hard); + try { + return commands.clusterReset(hard); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public String clusterFlushslots() { + Span span = helper.buildSpan("clusterFlushslots"); + try { + return commands.clusterFlushslots(); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long geoadd(K key, double longitude, double latitude, V member) { + Span span = helper.buildSpan("geoadd", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + try { + return commands.geoadd(key, longitude, latitude, member); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long geoadd(K key, Object... lngLatMember) { + Span span = helper.buildSpan("geoadd", key); + try { + return commands.geoadd(key, lngLatMember); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> geohash(K key, V... members) { + Span span = helper.buildSpan("geohash", key); + try { + return commands.geohash(key, members); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Set georadius(K key, double longitude, double latitude, double distance, + Unit unit) { + Span span = helper.buildSpan("georadius", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + span.setTag("distance", distance); + span.setTag("unit", nullable(unit)); + try { + return commands.georadius(key, longitude, latitude, distance, unit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> georadius(K key, double longitude, + double latitude, double distance, Unit unit, + GeoArgs geoArgs) { + Span span = helper.buildSpan("georadius", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + span.setTag("distance", distance); + span.setTag("unit", nullable(unit)); + try { + return commands.georadius(key, longitude, latitude, distance, unit, geoArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long georadius(K key, double longitude, double latitude, double distance, + Unit unit, GeoRadiusStoreArgs geoRadiusStoreArgs) { + Span span = helper.buildSpan("georadius", key); + span.setTag("longitude", longitude); + span.setTag("latitude", latitude); + span.setTag("distance", distance); + span.setTag("unit", nullable(unit)); + try { + return commands.georadius(key, longitude, latitude, distance, unit, geoRadiusStoreArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Set georadiusbymember(K key, V member, double distance, + Unit unit) { + Span span = helper.buildSpan("georadiusbymember", key); + span.setTag("distance", distance); + span.setTag("unit", nullable(unit)); + try { + return commands.georadiusbymember(key, member, distance, unit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List> georadiusbymember(K key, V member, + double distance, Unit unit, GeoArgs geoArgs) { + Span span = helper.buildSpan("georadiusbymember", key); + span.setTag("distance", distance); + span.setTag("unit", nullable(unit)); + try { + return commands.georadiusbymember(key, member, distance, unit, geoArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Long georadiusbymember(K key, V member, double distance, Unit unit, + GeoRadiusStoreArgs geoRadiusStoreArgs) { + Span span = helper.buildSpan("georadiusbymember", key); + span.setTag("distance", distance); + span.setTag("unit", nullable(unit)); + try { + return commands.georadiusbymember(key, member, distance, unit, geoRadiusStoreArgs); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public List geopos(K key, V... members) { + Span span = helper.buildSpan("geopos", key); + try { + return commands.geopos(key, members); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } + + @Override + public Double geodist(K key, V from, V to, Unit unit) { + Span span = helper.buildSpan("geodist", key); + span.setTag("unit", nullable(unit)); + try { + return commands.geodist(key, from, to, unit); + } catch (Exception e) { + onError(e, span); + throw e; + } finally { + span.finish(); + } + } +} diff --git a/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingStatefulRedisClusterConnection.java b/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingStatefulRedisClusterConnection.java new file mode 100644 index 0000000..e653f72 --- /dev/null +++ b/opentracing-redis-lettuce/src/main/java/io/opentracing/contrib/redis/lettuce/TracingStatefulRedisClusterConnection.java @@ -0,0 +1,168 @@ +/* + * Copyright 2017-2019 The OpenTracing Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package io.opentracing.contrib.redis.lettuce; + +import io.lettuce.core.ClientOptions; +import io.lettuce.core.ReadFrom; +import io.lettuce.core.api.StatefulRedisConnection; +import io.lettuce.core.cluster.api.StatefulRedisClusterConnection; +import io.lettuce.core.cluster.api.async.RedisAdvancedClusterAsyncCommands; +import io.lettuce.core.cluster.api.reactive.RedisAdvancedClusterReactiveCommands; +import io.lettuce.core.cluster.api.sync.RedisAdvancedClusterCommands; +import io.lettuce.core.cluster.models.partitions.Partitions; +import io.lettuce.core.protocol.RedisCommand; +import io.lettuce.core.resource.ClientResources; +import io.opentracing.contrib.redis.common.TracingConfiguration; +import java.time.Duration; +import java.util.Collection; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + +public class TracingStatefulRedisClusterConnection implements + StatefulRedisClusterConnection { + + private final StatefulRedisClusterConnection connection; + private final TracingConfiguration tracingConfiguration; + + /** + * @param connection redis connection + * @param tracingConfiguration tracing configuration + */ + public TracingStatefulRedisClusterConnection(StatefulRedisClusterConnection connection, + TracingConfiguration tracingConfiguration) { + this.connection = connection; + this.tracingConfiguration = tracingConfiguration; + } + + @Override + public RedisAdvancedClusterCommands sync() { + return new TracingRedisAdvancedClusterCommands<>(connection.sync(), tracingConfiguration); + } + + @Override + public RedisAdvancedClusterAsyncCommands async() { + return new TracingRedisAdvancedClusterAsyncCommands<>(connection.async(), tracingConfiguration); + } + + @Override + public RedisAdvancedClusterReactiveCommands reactive() { + return connection.reactive(); + } + + @Override + public StatefulRedisConnection getConnection(String s) { + return new TracingStatefulRedisConnection<>(connection.getConnection(s), tracingConfiguration); + } + + @Override + public CompletableFuture> getConnectionAsync(String s) { + return CompletableFuture.supplyAsync( + () -> new TracingStatefulRedisConnection<>(connection.getConnection(s), + tracingConfiguration)); + } + + @Override + public StatefulRedisConnection getConnection(String s, int i) { + return new TracingStatefulRedisConnection<>(connection.getConnection(s, i), + tracingConfiguration); + } + + @Override + public CompletableFuture> getConnectionAsync(String s, int i) { + return CompletableFuture.supplyAsync( + () -> new TracingStatefulRedisConnection<>(connection.getConnection(s, i), + tracingConfiguration)); + } + + @Override + public void setReadFrom(ReadFrom readFrom) { + connection.setReadFrom(readFrom); + } + + @Override + public ReadFrom getReadFrom() { + return connection.getReadFrom(); + } + + @Override + public Partitions getPartitions() { + return connection.getPartitions(); + } + + @Override + public void setTimeout(Duration duration) { + connection.setTimeout(duration); + } + + @Override + public void setTimeout(long l, TimeUnit timeUnit) { + connection.setTimeout(l, timeUnit); + } + + @Override + public Duration getTimeout() { + return connection.getTimeout(); + } + + @Override + public RedisCommand dispatch(RedisCommand redisCommand) { + return connection.dispatch(redisCommand); + } + + @Override + public Collection> dispatch( + Collection> collection) { + return connection.dispatch(collection); + } + + @Override + public void close() { + connection.close(); + } + + @Override + public CompletableFuture closeAsync() { + return connection.closeAsync(); + } + + @Override + public boolean isOpen() { + return connection.isOpen(); + } + + @Override + public ClientOptions getOptions() { + return connection.getOptions(); + } + + @Override + public ClientResources getResources() { + return connection.getResources(); + } + + @Override + public void reset() { + connection.reset(); + } + + @Override + public void setAutoFlushCommands(boolean b) { + connection.setAutoFlushCommands(b); + } + + @Override + public void flushCommands() { + connection.flushCommands(); + } +}