aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/InternalTextLogsQueue.h
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-11-14 09:58:56 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-11-14 10:20:20 +0300
commitc2b2dfd9827a400a8495e172a56343462e3ceb82 (patch)
treecd4e4f597d01bede4c82dffeb2d780d0a9046bd0 /contrib/clickhouse/src/Interpreters/InternalTextLogsQueue.h
parentd4ae8f119e67808cb0cf776ba6e0cf95296f2df7 (diff)
downloadydb-c2b2dfd9827a400a8495e172a56343462e3ceb82.tar.gz
YQ Connector: move tests from yql to ydb (OSS)
Перенос папки с тестами на Коннектор из папки yql в папку ydb (синхронизируется с github).
Diffstat (limited to 'contrib/clickhouse/src/Interpreters/InternalTextLogsQueue.h')
-rw-r--r--contrib/clickhouse/src/Interpreters/InternalTextLogsQueue.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/contrib/clickhouse/src/Interpreters/InternalTextLogsQueue.h b/contrib/clickhouse/src/Interpreters/InternalTextLogsQueue.h
new file mode 100644
index 0000000000..bbe41ca33f
--- /dev/null
+++ b/contrib/clickhouse/src/Interpreters/InternalTextLogsQueue.h
@@ -0,0 +1,39 @@
+#pragma once
+#include <Common/ConcurrentBoundedQueue.h>
+#include <Common/OvercommitTracker.h>
+#include <Core/Block.h>
+#include <re2/re2.h>
+
+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();
+
+ 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);
+
+ 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>;
+
+}
+
+