diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-04-16 09:11:59 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-04-16 09:11:59 +0000 |
commit | 25de1d521ca218e2b040739fea77a39e9fc543e9 (patch) | |
tree | 21521d8866cf1462dbd52c071cf369974c29650e /library/cpp/yson/parser.cpp | |
parent | bf444b8ed4d0f6bf17fd753e2cf88f9440012e87 (diff) | |
parent | 0a63d9ddc516f206f2b8745ce5e5dfa60190d755 (diff) | |
download | ydb-25de1d521ca218e2b040739fea77a39e9fc543e9.tar.gz |
Merge branch 'rightlib' into mergelibs-240416-0910
Diffstat (limited to 'library/cpp/yson/parser.cpp')
-rw-r--r-- | library/cpp/yson/parser.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/library/cpp/yson/parser.cpp b/library/cpp/yson/parser.cpp index 783f9b9047..934a56ee21 100644 --- a/library/cpp/yson/parser.cpp +++ b/library/cpp/yson/parser.cpp @@ -16,22 +16,27 @@ namespace NYson { IInputStream* stream, EYsonType type, bool enableLinePositionInfo, + ui64 bufferSizeLimit, + bool consumeUntilEof, TMaybe<ui64> memoryLimit = Nothing()) : Consumer_(consumer) , Stream_(stream) , Type_(type) , EnableLinePositionInfo_(enableLinePositionInfo) + , BufferSizeLimit_(bufferSizeLimit) + , ConsumeUntilEof_(consumeUntilEof) , MemoryLimit_(memoryLimit) { } void Parse() { - TBuffer buffer(64 << 10); + TBuffer buffer(BufferSizeLimit_); ParseYsonStreamImpl<NYT::NYson::IYsonConsumer, TStreamReader>( TStreamReader(Stream_, buffer.Data(), buffer.Capacity()), Consumer_, Type_, EnableLinePositionInfo_, + ConsumeUntilEof_, MemoryLimit_); } @@ -40,6 +45,8 @@ namespace NYson { IInputStream* Stream_; EYsonType Type_; bool EnableLinePositionInfo_; + ui64 BufferSizeLimit_; + bool ConsumeUntilEof_; TMaybe<ui64> MemoryLimit_; }; @@ -50,8 +57,10 @@ namespace NYson { IInputStream* stream, EYsonType type, bool enableLinePositionInfo, + ui64 bufferSizeLimit, + bool consumeUntilEof, TMaybe<ui64> memoryLimit) - : Impl(new TImpl(consumer, stream, type, enableLinePositionInfo, memoryLimit)) + : Impl(new TImpl(consumer, stream, type, enableLinePositionInfo, bufferSizeLimit, consumeUntilEof, memoryLimit)) { } @@ -115,6 +124,7 @@ namespace NYson { consumer, type, enableLinePositionInfo, + true, memoryLimit); } |