All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ydb.jdbc.settings.YdbClientProperty Maven / Gradle / Ivy

There is a newer version: 2.3.5
Show newest version
package tech.ydb.jdbc.settings;

import java.time.Duration;
import java.util.Collection;
import java.util.function.BiConsumer;

import javax.annotation.Nullable;

import tech.ydb.table.TableClient;

public class YdbClientProperty extends AbstractYdbProperty {
    private static final PropertiesCollector> PROPERTIES = new PropertiesCollector<>();

    public static final YdbClientProperty KEEP_QUERY_TEXT =
            new YdbClientProperty<>(
                    "keepQueryText",
                    "Keep Query text",
                    null,
                    Boolean.class,
                    PropertyConverter.booleanValue(),
                    TableClient.Builder::keepQueryText);
    public static final YdbClientProperty SESSION_KEEP_ALIVE_TIME =
            new YdbClientProperty<>(
                    "sessionKeepAliveTime",
                    "Session keep-alive timeout",
                    null,
                    Duration.class,
                    PropertyConverter.durationValue(),
                    TableClient.Builder::sessionKeepAliveTime);
    public static final YdbClientProperty SESSION_MAX_IDLE_TIME =
            new YdbClientProperty<>(
                    "sessionMaxIdleTime",
                    "Session max idle time",
                    null,
                    Duration.class,
                    PropertyConverter.durationValue(),
                    TableClient.Builder::sessionMaxIdleTime);
    public static final YdbClientProperty SESSION_POOL_SIZE_MIN =
            new YdbClientProperty<>("sessionPoolSizeMin",
                    "Session pool min size (with with sessionPoolSizeMax)",
                    null,
                    Integer.class,
                    PropertyConverter.integerValue(),
                    (builder, value) -> {
                    });
    public static final YdbClientProperty SESSION_POOL_SIZE_MAX =
            new YdbClientProperty<>(
                    "sessionPoolSizeMax",
                    "Session pool max size (with with sessionPoolSizeMin)",
                    null,
                    Integer.class,
                    PropertyConverter.integerValue(),
                    (builder, value) -> {
                    });

    protected YdbClientProperty(String name,
                                String description,
                                @Nullable String defaultValue,
                                Class type,
                                PropertyConverter converter,
                                BiConsumer setter) {
        super(name, description, defaultValue, type, converter, setter);
        PROPERTIES.register(this);
    }

    public static Collection> properties() {
        return PROPERTIES.properties();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy