diff options
| author | max42 <[email protected]> | 2023-06-30 11:13:34 +0300 |
|---|---|---|
| committer | max42 <[email protected]> | 2023-06-30 11:13:34 +0300 |
| commit | 3e1899838408bbad47622007aa382bc8a2b01f87 (patch) | |
| tree | 0f21c1e6add187ddb6c3ccc048a7d640ce03fb87 /yt/cpp/mapreduce/client/file_writer.cpp | |
| parent | 5463eb3f5e72a86f858a3d27c886470a724ede34 (diff) | |
Revert "YT-19324: move YT provider to ydb/library/yql"
This reverts commit ca272f12fdd0e8d5c3e957fc87939148f1caaf72, reversing
changes made to 49f8acfc8b0b5c0071b804423bcf53fda26c7c12.
Diffstat (limited to 'yt/cpp/mapreduce/client/file_writer.cpp')
| -rw-r--r-- | yt/cpp/mapreduce/client/file_writer.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/yt/cpp/mapreduce/client/file_writer.cpp b/yt/cpp/mapreduce/client/file_writer.cpp deleted file mode 100644 index daf6461edd4..00000000000 --- a/yt/cpp/mapreduce/client/file_writer.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "file_writer.h" - -#include <yt/cpp/mapreduce/io/helpers.h> -#include <yt/cpp/mapreduce/interface/finish_or_die.h> - -#include <yt/cpp/mapreduce/common/helpers.h> - -namespace NYT { - -//////////////////////////////////////////////////////////////////////////////// - -TFileWriter::TFileWriter( - const TRichYPath& path, - IClientRetryPolicyPtr clientRetryPolicy, - ITransactionPingerPtr transactionPinger, - const TClientContext& context, - const TTransactionId& transactionId, - const TFileWriterOptions& options) - : RetryfulWriter_( - std::move(clientRetryPolicy), - std::move(transactionPinger), - context, - transactionId, - GetWriteFileCommand(context.Config->ApiVersion), - TMaybe<TFormat>(), - path, - options) -{ } - -TFileWriter::~TFileWriter() -{ - NDetail::FinishOrDie(this, "TFileWriter"); -} - -void TFileWriter::DoWrite(const void* buf, size_t len) -{ - // If user tunes RetryBlockSize / DesiredChunkSize he expects - // us to send data exactly by RetryBlockSize. So behaviour of the writer is predictable. - // - // We want to avoid situation when size of sent data slightly exceeded DesiredChunkSize - // and server produced one chunk of desired size and one small chunk. - while (len > 0) { - const auto retryBlockRemainingSize = RetryfulWriter_.GetRetryBlockRemainingSize(); - Y_VERIFY(retryBlockRemainingSize > 0); - const auto firstWriteLen = Min(len, retryBlockRemainingSize); - RetryfulWriter_.Write(buf, firstWriteLen); - RetryfulWriter_.NotifyRowEnd(); - len -= firstWriteLen; - buf = static_cast<const char*>(buf) + firstWriteLen; - } -} - -void TFileWriter::DoFinish() -{ - RetryfulWriter_.Finish(); -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT |
