Package com.clickhouse.client.config
Enum ClickHouseClientOption
- All Implemented Interfaces:
ClickHouseOption,Serializable,Comparable<ClickHouseClientOption>,java.lang.constant.Constable
Generic client options.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWhether the client should run in async mode(e.g.Whether the client should discover more nodes from system tables and/or clickhouse-keeper/zookeeper.Number of times the buffer queue is filled up before increasing capacity of buffer queue.Default buffer size in byte for both request and response.Whether to perform health check against all nodes or just faulty ones.Client name.Whether server will compress response to client or not.Compression algorithm server will use to compress response, whenCOMPRESSistrue.Compression level for compressing server response.Connection timeout in milliseconds.Custom server settings for all queries.Custom socket factory.Additional socket factory options.Default database.Whether server will decompress request from client or not.Compression algorithm server will use to decompress request, whenDECOMPRESSistrue.Compression level for decompress client request.Maximum number of times failover can happen for a request.Default format.Health check interval in milliseconds.Health check method.Trust Store password.Key Store type.Load balancing policy.Load balancing tags for filtering out nodes.Whether to log leading comment(as log_comment in system.query_log) of the query.Maximum buffer size in byte can be used for streaming.Maximum query execution time in seconds.Maximum number of mappers can be cached.Maximum queued in-memory buffers.Maxium queued requests.Maximum rows allowed in the result.Maximum size of thread pool for each client.Node check interval in milliseconds.Node discovery interval in milliseconds.Maximum number of nodes can be discovered at a time.Maximum number of nodes can be used for operation at a time.Product name usered in user agent.Set Clickhouse proxy hostname.Set ClickHouse proxy port.Type of proxy can be used to access ClickHouse server.Read buffer size in byte.Method to rename response columns.Whether to repeat execution when session is locked, until timed out(according toSESSION_TIMEOUTorCONNECTION_TIMEOUT).Request buffering mode.Maximum request chunk size in byte.Response buffering mode.Maximum number of times retry can happen for a request.Whether to reuse wrapper of value(e.g.Server revision.Server timezone.Server version.Whether to check if session id is validate.Session id.Session timeout in seconds.Type-of-service(TOS) or traffic class field in the IP header for a socket.Whether to enable keep-alive packets for a socket connection.Seconds to wait while data is being transmitted before closing the socket.Size of the socket receive buffer in bytes.Whether allows for the reuse of local addresses and ports.Size of the socket send buffer in bytes.Socket timeout in milliseconds.Whether to enable SSL for the connection.SSL certificiate.SSL key.SSL mode.SSL root certificiate.Transaction timeout in seconds.Trust Store.Whether to support binary string.Whether to use blocking queue for buffering.Whether to use compilation(generated byte code) in object mapping and serialization.Whether Object[] should be used instead of primitive arrays.Whether to use server time zone.Whether to use time zone from server for Date.Custom time zone.Whether to convert unsigned types to the next widest type(e.g.Write buffer size in byte. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClient host name.static final StringClient JVM information in format of<jvm name>/<jvm version>.static final StringClient O/S information in format of<o/s name>/<o/s version>.static final StringClient user name.static final StringRevision(shortened git commit hash) of the product.static final StringSemantic version of the product. -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringbuildUserAgent(String productName, String additionalProperty) Builds user-agent based on given product name.static ClickHouseClientOptionGets client option by key.getKey()static StringgetSystemConfig(String propertyName, String defaultValue) Gets system property and fall back to the given value as needed.Class<? extends Serializable>booleanstatic ClickHouseClientOptionReturns the enum constant of this type with the specified name.static ClickHouseClientOption[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface com.clickhouse.config.ClickHouseOption
getDefaultValueFromEnvVar, getDefaultValueFromSysProp, getEffectiveDefaultValue, getEffectiveValue, getEnvironmentVariable, getPrefix, getSystemProperty, name
-
Enum Constant Details
-
ASYNC
Whether the client should run in async mode(e.g.ClickHouseClient.execute(com.clickhouse.client.ClickHouseRequest)in a separate thread). -
AUTO_DISCOVERY
Whether the client should discover more nodes from system tables and/or clickhouse-keeper/zookeeper. -
CUSTOM_SETTINGS
Custom server settings for all queries. -
CUSTOM_SOCKET_FACTORY
Custom socket factory. -
CUSTOM_SOCKET_FACTORY_OPTIONS
Additional socket factory options. Only useful only whenCUSTOM_SOCKET_FACTORYis set. -
LOAD_BALANCING_POLICY
Load balancing policy. -
LOAD_BALANCING_TAGS
Load balancing tags for filtering out nodes. -
HEALTH_CHECK_INTERVAL
Health check interval in milliseconds. -
HEALTH_CHECK_METHOD
Health check method. -
NODE_DISCOVERY_INTERVAL
Node discovery interval in milliseconds. -
NODE_DISCOVERY_LIMIT
Maximum number of nodes can be discovered at a time. -
NODE_CHECK_INTERVAL
Node check interval in milliseconds. -
NODE_GROUP_SIZE
Maximum number of nodes can be used for operation at a time. -
CHECK_ALL_NODES
Whether to perform health check against all nodes or just faulty ones. -
BUFFER_SIZE
Default buffer size in byte for both request and response. It will be reset toMAX_BUFFER_SIZEif it's too large. -
BUFFER_QUEUE_VARIATION
Number of times the buffer queue is filled up before increasing capacity of buffer queue. Zero or negative value means the queue length is fixed. -
READ_BUFFER_SIZE
Read buffer size in byte. It's mainly for input stream(e.g. reading data from server response). Its value defaults toBUFFER_SIZE, and it will be reset toMAX_BUFFER_SIZEwhen it's too large. -
WRITE_BUFFER_SIZE
Write buffer size in byte. It's mainly for output stream(e.g. writing data into request). Its value defaults toBUFFER_SIZE, and it will be reset toMAX_BUFFER_SIZEwhen it's too large. -
REQUEST_CHUNK_SIZE
Maximum request chunk size in byte. -
REQUEST_BUFFERING
Request buffering mode. -
RESPONSE_BUFFERING
Response buffering mode. -
CLIENT_NAME
Client name. -
COMPRESS
Whether server will compress response to client or not. -
DECOMPRESS
Whether server will decompress request from client or not. -
COMPRESS_ALGORITHM
Compression algorithm server will use to compress response, whenCOMPRESSistrue. -
DECOMPRESS_ALGORITHM
Compression algorithm server will use to decompress request, whenDECOMPRESSistrue. -
COMPRESS_LEVEL
Compression level for compressing server response. -
DECOMPRESS_LEVEL
Compression level for decompress client request. -
CONNECTION_TIMEOUT
Connection timeout in milliseconds. -
DATABASE
Default database. -
FAILOVER
Maximum number of times failover can happen for a request. -
FORMAT
Default format. -
LOG_LEADING_COMMENT
Whether to log leading comment(as log_comment in system.query_log) of the query. -
MAX_BUFFER_SIZE
Maximum buffer size in byte can be used for streaming. It's not supposed to be larger thanInteger.MAX_VALUE - 8. -
MAX_MAPPER_CACHE
Maximum number of mappers can be cached. -
MAX_EXECUTION_TIME
Maximum query execution time in seconds. -
MAX_QUEUED_BUFFERS
Maximum queued in-memory buffers. -
MAX_QUEUED_REQUESTS
Maxium queued requests. WhenMAX_THREADS_PER_CLIENTis greater than zero, this will also be applied to client's thread pool as well. -
MAX_RESULT_ROWS
Maximum rows allowed in the result. -
MAX_THREADS_PER_CLIENT
Maximum size of thread pool for each client. -
PRODUCT_NAME
Product name usered in user agent. -
RENAME_RESPONSE_COLUMN
Method to rename response columns. -
RETRY
Maximum number of times retry can happen for a request. -
REPEAT_ON_SESSION_LOCK
Whether to repeat execution when session is locked, until timed out(according toSESSION_TIMEOUTorCONNECTION_TIMEOUT). -
REUSE_VALUE_WRAPPER
Whether to reuse wrapper of value(e.g. ClickHouseValue or ClickHouseRecord) for memory efficiency. -
SERVER_REVISION
Server revision. -
SERVER_TIME_ZONE
Server timezone. -
SERVER_VERSION
Server version. -
SESSION_ID
Session id. -
SESSION_CHECK
Whether to check if session id is validate. -
SESSION_TIMEOUT
Session timeout in seconds. -
SOCKET_TIMEOUT
Socket timeout in milliseconds. -
SOCKET_REUSEADDR
Whether allows for the reuse of local addresses and ports. SeeStandardSocketOptions.SO_REUSEADDR. -
SOCKET_KEEPALIVE
Whether to enable keep-alive packets for a socket connection. SeeStandardSocketOptions.SO_KEEPALIVE. -
SOCKET_LINGER
Seconds to wait while data is being transmitted before closing the socket. Use negative number to disable the option. SeeStandardSocketOptions.SO_LINGER. -
SOCKET_IP_TOS
Type-of-service(TOS) or traffic class field in the IP header for a socket. SeeStandardSocketOptions.IP_TOS. -
SOCKET_TCP_NODELAY
-
SOCKET_RCVBUF
Size of the socket receive buffer in bytes. SeeStandardSocketOptions.SO_RCVBUF. -
SOCKET_SNDBUF
Size of the socket send buffer in bytes. SeeStandardSocketOptions.SO_SNDBUF. -
SSL
Whether to enable SSL for the connection. -
SSL_MODE
SSL mode. -
SSL_ROOT_CERTIFICATE
SSL root certificiate. -
SSL_CERTIFICATE
SSL certificiate. -
SSL_KEY
SSL key. -
KEY_STORE_TYPE
Key Store type. -
TRUST_STORE
Trust Store. -
KEY_STORE_PASSWORD
Trust Store password. -
TRANSACTION_TIMEOUT
Transaction timeout in seconds. -
WIDEN_UNSIGNED_TYPES
Whether to convert unsigned types to the next widest type(e.g. useshortfor UInt8 instead ofbyte, andUnsignedLongfor UInt64). -
USE_BINARY_STRING
Whether to support binary string. Enable this option to treatFixedStringandStringas byte array. -
USE_BLOCKING_QUEUE
Whether to use blocking queue for buffering. -
USE_COMPILATION
Whether to use compilation(generated byte code) in object mapping and serialization. -
USE_OBJECTS_IN_ARRAYS
Whether Object[] should be used instead of primitive arrays. -
PROXY_TYPE
Type of proxy can be used to access ClickHouse server. To use an HTTP/SOCKS proxy, you must specify thePROXY_HOSTandPROXY_PORT. -
PROXY_HOST
Set Clickhouse proxy hostname. -
PROXY_PORT
Set ClickHouse proxy port. -
USE_SERVER_TIME_ZONE
Whether to use server time zone. -
USE_SERVER_TIME_ZONE_FOR_DATES
Whether to use time zone from server for Date. -
USE_TIME_ZONE
Custom time zone. Only works whenuse_server_time_zoneis set to false.
-
-
Field Details
-
PRODUCT_VERSION
Semantic version of the product. -
PRODUCT_REVISION
Revision(shortened git commit hash) of the product. -
CLIENT_OS_INFO
Client O/S information in format of<o/s name>/<o/s version>. -
CLIENT_JVM_INFO
Client JVM information in format of<jvm name>/<jvm version>. -
CLIENT_USER
Client user name. -
CLIENT_HOST
Client host name.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
buildUserAgent
Builds user-agent based on given product name. The user-agent will be something look like<product name>/<product version> (<o/s name>/<o/s version>; <jvm name>/<jvm version>[; <additionalProperty>]; rv:<product revision>).- Parameters:
productName- product name, null or blank string is treated asClickHouse Java ClientadditionalProperty- additional property if any- Returns:
- non-empty user-agent
-
getSystemConfig
Gets system property and fall back to the given value as needed.- Parameters:
propertyName- non-null property namedefaultValue- default value, only useful if it's not null- Returns:
- property value
-
fromKey
Gets client option by key.- Parameters:
key- key of the option- Returns:
- client option object, or null if not found
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceClickHouseOption
-
getDescription
- Specified by:
getDescriptionin interfaceClickHouseOption
-
getKey
- Specified by:
getKeyin interfaceClickHouseOption
-
getValueType
- Specified by:
getValueTypein interfaceClickHouseOption
-
isSensitive
public boolean isSensitive()- Specified by:
isSensitivein interfaceClickHouseOption
-