Skip to content

Commit b8a1619

Browse files
committed
upgrade org.redisson:redisson from 3.16.6 to 3.27.1
1 parent bf8fee6 commit b8a1619

21 files changed

Lines changed: 110 additions & 112 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2024 dengliming.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.github.dengliming.redismodule.common;
18+
19+
import org.redisson.Redisson;
20+
import org.redisson.client.protocol.RedisCommands;
21+
import org.redisson.command.CommandAsyncExecutor;
22+
import org.redisson.config.Config;
23+
24+
public abstract class BaseRedissonClient {
25+
private final Redisson redisson;
26+
27+
protected BaseRedissonClient(Config config) {
28+
this.redisson = (Redisson) Redisson.create(config);
29+
}
30+
31+
public Void flushall() {
32+
CommandAsyncExecutor commandExecutor = redisson.getCommandExecutor();
33+
return commandExecutor.get(commandExecutor.writeAllVoidAsync(RedisCommands.FLUSHALL));
34+
}
35+
36+
public void shutdown() {
37+
redisson.shutdown();
38+
}
39+
40+
public Redisson getRedisson() {
41+
return redisson;
42+
}
43+
44+
public CommandAsyncExecutor getCommandExecutor() {
45+
return redisson.getCommandExecutor();
46+
}
47+
}

commons/src/test/java/io/github/dengliming/redismodule/common/test/RedisConditionClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package io.github.dengliming.redismodule.common.test;
1818

19-
import org.redisson.Redisson;
19+
import io.github.dengliming.redismodule.common.BaseRedissonClient;
2020
import org.redisson.command.CommandAsyncExecutor;
2121
import org.redisson.config.Config;
2222

23-
public class RedisConditionClient extends Redisson {
23+
public class RedisConditionClient extends BaseRedissonClient {
2424

2525
public RedisConditionClient(Config config) {
2626
super(config);

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
<properties>
5454
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
55-
<redisson.version>3.16.6</redisson.version>
55+
<redisson.version>3.27.1</redisson.version>
5656
<junit.version>5.6.2</junit.version>
5757
<java.version>1.8</java.version>
5858
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>

redisai/src/main/java/io/github/dengliming/redismodule/redisai/RedisAI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 dengliming.
2+
* Copyright 2020-2024 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ public class RedisAI {
5757

5858
public RedisAI(CommandAsyncExecutor commandExecutor) {
5959
this.commandExecutor = commandExecutor;
60-
this.codec = commandExecutor.getConnectionManager().getCodec();
60+
this.codec = commandExecutor.getServiceManager().getCfg().getCodec();
6161
}
6262

6363
/**
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 dengliming.
2+
* Copyright 2020-2024 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,17 +16,14 @@
1616

1717
package io.github.dengliming.redismodule.redisai.client;
1818

19+
import io.github.dengliming.redismodule.common.BaseRedissonClient;
1920
import io.github.dengliming.redismodule.redisai.RedisAI;
20-
import org.redisson.Redisson;
21-
import org.redisson.client.protocol.RedisCommands;
22-
import org.redisson.command.CommandAsyncExecutor;
2321
import org.redisson.config.Config;
2422

2523
/**
2624
* @author dengliming
2725
*/
28-
public class RedisAIClient extends Redisson {
29-
26+
public class RedisAIClient extends BaseRedissonClient {
3027
public RedisAIClient(Config config) {
3128
super(config);
3229
}
@@ -35,8 +32,4 @@ public RedisAI getRedisAI() {
3532
return new RedisAI(getCommandExecutor());
3633
}
3734

38-
public Void flushall() {
39-
CommandAsyncExecutor commandExecutor = getCommandExecutor();
40-
return commandExecutor.get(commandExecutor.writeAllAsync(RedisCommands.FLUSHALL));
41-
}
4235
}

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/BloomFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 dengliming.
2+
* Copyright 2020-2024 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public BloomFilter(Codec codec, CommandAsyncExecutor commandExecutor, String nam
5252
}
5353

5454
public BloomFilter(CommandAsyncExecutor commandExecutor, String name) {
55-
this(commandExecutor.getConnectionManager().getCodec(), commandExecutor, name);
55+
this(commandExecutor.getServiceManager().getCfg().getCodec(), commandExecutor, name);
5656
}
5757

5858
/**

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/CountMinSketch.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 dengliming.
2+
* Copyright 2020-2024 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ public CountMinSketch(Codec codec, CommandAsyncExecutor commandExecutor, String
4646
}
4747

4848
public CountMinSketch(CommandAsyncExecutor commandExecutor, String name) {
49-
this(commandExecutor.getConnectionManager().getCodec(), commandExecutor, name);
49+
this(commandExecutor.getServiceManager().getCfg().getCodec(), commandExecutor, name);
5050
}
5151

5252
/**

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/CuckooFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 dengliming.
2+
* Copyright 2020-2024 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public CuckooFilter(Codec codec, CommandAsyncExecutor commandExecutor, String na
5252
}
5353

5454
public CuckooFilter(CommandAsyncExecutor commandExecutor, String name) {
55-
this(commandExecutor.getConnectionManager().getCodec(), commandExecutor, name);
55+
this(commandExecutor.getServiceManager().getCfg().getCodec(), commandExecutor, name);
5656
}
5757

5858
/**

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/TDigest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021-2022 dengliming.
2+
* Copyright 2021-2024 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ public TDigest(Codec codec, CommandAsyncExecutor commandExecutor, String name) {
5151
}
5252

5353
public TDigest(CommandAsyncExecutor commandExecutor, String name) {
54-
this(commandExecutor.getConnectionManager().getCodec(), commandExecutor, name);
54+
this(commandExecutor.getServiceManager().getCfg().getCodec(), commandExecutor, name);
5555
}
5656

5757
/**

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/TopKFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 dengliming.
2+
* Copyright 2020-2024 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@
4242
public class TopKFilter extends RedissonObject {
4343

4444
public TopKFilter(CommandAsyncExecutor commandExecutor, String name) {
45-
this(commandExecutor.getConnectionManager().getCodec(), commandExecutor, name);
45+
this(commandExecutor.getServiceManager().getCfg().getCodec(), commandExecutor, name);
4646
}
4747

4848
public TopKFilter(Codec codec, CommandAsyncExecutor commandExecutor, String name) {

0 commit comments

Comments
 (0)