#pragma once #include #include #include #include #include #include namespace NYT { class TPingableTransaction; //////////////////////////////////////////////////////////////////////////////// class TClientReader : public TRawTableReader { public: TClientReader( const TRichYPath& path, IClientRetryPolicyPtr clientRetryPolicy, ITransactionPingerPtr transactionPinger, const TClientContext& context, const TTransactionId& transactionId, const TFormat& format, const TTableReaderOptions& options, bool useFormatFromTableAttributes); bool Retry( const TMaybe& rangeIndex, const TMaybe& rowIndex, const std::exception_ptr& error) override; void ResetRetries() override; bool HasRangeIndices() const override { return true; } protected: size_t DoRead(void* buf, size_t len) override; private: TRichYPath Path_; const IClientRetryPolicyPtr ClientRetryPolicy_; const TClientContext Context_; TTransactionId ParentTransactionId_; TMaybe Format_; TTableReaderOptions Options_; THolder ReadTransaction_; NHttpClient::IHttpResponsePtr Response_; IInputStream* Input_; IRequestRetryPolicyPtr CurrentRequestRetryPolicy_; private: void TransformYPath(); void CreateRequest(const TMaybe& rangeIndex = Nothing(), const TMaybe& rowIndex = Nothing()); }; //////////////////////////////////////////////////////////////////////////////// } // namespace NYT