Class EtcdUtil

java.lang.Object
io.deephaven.kv.etcd.EtcdUtil

public class EtcdUtil extends Object
  • Field Details

    • LEASE_TTL_SECONDS_DEFAULT

      public static final int LEASE_TTL_SECONDS_DEFAULT
      See Also:
    • LEASE_RENEW_SECONDS_DEFAULT

      public static final int LEASE_RENEW_SECONDS_DEFAULT
      See Also:
    • LEASE_RENEW_RETRY_DELAY_SECONDS_DEFAULT

      public static final int LEASE_RENEW_RETRY_DELAY_SECONDS_DEFAULT
      See Also:
  • Constructor Details

    • EtcdUtil

      public EtcdUtil(com.fishlib.configuration.Configuration configuration)
  • Method Details

    • isRetryable

      public static boolean isRetryable(Exception e)
    • executeFuture

      public static <RESPONSE> RESPONSE executeFuture(Supplier<CompletableFuture<RESPONSE>> op, long deadlineTimeMillis, com.fishlib.io.logger.Logger log, Function<com.fishlib.io.log.LogEntry,com.fishlib.io.log.LogEntry> contextAppender)
    • appendTimeoutInfo

      public static com.fishlib.io.log.LogEntry appendTimeoutInfo(com.fishlib.io.log.LogEntry entry, long startMillis, long nowMillis)
    • appendDeltaTime

      public static com.fishlib.io.log.LogEntry appendDeltaTime(com.fishlib.io.log.LogEntry entry, long startMillis, long endMillis)
    • appendDeltaTime

      public static com.fishlib.io.log.LogEntry appendDeltaTime(com.fishlib.io.log.LogEntry entry, long deltaMillis)
    • watchTimeoutMs

      public long watchTimeoutMs()
      Get the configured timeout when waiting for an update via watcher, in milliseconds
      Returns:
      watchTimeoutMs
    • getRecreateWatchTimeoutMs

      public long getRecreateWatchTimeoutMs()
      Get the configured timeout when recreating a failed watcher, in milliseconds
      Returns:
      recreateWatchTimeoutMs
    • getRecreateWatchPauseMs

      public long getRecreateWatchPauseMs()
      Get the configured time to pause between attempts to recreate a watcher, in milliseconds
      Returns:
      recreateWatchPauseMs
    • getLeaseTtlSeconds

      public int getLeaseTtlSeconds()
      Get the configured time to live value in seconds for etcd lease
      Returns:
      time to live value in seconds for etcd lease
    • getLeaseRenewSeconds

      public int getLeaseRenewSeconds()
      Get the configured lease renew time in seconds
      Returns:
      etcd lease renew time in seconds
    • getLeaseRenewRetryDelaySeconds

      public int getLeaseRenewRetryDelaySeconds()
      Get the configured lease renew retry delay time in seconds
      Returns:
      etcd lease renew retry delay time in seconds
    • waitFor

      public <EXCEPTION_TYPE extends Exception, RETURN_TYPE> RETURN_TYPE waitFor(CompletableFuture<RETURN_TYPE> future, Class<EXCEPTION_TYPE> clazz) throws EXCEPTION_TYPE
      Wait for the future for the configured timeout. Convert failures in the future to the given exception type.
      Parameters:
      future - wait for this future
      Returns:
      the result of the future
      Throws:
      EXCEPTION_TYPE - if the future does not complete
      RuntimeException - if the correct exception type can't be constructed