Skip to content

Commit 12aa759

Browse files
committedFeb 28, 2022
Polishing #1985
Update since tags.
1 parent 3194e57 commit 12aa759

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed
 

‎src/main/java/io/lettuce/core/ShutdownArgs.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
import io.lettuce.core.protocol.CommandKeyword;
2020

2121
/**
22-
* Argument list builder for the Redis <a href="http://redis.io/commands/shutdown">SHUTDOWN</a> command. Static import the methods from
23-
* {@link Builder} and call the methods: {@code now(…)} .
22+
* Argument list builder for the Redis <a href="https://redis.io/commands/shutdown">SHUTDOWN</a> command. Static import the
23+
* methods from {@link Builder} and call the methods: {@code now(…)} .
2424
* <p>
2525
* {@link ShutdownArgs} is a mutable object and instances should be used only once to avoid shared mutable state.
2626
*
2727
* @author dengliming
28-
* @since 7.0
28+
* @since 6.2
2929
*/
3030
public class ShutdownArgs implements CompositeArgument {
3131

@@ -112,7 +112,7 @@ public ShutdownArgs now() {
112112
}
113113

114114
/**
115-
* Ignores any errors that would normally prevent the server from exiting. For details, see the following section.
115+
* Ignores any errors that would normally prevent the server from exiting.
116116
*
117117
* @return {@code this}
118118
*/
@@ -146,7 +146,7 @@ public <K, V> void build(CommandArgs<K, V> args) {
146146
args.add("NOW");
147147
}
148148
if (force) {
149-
args.add("FORCE");
149+
args.add(CommandKeyword.FORCE);
150150
}
151151
if (abort) {
152152
args.add("ABORT");

‎src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java

+1
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ public interface RedisServerAsyncCommands<K, V> {
391391
* Synchronously save the dataset to disk and then shutdown the server.
392392
*
393393
* @param args
394+
* @since 6.2
394395
*/
395396
void shutdown(ShutdownArgs args);
396397

‎src/main/java/io/lettuce/core/api/reactive/RedisServerReactiveCommands.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
import java.util.Date;
1919
import java.util.Map;
2020

21-
import io.lettuce.core.ShutdownArgs;
2221
import reactor.core.publisher.Flux;
2322
import reactor.core.publisher.Mono;
2423
import io.lettuce.core.FlushMode;
2524
import io.lettuce.core.KillArgs;
25+
import io.lettuce.core.ShutdownArgs;
2626
import io.lettuce.core.TrackingArgs;
2727
import io.lettuce.core.UnblockType;
2828
import io.lettuce.core.protocol.CommandType;
@@ -391,6 +391,7 @@ public interface RedisServerReactiveCommands<K, V> {
391391
* Synchronously save the dataset to disk and then shutdown the server.
392392
*
393393
* @param args
394+
* @since 6.2
394395
*/
395396
Mono<Void> shutdown(ShutdownArgs args);
396397

‎src/main/java/io/lettuce/core/api/sync/RedisServerCommands.java

+1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ public interface RedisServerCommands<K, V> {
390390
* Synchronously save the dataset to disk and then shutdown the server.
391391
*
392392
* @param args
393+
* @since 6.2
393394
*/
394395
void shutdown(ShutdownArgs args);
395396

‎src/main/templates/io/lettuce/core/api/RedisServerCommands.java

+1
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ public interface RedisServerCommands<K, V> {
388388
* Synchronously save the dataset to disk and then shutdown the server.
389389
*
390390
* @param args
391+
* @since 6.2
391392
*/
392393
void shutdown(ShutdownArgs args);
393394

‎src/test/java/io/lettuce/core/commands/ServerCommandIntegrationTests.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import javax.inject.Inject;
2929

30-
import io.lettuce.core.ShutdownArgs;
3130
import org.junit.jupiter.api.BeforeEach;
3231
import org.junit.jupiter.api.Disabled;
3332
import org.junit.jupiter.api.Test;
@@ -40,6 +39,7 @@
4039
import io.lettuce.core.KillArgs;
4140
import io.lettuce.core.RedisClient;
4241
import io.lettuce.core.RedisFuture;
42+
import io.lettuce.core.ShutdownArgs;
4343
import io.lettuce.core.TestSupport;
4444
import io.lettuce.core.TrackingArgs;
4545
import io.lettuce.core.UnblockType;
@@ -70,6 +70,7 @@
7070
public class ServerCommandIntegrationTests extends TestSupport {
7171

7272
private final RedisClient client;
73+
7374
private final RedisCommands<String, String> redis;
7475

7576
@Inject
@@ -518,7 +519,7 @@ void swapdb() {
518519
}
519520

520521
@Test
521-
@Disabled("Run me manually") // Redis 7.0
522+
@Disabled("Run me manually") // Redis 7.0
522523
void shutdown() {
523524
redis.shutdown(new ShutdownArgs().save(true).now());
524525
}
@@ -529,4 +530,5 @@ private boolean noSaveInProgress() {
529530

530531
return !info.contains("aof_rewrite_in_progress:1") && !info.contains("rdb_bgsave_in_progress:1");
531532
}
533+
532534
}

0 commit comments

Comments
 (0)