Dictonary: executable: rename 'path' to 'command' [#METR-23466]

This commit is contained in:
proller 2016-12-14 00:28:31 +03:00
parent 5d98f4a280
commit 357d995e75
4 changed files with 9 additions and 9 deletions

View File

@ -40,7 +40,7 @@ private:
Logger * log = &Logger::get("ExecutableDictionarySource");
const DictionaryStructure dict_struct;
const std::string path;
const std::string command;
const std::string format;
Block sample_block;
const Context & context;

View File

@ -17,7 +17,7 @@ ExecutableDictionarySource::ExecutableDictionarySource(const DictionaryStructure
const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix,
Block & sample_block, const Context & context) :
dict_struct{dict_struct_},
path{config.getString(config_prefix + ".path")},
command{config.getString(config_prefix + ".command")},
format{config.getString(config_prefix + ".format")},
sample_block{sample_block},
context(context)
@ -26,7 +26,7 @@ ExecutableDictionarySource::ExecutableDictionarySource(const DictionaryStructure
ExecutableDictionarySource::ExecutableDictionarySource(const ExecutableDictionarySource & other) :
dict_struct{other.dict_struct},
path{other.path},
command{other.command},
format{other.format},
sample_block{other.sample_block},
context(other.context)
@ -36,7 +36,7 @@ ExecutableDictionarySource::ExecutableDictionarySource(const ExecutableDictionar
BlockInputStreamPtr ExecutableDictionarySource::loadAll()
{
LOG_TRACE(log, "loadAll " + toString());
auto process = ShellCommand::execute(path);
auto process = ShellCommand::execute(command);
auto stream = context.getInputFormat(format, process->out, sample_block, max_block_size);
return std::make_shared<OwningBlockInputStream<ShellCommand>>(stream, std::move(process));
}
@ -89,7 +89,7 @@ void columnsToBuffer(const Context & context, const std::string & format, Block
BlockInputStreamPtr ExecutableDictionarySource::loadIds(const std::vector<UInt64> & ids)
{
LOG_TRACE(log, "loadIds " + toString() + " ids=" + std::to_string(ids.size()));
auto process = ShellCommand::execute(path);
auto process = ShellCommand::execute(command);
idsToBuffer(context, format, sample_block, process->in, ids);
process->in.close();
@ -107,7 +107,7 @@ BlockInputStreamPtr ExecutableDictionarySource::loadKeys(
const ConstColumnPlainPtrs & key_columns, const std::vector<std::size_t> & requested_rows)
{
LOG_TRACE(log, "loadKeys " + toString() + " rows=" + std::to_string(requested_rows.size()));
auto process = ShellCommand::execute(path);
auto process = ShellCommand::execute(command);
columnsToBuffer(context, format, sample_block, process->in, dict_struct, key_columns, requested_rows);
process->in.close();
@ -139,7 +139,7 @@ DictionarySourcePtr ExecutableDictionarySource::clone() const
std::string ExecutableDictionarySource::toString() const
{
return "Executable: " + path;
return "Executable: " + command;
}
}

View File

@ -6462,7 +6462,7 @@ The dictionary config file has the following format:
&lt;!-- or the source is a executable. If layout.complex_key_cache - list of needed keys will be written in STDIN of program -->
&lt;executable>
&lt;!-- Path on the local file system or name located in one of env PATH dirs. -->
&lt;path>cat /opt/dictionaries/os.tsv&lt;/path>
&lt;command>cat /opt/dictionaries/os.tsv&lt;/command>
&lt;!-- Which format to use for reading/writing stream. -->
&lt;format>TabSeparated&lt;/format>
&lt;/executable>

View File

@ -6590,7 +6590,7 @@ regions_names_*.txt: TabSeparated (без заголовка), столбцы:
&lt;!-- или источник - исполняемый файл. Если layout.cache - список нужных ключей будет записан в поток STDIN программы -->
&lt;executable>
&lt;!-- Путь или имя программы (если директория есть в переменной окружения PATH) и параметры -->
&lt;path>cat /opt/dictionaries/os.tsv&lt;/path>
&lt;command>cat /opt/dictionaries/os.tsv&lt;/command>
&lt;!-- С помощью какого формата понимать вывод и формировать список ключей. -->
&lt;format>TabSeparated&lt;/format>
&lt;/executable>