ClickHouse/dbms/src/Dictionaries/HTTPDictionarySource.h

63 lines
1.5 KiB
C++
Raw Normal View History

2016-11-15 19:51:06 +00:00
#pragma once
#include <Dictionaries/IDictionarySource.h>
#include <Dictionaries/DictionaryStructure.h>
#include <common/LocalDateTime.h>
#include <IO/ConnectionTimeouts.h>
namespace Poco { class Logger; }
2016-11-15 19:51:06 +00:00
namespace DB
{
/// Allows loading dictionaries from http[s] source
2016-11-15 19:51:06 +00:00
class HTTPDictionarySource final : public IDictionarySource
{
public:
HTTPDictionarySource(const DictionaryStructure & dict_struct_,
const Poco::Util::AbstractConfiguration & config,
const std::string & config_prefix,
Block & sample_block,
const Context & context);
2016-11-15 19:51:06 +00:00
HTTPDictionarySource(const HTTPDictionarySource & other);
2016-11-15 19:51:06 +00:00
BlockInputStreamPtr loadAll() override;
2016-11-15 19:51:06 +00:00
BlockInputStreamPtr loadIds(const std::vector<UInt64> & ids) override;
2016-11-15 19:51:06 +00:00
BlockInputStreamPtr loadKeys(
ColumnConst unification (#1011) * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * Fixed error in ColumnArray::replicateGeneric [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150].
2017-07-21 06:35:58 +00:00
const Columns & key_columns, const std::vector<size_t> & requested_rows) override;
2016-11-15 19:51:06 +00:00
bool isModified() const override;
2016-11-15 19:51:06 +00:00
bool supportsSelectiveLoad() const override;
2016-11-15 19:51:06 +00:00
bool hasUpdateField() const override;
DictionarySourcePtr clone() const override;
2016-11-15 19:51:06 +00:00
std::string toString() const override;
2016-11-15 19:51:06 +00:00
void setDate();
2016-11-15 19:51:06 +00:00
private:
Poco::Logger * log;
2016-11-15 19:51:06 +00:00
LocalDateTime getLastModification() const;
2016-11-15 19:51:06 +00:00
std::chrono::time_point<std::chrono::system_clock> update_time;
const DictionaryStructure dict_struct;
const std::string url;
std::string url_update;
const std::string update_field;
std::string date;
const std::string format;
Block sample_block;
const Context & context;
ConnectionTimeouts timeouts;
2016-11-15 19:51:06 +00:00
};
}