Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the same defaults for session pool config as in the sdk #93

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
@Builder
public class YdbConfig {
private static final Duration SESSION_KEEP_ALIVE_TIME_DEFAULT = Duration.ofMinutes(5);
private static final Duration SESSION_MAX_IDLE_TIME_DEFAULT = Duration.ofMinutes(5);
private static final Duration SESSION_MAX_IDLE_TIME_DEFAULT = Duration.ofMinutes(1);
private static final Duration TCP_KEEP_ALIVE_TIME_DEFAULT = Duration.ofSeconds(5);
private static final Duration TCP_KEEP_ALIVE_TIMEOUT_DEFAULT = Duration.ofSeconds(1);
private static final Duration SESSION_CREATE_TIMEOUT_DEFAULT = Duration.ofSeconds(1);
private static final int SESSION_POOL_SIZE_DEFAULT = 100;
private static final int SESSION_POOL_SIZE_MAX_DEFAULT = 50;
private static final int SESSION_POOL_SIZE_MIN_DEFAULT = 10;
private static final int SESSION_CREATE_RETRY_COUNT_DEFAULT = 3;

public static YdbConfig createForTesting(String host, int port, String tablespace, String database) {
Expand All @@ -30,8 +31,8 @@ public static YdbConfig createForTesting(String host, int port, String tablespac
SESSION_CREATE_RETRY_COUNT_DEFAULT,
SESSION_KEEP_ALIVE_TIME_DEFAULT,
SESSION_MAX_IDLE_TIME_DEFAULT,
SESSION_POOL_SIZE_DEFAULT,
SESSION_POOL_SIZE_DEFAULT,
SESSION_POOL_SIZE_MIN_DEFAULT,
SESSION_POOL_SIZE_MAX_DEFAULT,
TCP_KEEP_ALIVE_TIME_DEFAULT,
TCP_KEEP_ALIVE_TIMEOUT_DEFAULT,
false,
Expand Down Expand Up @@ -118,11 +119,11 @@ public Duration getSessionMaxIdleTime() {
}

public Integer getSessionPoolMin() {
return Optional.ofNullable(sessionPoolMin).orElse(SESSION_POOL_SIZE_DEFAULT);
return Optional.ofNullable(sessionPoolMin).orElse(SESSION_POOL_SIZE_MIN_DEFAULT);
}

public Integer getSessionPoolMax() {
return Optional.ofNullable(sessionPoolMax).orElse(SESSION_POOL_SIZE_DEFAULT);
return Optional.ofNullable(sessionPoolMax).orElse(SESSION_POOL_SIZE_MAX_DEFAULT);
}

public Duration getTcpKeepaliveTime() {
Expand Down