ClickHouse/src/Interpreters/DNSCacheUpdater.h

32 lines
555 B
C++
Raw Normal View History

2020-10-10 18:37:02 +00:00
#pragma once
#include <Core/BackgroundSchedulePool.h>
#include <Common/Stopwatch.h>
namespace DB
{
class Context;
/// Add a task to BackgroundProcessingPool that resolves all hosts and updates cache with constant period.
class DNSCacheUpdater
{
public:
explicit DNSCacheUpdater(Context & context, Int32 update_period_seconds_);
~DNSCacheUpdater();
void start();
private:
void run();
Context & context;
Int32 update_period_seconds;
BackgroundSchedulePool & pool;
BackgroundSchedulePoolTaskHolder task_handle;
};
}