File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
arex-instrumentation/redis/arex-redis-common/src/main/java/io/arex/inst/redis/common Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 4
4
import io .arex .agent .bootstrap .model .Mocker ;
5
5
6
6
import io .arex .agent .bootstrap .util .CollectionUtil ;
7
+ import io .arex .agent .bootstrap .util .StringUtil ;
7
8
import io .arex .inst .runtime .serializer .Serializer ;
8
9
import io .arex .inst .runtime .util .IgnoreUtils ;
9
10
import io .arex .inst .runtime .util .MockUtils ;
14
15
15
16
public class RedisExtractor {
16
17
private static final String SPECIAL_CLASS_NAME = "redis.clients.jedis.BinaryJedis$SetFromList" ;
18
+ private static final String DEFAULT_CLUSTER_NAME = "Cluster" ;
17
19
18
20
private final String clusterName ;
19
21
private final String command ;
@@ -89,7 +91,10 @@ static class RedisCluster {
89
91
private static final AtomicInteger sequence = new AtomicInteger ();
90
92
91
93
static String get (String key ) {
92
- return REDIS_CLUSTER_CACHE .computeIfAbsent (key , k -> "Cluster" + sequence .addAndGet (1 ));
94
+ if (StringUtil .isEmpty (key )){
95
+ return DEFAULT_CLUSTER_NAME ;
96
+ }
97
+ return REDIS_CLUSTER_CACHE .computeIfAbsent (key , k -> DEFAULT_CLUSTER_NAME + sequence .addAndGet (1 ));
93
98
}
94
99
}
95
100
}
You can’t perform that action at this time.
0 commit comments