aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/eventlog/iterator.h
diff options
context:
space:
mode:
authorqrort <qrort@yandex-team.com>2022-11-30 23:47:12 +0300
committerqrort <qrort@yandex-team.com>2022-11-30 23:47:12 +0300
commit22f8ae0e3f5d68b92aecccdf96c1d841a0334311 (patch)
treebffa27765faf54126ad44bcafa89fadecb7a73d7 /library/cpp/eventlog/iterator.h
parent332b99e2173f0425444abb759eebcb2fafaa9209 (diff)
downloadydb-22f8ae0e3f5d68b92aecccdf96c1d841a0334311.tar.gz
validate canons without yatest_common
Diffstat (limited to 'library/cpp/eventlog/iterator.h')
-rw-r--r--library/cpp/eventlog/iterator.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/library/cpp/eventlog/iterator.h b/library/cpp/eventlog/iterator.h
new file mode 100644
index 00000000000..71a61ed5494
--- /dev/null
+++ b/library/cpp/eventlog/iterator.h
@@ -0,0 +1,51 @@
+#pragma once
+
+#include <util/stream/input.h>
+#include <util/generic/ptr.h>
+#include <util/generic/string.h>
+#include <util/generic/iterator.h>
+
+#include "eventlog.h"
+#include "logparser.h"
+
+namespace NEventLog {
+ struct TOptions {
+ inline TOptions& SetFileName(const TString& fileName) {
+ FileName = fileName;
+
+ return *this;
+ }
+
+ inline TOptions& SetForceStrongOrdering(bool v) {
+ if(!ForceLosslessStrongOrdering) {
+ ForceStrongOrdering = v;
+ }
+
+ return *this;
+ }
+
+ ui64 StartTime = MIN_START_TIME;
+ ui64 EndTime = MAX_END_TIME;
+ ui64 MaxRequestDuration = MAX_REQUEST_DURATION;
+ TString FileName;
+ bool ForceStrongOrdering = false;
+ bool ForceWeakOrdering = false;
+ bool EnableEvents = true;
+ TString EvList;
+ bool ForceStreamMode = false;
+ bool ForceLosslessStrongOrdering = false;
+ bool TailFMode = false;
+ IInputStream* Input = &Cin;
+ IFrameFilterRef FrameFilter;
+ };
+
+ class IIterator: public TInputRangeAdaptor<IIterator> {
+ public:
+ virtual ~IIterator();
+
+ virtual TConstEventPtr Next() = 0;
+ };
+
+ THolder<IIterator> CreateIterator(const TOptions& o);
+ THolder<IIterator> CreateIterator(const TOptions& o, IEventFactory* fac);
+}