From c9249f77c797f34da2c90226078a758b0a0a7046 Mon Sep 17 00:00:00 2001 From: Vxider Date: Fri, 18 Sep 2020 20:58:27 +0800 Subject: [PATCH] rename persistency to persistent --- src/Storages/JoinSettings.h | 2 +- src/Storages/SetSettings.h | 2 +- src/Storages/StorageJoin.cpp | 12 +++++----- src/Storages/StorageJoin.h | 2 +- src/Storages/StorageSet.cpp | 24 +++++++++---------- src/Storages/StorageSet.h | 6 ++--- .../01493_storage_set_persistency.reference | 4 ++-- .../01493_storage_set_persistency.sql | 12 +++++----- .../01494_storage_join_persistency.reference | 4 ++-- .../01494_storage_join_persistency.sql | 12 +++++----- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/Storages/JoinSettings.h b/src/Storages/JoinSettings.h index 396185d9f77..13be557a439 100644 --- a/src/Storages/JoinSettings.h +++ b/src/Storages/JoinSettings.h @@ -10,7 +10,7 @@ class ASTStorage; #define JOIN_RELATED_SETTINGS(M) \ - M(Bool, persistency, true, "Disable setting to avoid the overhead of writing to disk for StorageJoin", 0) + M(Bool, persistent, true, "Disable setting to avoid the overhead of writing to disk for StorageJoin", 0) #define LIST_OF_JOIN_SETTINGS(M) \ JOIN_RELATED_SETTINGS(M) \ diff --git a/src/Storages/SetSettings.h b/src/Storages/SetSettings.h index 2e55e6e8ab5..c5926e409c2 100644 --- a/src/Storages/SetSettings.h +++ b/src/Storages/SetSettings.h @@ -10,7 +10,7 @@ class ASTStorage; #define SET_RELATED_SETTINGS(M) \ - M(Bool, persistency, true, "Disable setting to avoid the overhead of writing to disk for StorageSet", 0) + M(Bool, persistent, true, "Disable setting to avoid the overhead of writing to disk for StorageSet", 0) #define LIST_OF_SET_SETTINGS(M) \ SET_RELATED_SETTINGS(M) \ diff --git a/src/Storages/StorageJoin.cpp b/src/Storages/StorageJoin.cpp index 14637856439..1f8175099e4 100644 --- a/src/Storages/StorageJoin.cpp +++ b/src/Storages/StorageJoin.cpp @@ -45,8 +45,8 @@ StorageJoin::StorageJoin( const ConstraintsDescription & constraints_, bool overwrite_, const Context & context_, - bool persistency_) - : StorageSetOrJoinBase{relative_path_, table_id_, columns_, constraints_, context_, persistency_} + bool persistent_) + : StorageSetOrJoinBase{relative_path_, table_id_, columns_, constraints_, context_, persistent_} , key_names(key_names_) , use_nulls(use_nulls_) , limits(limits_) @@ -119,7 +119,7 @@ void registerStorageJoin(StorageFactory & factory) auto join_overflow_mode = settings.join_overflow_mode; auto join_any_take_last_row = settings.join_any_take_last_row; auto old_any_join = settings.any_join_distinct_right_table_keys; - bool persistency_ = true; + bool persistent_ = true; if (args.storage_def && args.storage_def->settings) { @@ -137,11 +137,11 @@ void registerStorageJoin(StorageFactory & factory) join_any_take_last_row = setting.value; else if (setting.name == "any_join_distinct_right_table_keys") old_any_join = setting.value; - else if (setting.name == "persistency") + else if (setting.name == "persistent") { auto join_settings = std::make_unique(); join_settings->loadFromQuery(*args.storage_def); - persistency_ = join_settings->persistency; + persistent_ = join_settings->persistent; } else throw Exception( @@ -226,7 +226,7 @@ void registerStorageJoin(StorageFactory & factory) args.constraints, join_any_take_last_row, args.context, - persistency_); + persistent_); }; factory.registerStorage("Join", creator_fn, StorageFactory::StorageFeatures{ .supports_settings = true, }); diff --git a/src/Storages/StorageJoin.h b/src/Storages/StorageJoin.h index 2751031ffbe..95037c4d33a 100644 --- a/src/Storages/StorageJoin.h +++ b/src/Storages/StorageJoin.h @@ -74,7 +74,7 @@ protected: const ConstraintsDescription & constraints_, bool overwrite, const Context & context_, - bool persistency_); + bool persistent_); }; } diff --git a/src/Storages/StorageSet.cpp b/src/Storages/StorageSet.cpp index 5edcc68ba77..d6d8b9e1449 100644 --- a/src/Storages/StorageSet.cpp +++ b/src/Storages/StorageSet.cpp @@ -37,7 +37,7 @@ public: SetOrJoinBlockOutputStream( StorageSetOrJoinBase & table_, const StorageMetadataPtr & metadata_snapshot_, const String & backup_path_, const String & backup_tmp_path_, - const String & backup_file_name_, bool persistency_); + const String & backup_file_name_, bool persistent_); Block getHeader() const override { return metadata_snapshot->getSampleBlock(); } void write(const Block & block) override; @@ -52,7 +52,7 @@ private: WriteBufferFromFile backup_buf; CompressedWriteBuffer compressed_backup_buf; NativeBlockOutputStream backup_stream; - bool persistency; + bool persistent; }; @@ -62,7 +62,7 @@ SetOrJoinBlockOutputStream::SetOrJoinBlockOutputStream( const String & backup_path_, const String & backup_tmp_path_, const String & backup_file_name_, - bool persistency_) + bool persistent_) : table(table_) , metadata_snapshot(metadata_snapshot_) , backup_path(backup_path_) @@ -71,7 +71,7 @@ SetOrJoinBlockOutputStream::SetOrJoinBlockOutputStream( , backup_buf(backup_tmp_path + backup_file_name) , compressed_backup_buf(backup_buf) , backup_stream(compressed_backup_buf, 0, metadata_snapshot->getSampleBlock()) - , persistency(persistency_) + , persistent(persistent_) { } @@ -81,14 +81,14 @@ void SetOrJoinBlockOutputStream::write(const Block & block) Block sorted_block = block.sortColumns(); table.insertBlock(sorted_block); - if (persistency) + if (persistent) backup_stream.write(sorted_block); } void SetOrJoinBlockOutputStream::writeSuffix() { table.finishInsert(); - if (persistency) + if (persistent) { backup_stream.flush(); compressed_backup_buf.next(); @@ -102,7 +102,7 @@ void SetOrJoinBlockOutputStream::writeSuffix() BlockOutputStreamPtr StorageSetOrJoinBase::write(const ASTPtr & /*query*/, const StorageMetadataPtr & metadata_snapshot, const Context & /*context*/) { UInt64 id = ++increment; - return std::make_shared(*this, metadata_snapshot, path, path + "tmp/", toString(id) + ".bin", persistency); + return std::make_shared(*this, metadata_snapshot, path, path + "tmp/", toString(id) + ".bin", persistent); } @@ -112,9 +112,9 @@ StorageSetOrJoinBase::StorageSetOrJoinBase( const ColumnsDescription & columns_, const ConstraintsDescription & constraints_, const Context & context_, - bool persistency_) + bool persistent_) : IStorage(table_id_), - persistency(persistency_) + persistent(persistent_) { StorageInMemoryMetadata storage_metadata; storage_metadata.setColumns(columns_); @@ -136,8 +136,8 @@ StorageSet::StorageSet( const ColumnsDescription & columns_, const ConstraintsDescription & constraints_, const Context & context_, - bool persistency_) - : StorageSetOrJoinBase{relative_path_, table_id_, columns_, constraints_, context_, persistency_}, + bool persistent_) + : StorageSetOrJoinBase{relative_path_, table_id_, columns_, constraints_, context_, persistent_}, set(std::make_shared(SizeLimits(), false, true)) { @@ -249,7 +249,7 @@ void registerStorageSet(StorageFactory & factory) set_settings->loadFromQuery(*args.storage_def); } - return StorageSet::create(args.relative_data_path, args.table_id, args.columns, args.constraints, args.context, set_settings->persistency); + return StorageSet::create(args.relative_data_path, args.table_id, args.columns, args.constraints, args.context, set_settings->persistent); }, StorageFactory::StorageFeatures{ .supports_settings = true, }); } diff --git a/src/Storages/StorageSet.h b/src/Storages/StorageSet.h index 87ad1521824..40d7925de13 100644 --- a/src/Storages/StorageSet.h +++ b/src/Storages/StorageSet.h @@ -33,11 +33,11 @@ protected: const ColumnsDescription & columns_, const ConstraintsDescription & constraints_, const Context & context_, - bool persistency_); + bool persistent_); String base_path; String path; - bool persistency; + bool persistent; std::atomic increment = 0; /// For the backup file names. @@ -86,7 +86,7 @@ protected: const ColumnsDescription & columns_, const ConstraintsDescription & constraints_, const Context & context_, - bool persistency_); + bool persistent_); }; } diff --git a/tests/queries/0_stateless/01493_storage_set_persistency.reference b/tests/queries/0_stateless/01493_storage_set_persistency.reference index 3ac4944d0d6..c721770a22a 100644 --- a/tests/queries/0_stateless/01493_storage_set_persistency.reference +++ b/tests/queries/0_stateless/01493_storage_set_persistency.reference @@ -1,5 +1,5 @@ ----- Default Settings ----- 1 ------ Settings persistency=1 ----- +----- Settings persistent=1 ----- 1 ------ Settings persistency=0 ----- +----- Settings persistent=0 ----- diff --git a/tests/queries/0_stateless/01493_storage_set_persistency.sql b/tests/queries/0_stateless/01493_storage_set_persistency.sql index 54f19a870d2..2ab5b409733 100644 --- a/tests/queries/0_stateless/01493_storage_set_persistency.sql +++ b/tests/queries/0_stateless/01493_storage_set_persistency.sql @@ -13,20 +13,20 @@ SELECT number FROM number WHERE number IN set LIMIT 1; DROP TABLE set; -SELECT '----- Settings persistency=1 -----'; -CREATE TABLE set (val UInt64) ENGINE = Set() SETTINGS persistency=1; +SELECT '----- Settings persistent=1 -----'; +CREATE TABLE set (val UInt64) ENGINE = Set() SETTINGS persistent=1; INSERT INTO set VALUES (1); DETACH TABLE set; -ATTACH TABLE set (val UInt64) ENGINE = Set() SETTINGS persistency=1; +ATTACH TABLE set (val UInt64) ENGINE = Set() SETTINGS persistent=1; SELECT number FROM number WHERE number IN set LIMIT 1; DROP TABLE set; -SELECT '----- Settings persistency=0 -----'; -CREATE TABLE set (val UInt64) ENGINE = Set() SETTINGS persistency=0; +SELECT '----- Settings persistent=0 -----'; +CREATE TABLE set (val UInt64) ENGINE = Set() SETTINGS persistent=0; INSERT INTO set VALUES (1); DETACH TABLE set; -ATTACH TABLE set (val UInt64) ENGINE = Set() SETTINGS persistency=0; +ATTACH TABLE set (val UInt64) ENGINE = Set() SETTINGS persistent=0; SELECT number FROM number WHERE number IN set LIMIT 1; DROP TABLE set; diff --git a/tests/queries/0_stateless/01494_storage_join_persistency.reference b/tests/queries/0_stateless/01494_storage_join_persistency.reference index 506f916ac8b..31ba11136ea 100644 --- a/tests/queries/0_stateless/01494_storage_join_persistency.reference +++ b/tests/queries/0_stateless/01494_storage_join_persistency.reference @@ -1,5 +1,5 @@ ----- Default Settings ----- 1 21 ------ Settings persistency=1 ----- +----- Settings persistent=1 ----- 1 21 ------ Settings persistency=0 ----- +----- Settings persistent=0 ----- diff --git a/tests/queries/0_stateless/01494_storage_join_persistency.sql b/tests/queries/0_stateless/01494_storage_join_persistency.sql index 6e1fee3430e..4ca24db943a 100644 --- a/tests/queries/0_stateless/01494_storage_join_persistency.sql +++ b/tests/queries/0_stateless/01494_storage_join_persistency.sql @@ -9,20 +9,20 @@ SELECT * from join; DROP TABLE join; -SELECT '----- Settings persistency=1 -----'; -CREATE TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistency=1; +SELECT '----- Settings persistent=1 -----'; +CREATE TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistent=1; INSERT INTO join VALUES (1,21); DETACH TABLE join; -ATTACH TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistency=1; +ATTACH TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistent=1; SELECT * from join; DROP TABLE join; -SELECT '----- Settings persistency=0 -----'; -CREATE TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistency=0; +SELECT '----- Settings persistent=0 -----'; +CREATE TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistent=0; INSERT INTO join VALUES (1,21); DETACH TABLE join; -ATTACH TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistency=0; +ATTACH TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k) SETTINGS persistent=0; SELECT * from join; DROP TABLE join;