client_writer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <yt/cpp/mapreduce/common/fwd.h>
  3. #include <yt/cpp/mapreduce/http/requests.h>
  4. #include <yt/cpp/mapreduce/interface/io.h>
  5. namespace NYT {
  6. struct TTableWriterOptions;
  7. ////////////////////////////////////////////////////////////////////////////////
  8. class TClientWriter
  9. : public IProxyOutput
  10. {
  11. public:
  12. TClientWriter(
  13. const TRichYPath& path,
  14. IClientRetryPolicyPtr clientRetryPolicy,
  15. ITransactionPingerPtr transactionPinger,
  16. const TClientContext& context,
  17. const TTransactionId& transactionId,
  18. const TMaybe<TFormat>& format,
  19. const TTableWriterOptions& options);
  20. ~TClientWriter();
  21. size_t GetStreamCount() const override;
  22. IOutputStream* GetStream(size_t tableIndex) const override;
  23. void OnRowFinished(size_t tableIndex) override;
  24. void Abort() override;
  25. size_t GetBufferMemoryUsage() const override;
  26. void Finish();
  27. private:
  28. const size_t BufferSize_ = 64 << 20;
  29. const bool AutoFinish_;
  30. ::TIntrusivePtr<TRawTableWriter> RawWriter_;
  31. };
  32. ////////////////////////////////////////////////////////////////////////////////
  33. } // namespace NYT