Class FailoverOptions


  • public class FailoverOptions
    extends java.lang.Object
    Optional arguments for GlideClient.failover(FailoverOptions) and glide.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 FailoverOptions abort()
      Creates options to abort an ongoing failover.
      static FailoverOptions forced​(@NonNull java.lang.String host, int port, long timeoutMs)
      Creates options to force a failover to a specific replica after the timeout elapses.
      static FailoverOptions timeout​(long timeoutMs)
      Creates options with only a timeout.
      static FailoverOptions to​(@NonNull java.lang.String host, int port)
      Creates options to failover to a specific replica.
      static FailoverOptions to​(@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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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 FailoverOptions with 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 FailoverOptions targeting 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 FailoverOptions targeting 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 FailoverOptions with 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.