summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/client/file_reader.h
diff options
context:
space:
mode:
authormaybenotilya <[email protected]>2026-04-17 11:57:44 +0300
committermaybenotilya <[email protected]>2026-04-17 12:34:55 +0300
commita6423bf330c10089d7a0e2aaa8d971d0dcbb3fcf (patch)
tree087131eb0146a82cd9c72d1b0a290d8d081c021e /yt/cpp/mapreduce/client/file_reader.h
parent7bcfb91453e538211ed44e97c57d1104f543f920 (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/file_reader.h')
-rw-r--r--yt/cpp/mapreduce/client/file_reader.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/yt/cpp/mapreduce/client/file_reader.h b/yt/cpp/mapreduce/client/file_reader.h
index d3efe90f26a..6c7bcc8935e 100644
--- a/yt/cpp/mapreduce/client/file_reader.h
+++ b/yt/cpp/mapreduce/client/file_reader.h
@@ -2,13 +2,12 @@
#include <yt/cpp/mapreduce/common/fwd.h>
+#include <yt/cpp/mapreduce/interface/abortable_stream.h>
#include <yt/cpp/mapreduce/interface/io.h>
#include <yt/cpp/mapreduce/http/context.h>
#include <yt/cpp/mapreduce/http/requests.h>
-class IInputStream;
-
namespace NYT {
class TPingableTransaction;
@@ -27,6 +26,9 @@ public:
const TClientContext& context,
const TTransactionId& transactionId);
+ void Abort() override;
+ bool IsAborted() const override;
+
~TStreamReaderBase();
protected:
@@ -37,13 +39,13 @@ protected:
private:
size_t DoRead(void* buf, size_t len) override;
- virtual std::unique_ptr<IInputStream> Request(const TTransactionId& transactionId, ui64 readBytes) = 0;
+ virtual std::unique_ptr<IAbortableInputStream> Request(const TTransactionId& transactionId, ui64 readBytes) = 0;
private:
const IClientRetryPolicyPtr ClientRetryPolicy_;
TFileReaderOptions FileReaderOptions_;
- std::unique_ptr<IInputStream> Input_;
+ std::unique_ptr<IAbortableInputStream> Input_;
std::unique_ptr<TPingableTransaction> ReadTransaction_;
@@ -66,7 +68,7 @@ public:
const TFileReaderOptions& options = {});
private:
- std::unique_ptr<IInputStream> Request(const TTransactionId& transactionId, ui64 readBytes) override;
+ std::unique_ptr<IAbortableInputStream> Request(const TTransactionId& transactionId, ui64 readBytes) override;
private:
const ui64 StartOffset_;
@@ -93,7 +95,7 @@ public:
const TBlobTableReaderOptions& options = {});
private:
- std::unique_ptr<IInputStream> Request(const TTransactionId& transactionId, ui64 readBytes) override;
+ std::unique_ptr<IAbortableInputStream> Request(const TTransactionId& transactionId, ui64 readBytes) override;
private:
const ui64 StartOffset_;