counting_raw_reader.h 741 B

12345678910111213141516171819202122232425262728293031323334
  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(
  13. const TMaybe<ui32>& rangeIndex,
  14. const TMaybe<ui64>& rowIndex,
  15. const std::exception_ptr& error) override;
  16. void ResetRetries() override;
  17. bool HasRangeIndices() const override;
  18. size_t GetReadByteCount() const;
  19. protected:
  20. size_t DoRead(void* buf, size_t len) override;
  21. private:
  22. ::TIntrusivePtr<TRawTableReader> Reader_;
  23. size_t ReadByteCount_ = 0;
  24. };
  25. } // namespace NDetail
  26. } // namespace NYT