From 8f573d73080d899a3a02bed2c16ae431409f1044 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 24 Nov 2016 01:44:53 +0300 Subject: [PATCH] clean --- .../DB/Dictionaries/ExecutableDictionarySource.h | 3 +-- .../DB/Dictionaries/HTTPDictionarySource.h | 1 - .../Dictionaries/ExecutableDictionarySource.cpp | 16 +++++++--------- dbms/src/Dictionaries/HTTPDictionarySource.cpp | 4 +--- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/dbms/include/DB/Dictionaries/ExecutableDictionarySource.h b/dbms/include/DB/Dictionaries/ExecutableDictionarySource.h index b9ca99aabb0..7e764dff596 100644 --- a/dbms/include/DB/Dictionaries/ExecutableDictionarySource.h +++ b/dbms/include/DB/Dictionaries/ExecutableDictionarySource.h @@ -40,9 +40,8 @@ private: Logger * log = &Logger::get("ExecutableDictionarySource"); const DictionaryStructure dict_struct; - const std::string name; + const std::string path; const std::string format; - const bool selective; Block sample_block; const Context & context; }; diff --git a/dbms/include/DB/Dictionaries/HTTPDictionarySource.h b/dbms/include/DB/Dictionaries/HTTPDictionarySource.h index 397f7a022d3..3fc9be2bbb2 100644 --- a/dbms/include/DB/Dictionaries/HTTPDictionarySource.h +++ b/dbms/include/DB/Dictionaries/HTTPDictionarySource.h @@ -47,7 +47,6 @@ private: const std::string path; //const std::string method; const std::string format; - const bool selective; Block sample_block; const Context & context; diff --git a/dbms/src/Dictionaries/ExecutableDictionarySource.cpp b/dbms/src/Dictionaries/ExecutableDictionarySource.cpp index cc353820d99..2809411733b 100644 --- a/dbms/src/Dictionaries/ExecutableDictionarySource.cpp +++ b/dbms/src/Dictionaries/ExecutableDictionarySource.cpp @@ -14,9 +14,8 @@ ExecutableDictionarySource::ExecutableDictionarySource(const DictionaryStructure const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix, Block & sample_block, const Context & context) : dict_struct{dict_struct_}, - name{config.getString(config_prefix + ".name")}, + path{config.getString(config_prefix + ".path")}, format{config.getString(config_prefix + ".format")}, - selective{!config.getString(config_prefix + ".selective", "").empty()}, // todo! how to correct? sample_block{sample_block}, context(context) { @@ -24,9 +23,8 @@ ExecutableDictionarySource::ExecutableDictionarySource(const DictionaryStructure ExecutableDictionarySource::ExecutableDictionarySource(const ExecutableDictionarySource & other) : dict_struct{other.dict_struct}, - name{other.name}, + path{other.path}, format{other.format}, - selective{other.selective}, sample_block{other.sample_block}, context(other.context) { @@ -35,7 +33,7 @@ ExecutableDictionarySource::ExecutableDictionarySource(const ExecutableDictionar BlockInputStreamPtr ExecutableDictionarySource::loadAll() { LOG_TRACE(log, "loadAll " + toString()); - auto process = ShellCommand::execute(name); + auto process = ShellCommand::execute(path); auto stream = context.getInputFormat(format, process->out, sample_block, max_block_size); return std::make_shared>(stream, std::move(process)); } @@ -43,7 +41,7 @@ BlockInputStreamPtr ExecutableDictionarySource::loadAll() BlockInputStreamPtr ExecutableDictionarySource::loadIds(const std::vector & ids) { LOG_TRACE(log, "loadIds " + toString()); - auto process = ShellCommand::execute(name); + auto process = ShellCommand::execute(path); { ColumnWithTypeAndName column; @@ -77,7 +75,7 @@ BlockInputStreamPtr ExecutableDictionarySource::loadKeys( const ConstColumnPlainPtrs & key_columns, const std::vector & requested_rows) { LOG_TRACE(log, "loadKeys " + toString()); - auto process = ShellCommand::execute(name); + auto process = ShellCommand::execute(path); { Block block; @@ -119,7 +117,7 @@ bool ExecutableDictionarySource::isModified() const bool ExecutableDictionarySource::supportsSelectiveLoad() const { - return selective; + return true; } DictionarySourcePtr ExecutableDictionarySource::clone() const @@ -129,7 +127,7 @@ DictionarySourcePtr ExecutableDictionarySource::clone() const std::string ExecutableDictionarySource::toString() const { - return "Executable: " + name; + return "Executable: " + path; } } diff --git a/dbms/src/Dictionaries/HTTPDictionarySource.cpp b/dbms/src/Dictionaries/HTTPDictionarySource.cpp index cf7d0aed4a5..7e432e76913 100644 --- a/dbms/src/Dictionaries/HTTPDictionarySource.cpp +++ b/dbms/src/Dictionaries/HTTPDictionarySource.cpp @@ -22,7 +22,6 @@ HTTPDictionarySource::HTTPDictionarySource(const DictionaryStructure & dict_stru path{config.getString(config_prefix + ".path", "")}, //method{config.getString(config_prefix + ".method", "")}, format{config.getString(config_prefix + ".format")}, - selective{!config.getString(config_prefix + ".selective", "").empty()}, // todo! how to correct? sample_block{sample_block}, context(context) { @@ -34,7 +33,6 @@ HTTPDictionarySource::HTTPDictionarySource(const HTTPDictionarySource & other) : port{other.port}, path{other.path}, format{other.format}, - selective{other.selective}, sample_block{other.sample_block}, context(other.context) { @@ -125,7 +123,7 @@ bool HTTPDictionarySource::isModified() const bool HTTPDictionarySource::supportsSelectiveLoad() const { - return selective; + return true; } DictionarySourcePtr HTTPDictionarySource::clone() const