2011-10-31 06:37:12 +00:00
|
|
|
#pragma once
|
2010-05-21 19:52:50 +00:00
|
|
|
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_NAME "ClickHouse"
|
|
|
|
#define DBMS_VERSION_MAJOR 1
|
|
|
|
#define DBMS_VERSION_MINOR 1
|
|
|
|
|
|
|
|
#define DBMS_DEFAULT_HOST "localhost"
|
|
|
|
#define DBMS_DEFAULT_PORT 9000
|
2017-09-29 16:58:04 +00:00
|
|
|
#define DBMS_DEFAULT_SECURE_PORT 9440
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_DEFAULT_HTTP_PORT 8123
|
|
|
|
#define DBMS_DEFAULT_CONNECT_TIMEOUT_SEC 10
|
|
|
|
#define DBMS_DEFAULT_CONNECT_TIMEOUT_WITH_FAILOVER_MS 50
|
|
|
|
#define DBMS_DEFAULT_SEND_TIMEOUT_SEC 300
|
|
|
|
#define DBMS_DEFAULT_RECEIVE_TIMEOUT_SEC 300
|
2017-04-19 18:29:50 +00:00
|
|
|
/// Timeout for synchronous request-result protocol call (like Ping or TablesStatus).
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_DEFAULT_SYNC_REQUEST_TIMEOUT_SEC 5
|
|
|
|
#define DBMS_DEFAULT_POLL_INTERVAL 10
|
2012-07-06 18:12:52 +00:00
|
|
|
|
2017-04-30 13:50:16 +00:00
|
|
|
/// The size of the I/O buffer by default.
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_DEFAULT_BUFFER_SIZE 1048576ULL
|
2015-04-12 04:39:20 +00:00
|
|
|
|
2017-04-30 13:50:16 +00:00
|
|
|
/// When writing data, a buffer of `max_compress_block_size` size is allocated for compression. When the buffer overflows or if into the buffer
|
|
|
|
/// more or equal data is written than `min_compress_block_size`, then with the next mark, the data will also compressed
|
|
|
|
/// As a result, for small columns (numbers 1-8 bytes), with index_granularity = 8192, the block size will be 64 KB.
|
|
|
|
/// And for large columns (Title - string ~100 bytes), the block size will be ~819 KB. Due to this, the compression ratio almost does not get worse.
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DEFAULT_MIN_COMPRESS_BLOCK_SIZE 65536
|
|
|
|
#define DEFAULT_MAX_COMPRESS_BLOCK_SIZE 1048576
|
2014-04-08 15:29:12 +00:00
|
|
|
|
2017-04-30 13:50:16 +00:00
|
|
|
/** Which blocks by default read the data (by number of rows).
|
2017-05-09 19:07:35 +00:00
|
|
|
* Smaller values give better cache locality, less consumption of RAM, but more overhead to process the query.
|
2014-04-29 20:22:57 +00:00
|
|
|
*/
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DEFAULT_BLOCK_SIZE 65536
|
2014-04-29 20:22:57 +00:00
|
|
|
|
2017-04-30 13:50:16 +00:00
|
|
|
/** Which blocks should be formed for insertion into the table, if we control the formation of blocks.
|
|
|
|
* (Sometimes the blocks are inserted exactly such blocks that have been read / transmitted from the outside, and this parameter does not affect their size.)
|
|
|
|
* More than DEFAULT_BLOCK_SIZE, because in some tables a block of data on the disk is created for each block (quite a big thing),
|
|
|
|
* and if the parts were small, then it would be costly then to combine them.
|
2014-04-29 20:22:57 +00:00
|
|
|
*/
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DEFAULT_INSERT_BLOCK_SIZE 1048576
|
2014-04-29 20:22:57 +00:00
|
|
|
|
2017-04-30 13:50:16 +00:00
|
|
|
/** The same, but for merge operations. Less DEFAULT_BLOCK_SIZE for saving RAM (since all the columns are read).
|
|
|
|
* Significantly less, since there are 10-way mergers.
|
2014-04-29 20:22:57 +00:00
|
|
|
*/
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DEFAULT_MERGE_BLOCK_SIZE 8192
|
|
|
|
|
|
|
|
#define DEFAULT_MAX_QUERY_SIZE 262144
|
2017-09-01 17:21:03 +00:00
|
|
|
#define SHOW_CHARS_ON_SYNTAX_ERROR ptrdiff_t(160)
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DEFAULT_MAX_DISTRIBUTED_CONNECTIONS 1024
|
|
|
|
#define DEFAULT_INTERACTIVE_DELAY 100000
|
|
|
|
#define DBMS_DEFAULT_DISTRIBUTED_CONNECTIONS_POOL_SIZE 1024
|
|
|
|
#define DBMS_CONNECTION_POOL_WITH_FAILOVER_DEFAULT_MAX_TRIES 3
|
2017-04-30 13:50:16 +00:00
|
|
|
/// each period reduces the error counter by 2 times
|
|
|
|
/// too short a period can cause errors to disappear immediately after creation.
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_CONNECTION_POOL_WITH_FAILOVER_DEFAULT_DECREASE_ERROR_PERIOD (2 * DBMS_DEFAULT_SEND_TIMEOUT_SEC)
|
|
|
|
#define DEFAULT_QUERIES_QUEUE_WAIT_TIME_MS 5000 /// Maximum waiting time in the request queue.
|
|
|
|
#define DBMS_DEFAULT_BACKGROUND_POOL_SIZE 16
|
2012-08-26 11:14:52 +00:00
|
|
|
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_MIN_REVISION_WITH_CLIENT_INFO 54032
|
|
|
|
#define DBMS_MIN_REVISION_WITH_SERVER_TIMEZONE 54058
|
|
|
|
#define DBMS_MIN_REVISION_WITH_QUOTA_KEY_IN_CLIENT_INFO 54060
|
|
|
|
#define DBMS_MIN_REVISION_WITH_TABLES_STATUS 54226
|
2017-11-05 05:32:22 +00:00
|
|
|
#define DBMS_MIN_REVISION_WITH_TIME_ZONE_PARAMETER_IN_DATETIME_DATA_TYPE 54311
|
2016-07-31 03:53:16 +00:00
|
|
|
|
|
|
|
/// Version of ClickHouse TCP protocol. Set to git tag with latest protocol change.
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_TCP_PROTOCOL_VERSION 54226
|
2014-08-15 09:50:05 +00:00
|
|
|
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DBMS_DISTRIBUTED_DIRECTORY_MONITOR_SLEEP_TIME_MS 100
|
2014-10-06 22:48:20 +00:00
|
|
|
|
2017-04-30 13:50:16 +00:00
|
|
|
/// The boundary on which the blocks for asynchronous file operations should be aligned.
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DEFAULT_AIO_FILE_BLOCK_SIZE 4096
|
2015-03-12 16:22:49 +00:00
|
|
|
|
2017-05-26 15:30:07 +00:00
|
|
|
#define DEFAULT_QUERY_LOG_FLUSH_INTERVAL_MILLISECONDS 7500
|
2015-06-26 20:48:10 +00:00
|
|
|
|
2017-05-26 15:30:07 +00:00
|
|
|
#define ALWAYS_INLINE __attribute__((__always_inline__))
|
|
|
|
#define NO_INLINE __attribute__((__noinline__))
|
2016-01-13 02:11:40 +00:00
|
|
|
|
2017-05-26 15:30:07 +00:00
|
|
|
#define PLATFORM_NOT_SUPPORTED "The only supported platforms are x86_64 and AArch64 (work in progress)"
|
2016-01-13 02:11:40 +00:00
|
|
|
|
|
|
|
#if !defined(__x86_64__) && !defined(__aarch64__)
|
2017-09-01 17:21:03 +00:00
|
|
|
// #error PLATFORM_NOT_SUPPORTED
|
2016-01-13 02:11:40 +00:00
|
|
|
#endif
|
2016-06-10 18:58:04 +00:00
|
|
|
|
2016-07-30 04:44:04 +00:00
|
|
|
/// Check for presence of address sanitizer
|
2016-06-10 18:58:04 +00:00
|
|
|
#if defined(__has_feature)
|
2017-04-01 07:20:54 +00:00
|
|
|
#if __has_feature(address_sanitizer)
|
|
|
|
#define ADDRESS_SANITIZER 1
|
|
|
|
#endif
|
2016-06-10 18:58:04 +00:00
|
|
|
#elif defined(__SANITIZE_ADDRESS__)
|
2017-04-01 07:20:54 +00:00
|
|
|
#define ADDRESS_SANITIZER 1
|
2016-06-10 18:58:04 +00:00
|
|
|
#endif
|
2016-07-30 04:44:04 +00:00
|
|
|
|
|
|
|
#if defined(__has_feature)
|
2017-04-01 07:20:54 +00:00
|
|
|
#if __has_feature(thread_sanitizer)
|
|
|
|
#define THREAD_SANITIZER 1
|
|
|
|
#endif
|
2016-07-30 04:44:04 +00:00
|
|
|
#elif defined(__SANITIZE_THREAD__)
|
2017-04-01 07:20:54 +00:00
|
|
|
#define THREAD_SANITIZER 1
|
2016-07-30 04:44:04 +00:00
|
|
|
#endif
|