ClickHouse/src/Interpreters/InternalTextLogsQueue.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include <Common/ConcurrentBoundedQueue.h>
#include <Common/OvercommitTracker.h>
#include <Core/Block.h>
2023-09-14 16:12:29 +00:00
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
2022-07-13 08:15:37 +00:00
#include <re2/re2.h>
2023-09-14 16:12:29 +00:00
#ifdef __clang__
# pragma clang diagnostic pop
#endif
namespace DB
{
class InternalTextLogsQueue : public ConcurrentBoundedQueue<MutableColumns>
{
public:
/// You should not push logs in the queue if their priority greater max_priority
int max_priority;
InternalTextLogsQueue();
2022-07-13 08:15:37 +00:00
bool isNeeded(int priority, const String & source) const;
static Block getSampleBlock();
static MutableColumns getSampleColumns();
/// Is used to pass block from remote server to the client
void pushBlock(Block && log_block);
/// Converts priority from Poco::Message::Priority to a string
static std::string_view getPriorityName(int priority);
2022-07-13 08:15:37 +00:00
void setSourceRegexp(const String & regexp);
private:
/// If not null, you should only push logs which are matched with this regexp
std::unique_ptr<re2::RE2> source_regexp;
};
using InternalTextLogsQueuePtr = std::shared_ptr<InternalTextLogsQueue>;
}