summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/client/file_reader.cpp
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.cpp
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.cpp')
-rw-r--r--yt/cpp/mapreduce/client/file_reader.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/yt/cpp/mapreduce/client/file_reader.cpp b/yt/cpp/mapreduce/client/file_reader.cpp
index 6163dd55331..ffdd2c9ac30 100644
--- a/yt/cpp/mapreduce/client/file_reader.cpp
+++ b/yt/cpp/mapreduce/client/file_reader.cpp
@@ -50,6 +50,16 @@ TStreamReaderBase::TStreamReaderBase(
TStartTransactionOptions()))
{ }
+void TStreamReaderBase::Abort()
+{
+ Input_->Abort();
+}
+
+bool TStreamReaderBase::IsAborted() const
+{
+ return Input_->IsAborted();
+}
+
TStreamReaderBase::~TStreamReaderBase() = default;
TYPath TStreamReaderBase::Snapshot(const TYPath& path)
@@ -98,7 +108,7 @@ TFileReader::TFileReader(
Path_.Path_ = TStreamReaderBase::Snapshot(Path_.Path_);
}
-std::unique_ptr<IInputStream> TFileReader::Request(const TTransactionId& transactionId, ui64 readBytes)
+std::unique_ptr<IAbortableInputStream> TFileReader::Request(const TTransactionId& transactionId, ui64 readBytes)
{
const ui64 currentOffset = StartOffset_ + readBytes;
@@ -130,7 +140,7 @@ TBlobTableReader::TBlobTableReader(
Path_ = TStreamReaderBase::Snapshot(path);
}
-std::unique_ptr<IInputStream> TBlobTableReader::Request(const TTransactionId& transactionId, ui64 readBytes)
+std::unique_ptr<IAbortableInputStream> TBlobTableReader::Request(const TTransactionId& transactionId, ui64 readBytes)
{
const i64 currentOffset = StartOffset_ + readBytes;
const i64 startPartIndex = currentOffset / Options_.PartSize_;