aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhatsername <whatsername@yandex-team.com>2023-11-20 23:08:43 +0300
committerwhatsername <whatsername@yandex-team.com>2023-11-21 00:38:32 +0300
commita4dca696db802127945391cef62a30b91201a2af (patch)
tree5ead7c505137f7351f0cf6d1d58812cf134a65b2
parenta3fd9aa6b812dc5e1eb456b2cfc101417ade4040 (diff)
downloadydb-a4dca696db802127945391cef62a30b91201a2af.tar.gz
Fix ussues for SingleTableJobWriter
-rw-r--r--yt/cpp/mapreduce/io/job_writer.cpp15
-rw-r--r--yt/cpp/mapreduce/io/job_writer.h13
2 files changed, 13 insertions, 15 deletions
diff --git a/yt/cpp/mapreduce/io/job_writer.cpp b/yt/cpp/mapreduce/io/job_writer.cpp
index f98a538e19..21b5ef6b91 100644
--- a/yt/cpp/mapreduce/io/job_writer.cpp
+++ b/yt/cpp/mapreduce/io/job_writer.cpp
@@ -14,12 +14,9 @@ TJobWriterStream::TJobWriterStream(int fd)
{ }
TJobWriterStream::TJobWriterStream(const TFile& file)
- : FdFile(file)
- , FdOutput(FdFile)
- , BufferedOutput(&FdOutput, BufferSize)
-{ }
-
-TJobWriterStream::~TJobWriterStream()
+ : FDFile(file)
+ , FDOutput(FDFile)
+ , BufferedOutput(&FDOutput, BufferSize)
{ }
////////////////////////////////////////////////////////////////////////////////
@@ -31,14 +28,14 @@ TJobWriterStream::~TJobWriterStream()
TJobWriter::TJobWriter(size_t outputTableCount)
{
for (size_t i = 0; i < outputTableCount; ++i) {
- Streams_.emplace_back(MakeHolder<NDetail::TJobWriterStream>(int(i * 3 + 1)));
+ Streams_.emplace_back(std::make_unique<NDetail::TJobWriterStream>(static_cast<int>(i * 3 + 1)));
}
}
TJobWriter::TJobWriter(const TVector<TFile>& fileList)
{
for (const auto& f : fileList) {
- Streams_.emplace_back(MakeHolder<NDetail::TJobWriterStream>(f));
+ Streams_.emplace_back(std::make_unique<NDetail::TJobWriterStream>(f));
}
}
@@ -76,7 +73,7 @@ THolder<IProxyOutput> CreateRawJobWriter(size_t outputTableCount)
TSingleStreamJobWriter::TSingleStreamJobWriter(size_t tableIndex)
: TableIndex_(tableIndex)
- , Stream_(MakeHolder<NDetail::TJobWriterStream>(int(tableIndex * 3 + 1)))
+ , Stream_(std::make_unique<NDetail::TJobWriterStream>(static_cast<int>(tableIndex * 3 + 1)))
{ }
size_t TSingleStreamJobWriter::GetStreamCount() const
diff --git a/yt/cpp/mapreduce/io/job_writer.h b/yt/cpp/mapreduce/io/job_writer.h
index fb962d9449..9c298ae5fe 100644
--- a/yt/cpp/mapreduce/io/job_writer.h
+++ b/yt/cpp/mapreduce/io/job_writer.h
@@ -15,16 +15,17 @@ namespace NDetail {
////////////////////////////////////////////////////////////////////////////////
-class TJobWriterStream {
+class TJobWriterStream
+{
public:
explicit TJobWriterStream(int fd);
explicit TJobWriterStream(const TFile& file);
- ~TJobWriterStream();
+ ~TJobWriterStream() = default;
public:
static constexpr size_t BufferSize = 1 << 20;
- TFile FdFile;
- TUnbufferedFileOutput FdOutput;
+ TFile FDFile;
+ TUnbufferedFileOutput FDOutput;
TBufferedOutput BufferedOutput;
};
@@ -47,7 +48,7 @@ public:
void OnRowFinished(size_t tableIndex) override;
private:
- TVector<THolder<NDetail::TJobWriterStream>> Streams_;
+ TVector<std::unique_ptr<NDetail::TJobWriterStream>> Streams_;
};
////////////////////////////////////////////////////////////////////////////////
@@ -65,7 +66,7 @@ public:
private:
const size_t TableIndex_;
- THolder<NDetail::TJobWriterStream> Stream_;
+ std::unique_ptr<NDetail::TJobWriterStream> Stream_;
};
////////////////////////////////////////////////////////////////////////////////