summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/io/counting_raw_reader.cpp
blob: 05f3b1cca6bc58c5f220745664171286d8f8acc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "counting_raw_reader.h"

namespace NYT {
namespace NDetail {

////////////////////////////////////////////////////////////////////////////////

bool TCountingRawTableReader::Retry(
    const TMaybe<ui32>& rangeIndex,
    const TMaybe<ui64>& rowIndex,
    const std::exception_ptr& error)
{
    return Reader_->Retry(rangeIndex, rowIndex, error);
}

void TCountingRawTableReader::ResetRetries()
{
    Reader_->ResetRetries();
}

bool TCountingRawTableReader::HasRangeIndices() const
{
    return Reader_->HasRangeIndices();
}

size_t TCountingRawTableReader::GetReadByteCount() const
{
    return ReadByteCount_;
}

void TCountingRawTableReader::Abort()
{
    Reader_->Abort();
}

bool TCountingRawTableReader::IsAborted() const
{
    return Reader_->IsAborted();
}

size_t TCountingRawTableReader::DoRead(void* buf, size_t len)
{
    auto readLen = Reader_->Read(buf, len);
    ReadByteCount_ += readLen;
    return readLen;
}

////////////////////////////////////////////////////////////////////////////////

} // namespace NDetail
} // namespace NYT