Class EtcdUtil

java.lang.Object
com.illumon.iris.db.util.EtcdUtil

public class EtcdUtil
extends Object
  • Constructor Details

    • EtcdUtil

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

    • 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
    • waitFor

      public <EXCEPTION_TYPE extends Exception,​ RETURN_TYPE> RETURN_TYPE waitFor​(CompletableFuture<RETURN_TYPE> future, Class<EXCEPTION_TYPE> clazz) throws EXCEPTION_TYPE extends Exception
      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
      EXCEPTION_TYPE extends Exception