node_table_writer.h 917 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <yt/cpp/mapreduce/interface/io.h>
  3. #include <library/cpp/yson/public.h>
  4. namespace NYT {
  5. class IProxyOutput;
  6. ////////////////////////////////////////////////////////////////////////////////
  7. class TNodeTableWriter
  8. : public INodeWriterImpl
  9. {
  10. public:
  11. explicit TNodeTableWriter(THolder<IProxyOutput> output, ::NYson::EYsonFormat format = ::NYson::EYsonFormat::Binary);
  12. ~TNodeTableWriter() override;
  13. void AddRow(const TNode& row, size_t tableIndex) override;
  14. void AddRow(TNode&& row, size_t tableIndex) override;
  15. size_t GetBufferMemoryUsage() const override;
  16. size_t GetTableCount() const override;
  17. void FinishTable(size_t) override;
  18. void Abort() override;
  19. private:
  20. THolder<IProxyOutput> Output_;
  21. TVector<THolder<::NYson::TYsonWriter>> Writers_;
  22. };
  23. ////////////////////////////////////////////////////////////////////////////////
  24. } // namespace NYT