Rename macro APPLY_FOR_SETTINGS => LIST_OF_SETTINGS.

This commit is contained in:
Vitaly Baranov 2019-04-29 00:03:19 +03:00
parent 5beaf33a9f
commit 28d9a80072
7 changed files with 14 additions and 14 deletions

View File

@ -17,7 +17,7 @@ namespace ErrorCodes
} }
IMPLEMENT_SETTINGS_COLLECTION(Settings, APPLY_FOR_SETTINGS) IMPLEMENT_SETTINGS_COLLECTION(Settings, LIST_OF_SETTINGS)
/** Set the settings from the profile (in the server configuration, many settings can be listed in one profile). /** Set the settings from the profile (in the server configuration, many settings can be listed in one profile).

View File

@ -42,7 +42,7 @@ struct Settings : public SettingsCollection<Settings>
* but we are not going to do it, because settings is used everywhere as static struct fields. * but we are not going to do it, because settings is used everywhere as static struct fields.
*/ */
#define APPLY_FOR_SETTINGS(M) \ #define LIST_OF_SETTINGS(M) \
M(SettingUInt64, min_compress_block_size, 65536, "The actual size of the block to compress, if the uncompressed data less than max_compress_block_size is no less than this value and no less than the volume of data for one mark.") \ M(SettingUInt64, min_compress_block_size, 65536, "The actual size of the block to compress, if the uncompressed data less than max_compress_block_size is no less than this value and no less than the volume of data for one mark.") \
M(SettingUInt64, max_compress_block_size, 1048576, "The maximum size of blocks of uncompressed data before compressing for writing to a table.") \ M(SettingUInt64, max_compress_block_size, 1048576, "The maximum size of blocks of uncompressed data before compressing for writing to a table.") \
M(SettingUInt64, max_block_size, DEFAULT_BLOCK_SIZE, "Maximum block size for reading") \ M(SettingUInt64, max_block_size, DEFAULT_BLOCK_SIZE, "Maximum block size for reading") \
@ -324,7 +324,7 @@ struct Settings : public SettingsCollection<Settings>
\ \
M(SettingUInt64, max_partitions_per_insert_block, 100, "Limit maximum number of partitions in single INSERTed block. Zero means unlimited. Throw exception if the block contains too many partitions. This setting is a safety threshold, because using large number of partitions is a common misconception.") \ M(SettingUInt64, max_partitions_per_insert_block, 100, "Limit maximum number of partitions in single INSERTed block. Zero means unlimited. Throw exception if the block contains too many partitions. This setting is a safety threshold, because using large number of partitions is a common misconception.") \
DECLARE_SETTINGS_COLLECTION(APPLY_FOR_SETTINGS) DECLARE_SETTINGS_COLLECTION(LIST_OF_SETTINGS)
/** Set multiple settings from "profile" (in server configuration file (users.xml), profiles contain groups of multiple settings). /** Set multiple settings from "profile" (in server configuration file (users.xml), profiles contain groups of multiple settings).
* The profile can also be set using the `set` functions, like the profile setting. * The profile can also be set using the `set` functions, like the profile setting.

View File

@ -605,20 +605,20 @@ public:
} }
}; };
#define DECLARE_SETTINGS_COLLECTION(APPLY_MACRO) \ #define DECLARE_SETTINGS_COLLECTION(LIST_OF_SETTINGS_MACRO) \
APPLY_MACRO(DECLARE_SETTINGS_COLLECTION_DECLARE_VARIABLES_HELPER_) LIST_OF_SETTINGS_MACRO(DECLARE_SETTINGS_COLLECTION_DECLARE_VARIABLES_HELPER_)
#define IMPLEMENT_SETTINGS_COLLECTION(DERIVED_CLASS_NAME, APPLY_MACRO) \ #define IMPLEMENT_SETTINGS_COLLECTION(DERIVED_CLASS_NAME, LIST_OF_SETTINGS_MACRO) \
template<> \ template<> \
SettingsCollection<DERIVED_CLASS_NAME>::MemberInfos::MemberInfos() \ SettingsCollection<DERIVED_CLASS_NAME>::MemberInfos::MemberInfos() \
{ \ { \
using Derived = DERIVED_CLASS_NAME; \ using Derived = DERIVED_CLASS_NAME; \
struct Functions \ struct Functions \
{ \ { \
APPLY_MACRO(IMPLEMENT_SETTINGS_COLLECTION_DEFINE_FUNCTIONS_HELPER_) \ LIST_OF_SETTINGS_MACRO(IMPLEMENT_SETTINGS_COLLECTION_DEFINE_FUNCTIONS_HELPER_) \
}; \ }; \
APPLY_MACRO(IMPLEMENT_SETTINGS_COLLECTION_ADD_MEMBER_INFO_HELPER_) \ LIST_OF_SETTINGS_MACRO(IMPLEMENT_SETTINGS_COLLECTION_ADD_MEMBER_INFO_HELPER_) \
} }

View File

@ -14,7 +14,7 @@ namespace ErrorCodes
extern const int UNKNOWN_SETTING; extern const int UNKNOWN_SETTING;
} }
IMPLEMENT_SETTINGS_COLLECTION(KafkaSettings, APPLY_FOR_KAFKA_SETTINGS) IMPLEMENT_SETTINGS_COLLECTION(KafkaSettings, LIST_OF_KAFKA_SETTINGS)
void KafkaSettings::loadFromQuery(ASTStorage & storage_def) void KafkaSettings::loadFromQuery(ASTStorage & storage_def)
{ {

View File

@ -14,7 +14,7 @@ class ASTStorage;
struct KafkaSettings : public SettingsCollection<KafkaSettings> struct KafkaSettings : public SettingsCollection<KafkaSettings>
{ {
#define APPLY_FOR_KAFKA_SETTINGS(M) \ #define LIST_OF_KAFKA_SETTINGS(M) \
M(SettingString, kafka_broker_list, "", "A comma-separated list of brokers for Kafka engine.") \ M(SettingString, kafka_broker_list, "", "A comma-separated list of brokers for Kafka engine.") \
M(SettingString, kafka_topic_list, "", "A list of Kafka topics.") \ M(SettingString, kafka_topic_list, "", "A list of Kafka topics.") \
M(SettingString, kafka_group_name, "", "A group of Kafka consumers.") \ M(SettingString, kafka_group_name, "", "A group of Kafka consumers.") \
@ -25,7 +25,7 @@ struct KafkaSettings : public SettingsCollection<KafkaSettings>
M(SettingUInt64, kafka_max_block_size, 0, "The maximum block size per table for Kafka engine.") \ M(SettingUInt64, kafka_max_block_size, 0, "The maximum block size per table for Kafka engine.") \
M(SettingUInt64, kafka_skip_broken_messages, 0, "Skip at least this number of broken messages from Kafka topic per block") M(SettingUInt64, kafka_skip_broken_messages, 0, "Skip at least this number of broken messages from Kafka topic per block")
DECLARE_SETTINGS_COLLECTION(APPLY_FOR_KAFKA_SETTINGS) DECLARE_SETTINGS_COLLECTION(LIST_OF_KAFKA_SETTINGS)
void loadFromQuery(ASTStorage & storage_def); void loadFromQuery(ASTStorage & storage_def);
}; };

View File

@ -16,7 +16,7 @@ namespace ErrorCodes
extern const int UNKNOWN_SETTING; extern const int UNKNOWN_SETTING;
} }
IMPLEMENT_SETTINGS_COLLECTION(MergeTreeSettings, APPLY_FOR_MERGE_TREE_SETTINGS) IMPLEMENT_SETTINGS_COLLECTION(MergeTreeSettings, LIST_OF_MERGE_TREE_SETTINGS)
void MergeTreeSettings::loadFromConfig(const String & config_elem, const Poco::Util::AbstractConfiguration & config) void MergeTreeSettings::loadFromConfig(const String & config_elem, const Poco::Util::AbstractConfiguration & config)
{ {

View File

@ -24,7 +24,7 @@ class ASTStorage;
struct MergeTreeSettings : public SettingsCollection<MergeTreeSettings> struct MergeTreeSettings : public SettingsCollection<MergeTreeSettings>
{ {
#define APPLY_FOR_MERGE_TREE_SETTINGS(M) \ #define LIST_OF_MERGE_TREE_SETTINGS(M) \
M(SettingUInt64, index_granularity, 8192, "How many rows correspond to one primary key value.") \ M(SettingUInt64, index_granularity, 8192, "How many rows correspond to one primary key value.") \
\ \
/** Merge settings. */ \ /** Merge settings. */ \
@ -79,7 +79,7 @@ struct MergeTreeSettings : public SettingsCollection<MergeTreeSettings>
M(SettingUInt64, index_granularity_bytes, 0, "Approximate amount of bytes in single granule (0 - disabled).") \ M(SettingUInt64, index_granularity_bytes, 0, "Approximate amount of bytes in single granule (0 - disabled).") \
M(SettingInt64, merge_with_ttl_timeout, 3600 * 24, "Minimal time in seconds, when merge with TTL can be repeated.") M(SettingInt64, merge_with_ttl_timeout, 3600 * 24, "Minimal time in seconds, when merge with TTL can be repeated.")
DECLARE_SETTINGS_COLLECTION(APPLY_FOR_MERGE_TREE_SETTINGS) DECLARE_SETTINGS_COLLECTION(LIST_OF_MERGE_TREE_SETTINGS)
/// Settings that should not change after the creation of a table. /// Settings that should not change after the creation of a table.
#define APPLY_FOR_IMMUTABLE_MERGE_TREE_SETTINGS(M) \ #define APPLY_FOR_IMMUTABLE_MERGE_TREE_SETTINGS(M) \