aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralxmopo3ov <alxmopo3ov@yandex-team.com>2023-10-31 11:22:58 +0300
committeralxmopo3ov <alxmopo3ov@yandex-team.com>2023-10-31 11:44:01 +0300
commitce06b3e2729000a3846a1adb4e01f598dcc1e1be (patch)
tree1a92661903b15b49c7d5958d911e601b2eb99a71
parentc8ff7ebda0d07423e32bec31790d8b74c0beb570 (diff)
downloadydb-ce06b3e2729000a3846a1adb4e01f598dcc1e1be.tar.gz
add acquire buffer size to parallel file writer
test with acquire ram buffers Add test on write with acquiring hard limit on file writer Implement acquire ram buffers setting for parallel file writer
-rw-r--r--yt/cpp/mapreduce/client/file_writer.cpp5
-rw-r--r--yt/cpp/mapreduce/client/file_writer.h1
-rw-r--r--yt/cpp/mapreduce/interface/io.h8
3 files changed, 13 insertions, 1 deletions
diff --git a/yt/cpp/mapreduce/client/file_writer.cpp b/yt/cpp/mapreduce/client/file_writer.cpp
index 6e6553b88c..5a9b9a1f58 100644
--- a/yt/cpp/mapreduce/client/file_writer.cpp
+++ b/yt/cpp/mapreduce/client/file_writer.cpp
@@ -55,6 +55,11 @@ void TFileWriter::DoFinish()
RetryfulWriter_.Finish();
}
+size_t TFileWriter::GetBufferMemoryUsage() const
+{
+ return RetryfulWriter_.GetBufferMemoryUsage();
+}
+
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT
diff --git a/yt/cpp/mapreduce/client/file_writer.h b/yt/cpp/mapreduce/client/file_writer.h
index f3b97b904e..259f778ea7 100644
--- a/yt/cpp/mapreduce/client/file_writer.h
+++ b/yt/cpp/mapreduce/client/file_writer.h
@@ -27,6 +27,7 @@ public:
protected:
void DoWrite(const void* buf, size_t len) override;
void DoFinish() override;
+ size_t GetBufferMemoryUsage() const override;
private:
TRetryfulWriter RetryfulWriter_;
diff --git a/yt/cpp/mapreduce/interface/io.h b/yt/cpp/mapreduce/interface/io.h
index b601cf9a33..9a2f2bf344 100644
--- a/yt/cpp/mapreduce/interface/io.h
+++ b/yt/cpp/mapreduce/interface/io.h
@@ -113,7 +113,13 @@ class IFileReader
class IFileWriter
: public TThrRefBase
, public IOutputStream
-{ };
+{
+public:
+ virtual size_t GetBufferMemoryUsage() const
+ {
+ return 0;
+ }
+};
////////////////////////////////////////////////////////////////////////////////