diff options
| author | maybenotilya <[email protected]> | 2026-04-17 11:57:44 +0300 |
|---|---|---|
| committer | maybenotilya <[email protected]> | 2026-04-17 12:34:55 +0300 |
| commit | a6423bf330c10089d7a0e2aaa8d971d0dcbb3fcf (patch) | |
| tree | 087131eb0146a82cd9c72d1b0a290d8d081c021e /yt/cpp/mapreduce/client/partition_reader.cpp | |
| parent | 7bcfb91453e538211ed44e97c57d1104f543f920 (diff) | |
YT-26179: Add Abort for readers
* Changelog entry
Type: feature
Component: cpp-sdk
Add Abort for table readers
commit_hash:be5026883c90d18333f20468946f1e5a5b71839b
Diffstat (limited to 'yt/cpp/mapreduce/client/partition_reader.cpp')
| -rw-r--r-- | yt/cpp/mapreduce/client/partition_reader.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/yt/cpp/mapreduce/client/partition_reader.cpp b/yt/cpp/mapreduce/client/partition_reader.cpp index a2ca7eb9758..d849040d854 100644 --- a/yt/cpp/mapreduce/client/partition_reader.cpp +++ b/yt/cpp/mapreduce/client/partition_reader.cpp @@ -12,7 +12,7 @@ class TPartitionTableReader : public TRawTableReader { public: - TPartitionTableReader(std::unique_ptr<IInputStream> input) + TPartitionTableReader(std::unique_ptr<IAbortableInputStream> input) : Input_(std::move(input)) { } @@ -32,6 +32,16 @@ public: return false; } + void Abort() override + { + Input_->Abort(); + } + + bool IsAborted() const override + { + return Input_->IsAborted(); + } + protected: size_t DoRead(void* buf, size_t len) override { @@ -39,7 +49,7 @@ protected: } private: - std::unique_ptr<IInputStream> Input_; + std::unique_ptr<IAbortableInputStream> Input_; }; //////////////////////////////////////////////////////////////////////////////// @@ -52,7 +62,7 @@ TRawTableReaderPtr CreateTablePartitionReader( const TTablePartitionReaderOptions& options) { - auto stream = NDetail::RequestWithRetry<std::unique_ptr<IInputStream>>( + auto stream = NDetail::RequestWithRetry<std::unique_ptr<IAbortableInputStream>>( retryPolicy, [&] (TMutationId /*mutationId*/) { return rawClient->ReadTablePartition(cookie, format, options); |
