com.yandex.ydb.table.utils.RequestSettingsUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
JDBC client implementation over Table client, single jar
package com.yandex.ydb.table.utils;
import java.time.Duration;
import java.util.Optional;
import com.yandex.ydb.table.settings.RequestSettings;
public class RequestSettingsUtils {
public static long calculateDeadlineAfter(RequestSettings> settings) {
Optional clientTimeout = settings.getTimeout();
if (clientTimeout.isPresent()) {
if (clientTimeout.get().equals(Duration.ZERO)) {
return 0;
}
return System.nanoTime() + clientTimeout.get().toNanos();
}
return settings.getDeadlineAfter();
}
}