Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
* @author Andrey Shlykov
* @author dengliming
* @author ihaohong
* @author Dennis Neufeld
*/
public class DefaultStringRedisConnection implements StringRedisConnection, DecoratedRedisConnection {

Expand Down Expand Up @@ -401,6 +402,15 @@ public void flushAll() {
delegate.flushAll();
}

/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisServerCommands#flushAll(org.springframework.data.redis.connection.RedisServerCommands.FlushOption)
*/
@Override
public void flushAll(FlushOption option) {
delegate.flushAll(option);
}

/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisServerCommands#flushDb()
Expand All @@ -410,6 +420,15 @@ public void flushDb() {
delegate.flushDb();
}

/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisServerCommands#flushDb(org.springframework.data.redis.connection.RedisServerCommands.FlushOption)
*/
@Override
public void flushDb(FlushOption option) {
delegate.flushDb(option);
}

/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisStringCommands#get(byte[])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/**
* @author Christoph Strobl
* @author Mark Paluch
* @author Dennis Neufeld
* @since 2.0
*/
public interface DefaultedRedisClusterConnection extends RedisClusterConnection, DefaultedRedisConnection {
Expand Down Expand Up @@ -73,13 +74,27 @@ default void flushDb(RedisClusterNode node) {
serverCommands().flushDb(node);
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
default void flushDb(RedisClusterNode node, FlushOption option) {
serverCommands().flushDb(node, option);
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
default void flushAll(RedisClusterNode node) {
serverCommands().flushAll(node);
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
default void flushAll(RedisClusterNode node, FlushOption option) {
serverCommands().flushAll(node, option);
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
* @author Andrey Shlykov
* @author dengliming
* @author ihaohong
* @author Dennis Neufeld
* @since 2.0
*/
public interface DefaultedRedisConnection extends RedisConnection {
Expand Down Expand Up @@ -1632,13 +1633,27 @@ default void flushDb() {
serverCommands().flushDb();
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
default void flushDb(FlushOption option) {
serverCommands().flushDb(option);
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
default void flushAll() {
serverCommands().flushAll();
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
default void flushAll(FlushOption option) {
serverCommands().flushAll(option);
}

/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
@Override
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@

import java.util.Properties;

import org.springframework.data.redis.connection.RedisServerCommands.FlushOption;
import org.springframework.data.redis.core.types.RedisClientInfo;

/**
* Redis Server commands executed in cluster environment using reactive infrastructure.
*
* @author Mark Paluch
* @author Christoph Strobl
* @author Dennis Neufeld
* @since 2.0
*/
public interface ReactiveClusterServerCommands extends ReactiveServerCommands {
Expand Down Expand Up @@ -91,6 +93,17 @@ public interface ReactiveClusterServerCommands extends ReactiveServerCommands {
*/
Mono<String> flushDb(RedisClusterNode node);

/**
* Delete all keys of the currently selected database using the specified flush option.
*
* @param node must not be {@literal null}. {@link Mono} indicating command completion.
* @param option
* @throws IllegalArgumentException when {@code node} is {@literal null}.
* @see RedisServerCommands#flushDb(FlushOption)
* @since 2.6
*/
Mono<String> flushDb(RedisClusterNode node, FlushOption option);

/**
* Delete all <b>all keys</b> from <b>all databases</b>.
*
Expand All @@ -101,6 +114,18 @@ public interface ReactiveClusterServerCommands extends ReactiveServerCommands {
*/
Mono<String> flushAll(RedisClusterNode node);

/**
* Delete all <b>all keys</b> from <b>all databases</b> using the specified flush option.
*
* @param node must not be {@literal null}.
* @param option
* @return {@link Mono} indicating command completion.
* @throws IllegalArgumentException when {@code node} is {@literal null}.
* @see RedisServerCommands#flushAll(FlushOption)
* @since 2.6
*/
Mono<String> flushAll(RedisClusterNode node, FlushOption option);

/**
* Load {@literal default} server information like
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import org.springframework.data.redis.connection.RedisServerCommands.FlushOption;
import org.springframework.data.redis.core.types.RedisClientInfo;

/**
* Redis Server commands executed using reactive infrastructure.
*
* @author Mark Paluch
* @author Christoph Strobl
* @author Dennis Neufeld
* @since 2.0
*/
public interface ReactiveServerCommands {
Expand Down Expand Up @@ -81,6 +83,16 @@ public interface ReactiveServerCommands {
*/
Mono<String> flushDb();

/**
* Delete all keys of the currently selected database using the specified flush option.
*
* @param option
* @return {@link Mono} indicating command completion.
* @see <a href="https://redis.io/commands/flushdb">Redis Documentation: FLUSHDB</a>
* @since 2.6
*/
Mono<String> flushDb(FlushOption option);

/**
* Delete all <b>all keys</b> from <b>all databases</b>.
*
Expand All @@ -89,6 +101,16 @@ public interface ReactiveServerCommands {
*/
Mono<String> flushAll();

/**
* Delete all <b>all keys</b> from <b>all databases</b> using the specified flush option.
*
* @param option
* @return {@link Mono} indicating command completion.
* @see <a href="https://redis.io/commands/flushall">Redis Documentation: FLUSHALL</a>
* @since 2.6
*/
Mono<String> flushAll(FlushOption option);

/**
* Load {@literal default} server information like
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* @author Mark Paluch
* @author Dennis Neufeld
* @since 2.0
*/
public interface RedisClusterServerCommands extends RedisServerCommands {
Expand Down Expand Up @@ -65,12 +66,28 @@ public interface RedisClusterServerCommands extends RedisServerCommands {
*/
void flushDb(RedisClusterNode node);

/**
* @param node must not be {@literal null}.
* @param option
* @see RedisServerCommands#flushDb(FlushOption)
* @since 2.6
*/
void flushDb(RedisClusterNode node, FlushOption option);

/**
* @param node must not be {@literal null}.
* @see RedisServerCommands#flushAll()
*/
void flushAll(RedisClusterNode node);

/**
* @param node must not be {@literal null}.
* @param option
* @see RedisServerCommands#flushAll(FlushOption)
* @since 2.6
*/
void flushAll(RedisClusterNode node, FlushOption option);

/**
* @param node must not be {@literal null}.
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* @author Christoph Strobl
* @author Thomas Darimont
* @author Mark Paluch
* @author Dennis Neufeld
*/
public interface RedisServerCommands {

Expand All @@ -43,6 +44,13 @@ enum MigrateOption {
COPY, REPLACE
}

/**
* @since 2.6
*/
enum FlushOption {
SYNC, ASYNC
}

/**
* Start an {@literal Append Only File} rewrite process on server.
*
Expand Down Expand Up @@ -101,13 +109,31 @@ default void bgWriteAof() {
*/
void flushDb();

/**
* Delete all keys of the currently selected database using the specified flush option.
*
* @param option
* @see <a href="https://redis.io/commands/flushdb">Redis Documentation: FLUSHDB</a>
* @since 2.6
*/
void flushDb(FlushOption option);

/**
* Delete all <b>all keys</b> from <b>all databases</b>.
*
* @see <a href="https://redis.io/commands/flushall">Redis Documentation: FLUSHALL</a>
*/
void flushAll();

/**
* Delete all <b>all keys</b> from <b>all databases</b> using the specified flush option.
*
* @param option
* @see <a href="https://redis.io/commands/flushall">Redis Documentation: FLUSHALL</a>
* @since 2.6
*/
void flushAll(FlushOption option);

/**
* Load {@literal default} server information like
* <ul>
Expand Down
Loading