Skip to content

Commit

Permalink
Polishing #1985
Browse files Browse the repository at this point in the history
Update since tags.
  • Loading branch information
mp911de committed Feb 28, 2022
1 parent 3194e57 commit 12aa759
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/java/io/lettuce/core/ShutdownArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import io.lettuce.core.protocol.CommandKeyword;

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

Expand Down Expand Up @@ -112,7 +112,7 @@ public ShutdownArgs now() {
}

/**
* Ignores any errors that would normally prevent the server from exiting. For details, see the following section.
* Ignores any errors that would normally prevent the server from exiting.
*
* @return {@code this}
*/
Expand Down Expand Up @@ -146,7 +146,7 @@ public <K, V> void build(CommandArgs<K, V> args) {
args.add("NOW");
}
if (force) {
args.add("FORCE");
args.add(CommandKeyword.FORCE);
}
if (abort) {
args.add("ABORT");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ public interface RedisServerAsyncCommands<K, V> {
* Synchronously save the dataset to disk and then shutdown the server.
*
* @param args
* @since 6.2
*/
void shutdown(ShutdownArgs args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import java.util.Date;
import java.util.Map;

import io.lettuce.core.ShutdownArgs;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import io.lettuce.core.FlushMode;
import io.lettuce.core.KillArgs;
import io.lettuce.core.ShutdownArgs;
import io.lettuce.core.TrackingArgs;
import io.lettuce.core.UnblockType;
import io.lettuce.core.protocol.CommandType;
Expand Down Expand Up @@ -391,6 +391,7 @@ public interface RedisServerReactiveCommands<K, V> {
* Synchronously save the dataset to disk and then shutdown the server.
*
* @param args
* @since 6.2
*/
Mono<Void> shutdown(ShutdownArgs args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ public interface RedisServerCommands<K, V> {
* Synchronously save the dataset to disk and then shutdown the server.
*
* @param args
* @since 6.2
*/
void shutdown(ShutdownArgs args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ public interface RedisServerCommands<K, V> {
* Synchronously save the dataset to disk and then shutdown the server.
*
* @param args
* @since 6.2
*/
void shutdown(ShutdownArgs args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import javax.inject.Inject;

import io.lettuce.core.ShutdownArgs;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
Expand All @@ -40,6 +39,7 @@
import io.lettuce.core.KillArgs;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisFuture;
import io.lettuce.core.ShutdownArgs;
import io.lettuce.core.TestSupport;
import io.lettuce.core.TrackingArgs;
import io.lettuce.core.UnblockType;
Expand Down Expand Up @@ -70,6 +70,7 @@
public class ServerCommandIntegrationTests extends TestSupport {

private final RedisClient client;

private final RedisCommands<String, String> redis;

@Inject
Expand Down Expand Up @@ -518,7 +519,7 @@ void swapdb() {
}

@Test
@Disabled("Run me manually") // Redis 7.0
@Disabled("Run me manually") // Redis 7.0
void shutdown() {
redis.shutdown(new ShutdownArgs().save(true).now());
}
Expand All @@ -529,4 +530,5 @@ private boolean noSaveInProgress() {

return !info.contains("aof_rewrite_in_progress:1") && !info.contains("rdb_bgsave_in_progress:1");
}

}

0 comments on commit 12aa759

Please sign in to comment.