Package glide.api.models.commands
Class FailoverOptions
- java.lang.Object
-
- glide.api.models.commands.FailoverOptions
-
public class FailoverOptions extends java.lang.ObjectOptional arguments forGlideClient.failover(FailoverOptions)andglide.api.GlideClusterClient#failover(FailoverOptions, glide.api.models.configuration.Route).- See Also:
- valkey.io for details.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FailoverOptionsabort()Creates options to abort an ongoing failover.static FailoverOptionsforced(@NonNull java.lang.String host, int port, long timeoutMs)Creates options to force a failover to a specific replica after the timeout elapses.static FailoverOptionstimeout(long timeoutMs)Creates options with only a timeout.static FailoverOptionsto(@NonNull java.lang.String host, int port)Creates options to failover to a specific replica.static FailoverOptionsto(@NonNull java.lang.String host, int port, long timeoutMs)Creates options to failover to a specific replica with a timeout.java.lang.String[]toArgs()Converts the options to command arguments.
-
-
-
Method Detail
-
abort
public static FailoverOptions abort()
Creates options to abort an ongoing failover.- Returns:
- A new
FailoverOptionswith ABORT set.
-
timeout
public static FailoverOptions timeout(long timeoutMs)
Creates options with only a timeout.- Parameters:
timeoutMs- The maximum time in milliseconds to wait before aborting the failover.- Returns:
- A new
FailoverOptionswith TIMEOUT set.
-
to
public static FailoverOptions to(@NonNull @NonNull java.lang.String host, int port)
Creates options to failover to a specific replica.- Parameters:
host- The host of the target replica.port- The port of the target replica.- Returns:
- A new
FailoverOptionstargeting the specified replica.
-
to
public static FailoverOptions to(@NonNull @NonNull java.lang.String host, int port, long timeoutMs)
Creates options to failover to a specific replica with a timeout.- Parameters:
host- The host of the target replica.port- The port of the target replica.timeoutMs- The maximum time in milliseconds to wait before aborting the failover.- Returns:
- A new
FailoverOptionstargeting the specified replica with a timeout.
-
forced
public static FailoverOptions forced(@NonNull @NonNull java.lang.String host, int port, long timeoutMs)
Creates options to force a failover to a specific replica after the timeout elapses.- Parameters:
host- The host of the target replica.port- The port of the target replica.timeoutMs- The maximum time in milliseconds to wait before forcing the failover.- Returns:
- A new
FailoverOptionswith TO, TIMEOUT, and FORCE set.
-
toArgs
public java.lang.String[] toArgs()
Converts the options to command arguments.- Returns:
- The command arguments as a string array.
-
-