Package io.deephaven.kv.etcd
Class EtcdUtil
java.lang.Object
io.deephaven.kv.etcd.EtcdUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fishlib.io.log.LogEntryappendDeltaTime(com.fishlib.io.log.LogEntry entry, long deltaMillis) static com.fishlib.io.log.LogEntryappendDeltaTime(com.fishlib.io.log.LogEntry entry, long startMillis, long endMillis) static com.fishlib.io.log.LogEntryappendTimeoutInfo(com.fishlib.io.log.LogEntry entry, long startMillis, long nowMillis) static <RESPONSE> RESPONSEexecuteFuture(Supplier<CompletableFuture<RESPONSE>> op, long deadlineTimeMillis, com.fishlib.io.logger.Logger log, Function<com.fishlib.io.log.LogEntry, com.fishlib.io.log.LogEntry> contextAppender) intGet the configured lease renew retry delay time in secondsintGet the configured lease renew time in secondsintGet the configured time to live value in seconds for etcd leaselongGet the configured time to pause between attempts to recreate a watcher, in millisecondslongGet the configured timeout when recreating a failed watcher, in millisecondsstatic boolean<EXCEPTION_TYPE extends Exception,RETURN_TYPE>
RETURN_TYPEwaitFor(CompletableFuture<RETURN_TYPE> future, Class<EXCEPTION_TYPE> clazz) Wait for the future for the configured timeout.longGet the configured timeout when waiting for an update via watcher, in milliseconds
-
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
-
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 completeRuntimeException- if the correct exception type can't be constructed
-