counting_raw_reader.h 683 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <yt/cpp/mapreduce/interface/io.h>
  3. namespace NYT {
  4. namespace NDetail {
  5. class TCountingRawTableReader
  6. final : public TRawTableReader
  7. {
  8. public:
  9. TCountingRawTableReader(::TIntrusivePtr<TRawTableReader> reader)
  10. : Reader_(std::move(reader))
  11. { }
  12. bool Retry(const TMaybe<ui32>& rangeIndex, const TMaybe<ui64>& rowIndex) override;
  13. void ResetRetries() override;
  14. bool HasRangeIndices() const override;
  15. size_t GetReadByteCount() const;
  16. protected:
  17. size_t DoRead(void* buf, size_t len) override;
  18. private:
  19. ::TIntrusivePtr<TRawTableReader> Reader_;
  20. size_t ReadByteCount_ = 0;
  21. };
  22. } // namespace NDetail
  23. } // namespace NYT