#pragma once #include namespace NYT { class IProxyOutput; class TNodeTableWriter; //////////////////////////////////////////////////////////////////////////////// class TProtoTableWriter : public IProtoWriterImpl { public: TProtoTableWriter( THolder output, TVector&& descriptors); ~TProtoTableWriter() override; void AddRow(const Message& row, size_t tableIndex) override; void AddRow(Message&& row, size_t tableIndex) override; size_t GetBufferMemoryUsage() const override; size_t GetTableCount() const override; void FinishTable(size_t) override; void Abort() override; private: THolder NodeWriter_; TVector Descriptors_; }; //////////////////////////////////////////////////////////////////////////////// class TLenvalProtoTableWriter : public IProtoWriterImpl { public: TLenvalProtoTableWriter( THolder output, TVector&& descriptors); ~TLenvalProtoTableWriter() override; void AddRow(const Message& row, size_t tableIndex) override; void AddRow(Message&& row, size_t tableIndex) override; size_t GetBufferMemoryUsage() const override; size_t GetTableCount() const override; void FinishTable(size_t) override; void Abort() override; protected: THolder Output_; TVector Descriptors_; }; /// [Deprecated] Create TNode from protobuf message /// /// @deprecated This function works only in simple cases. On nontrivial messages its interpretation /// of protobuf messages might significantly differ from YT interpretation. /// /// This function doesn't support composite types and many attributes supported by protobuf Reader/Writer. TNode MakeNodeFromMessage(const ::google::protobuf::Message& row); //////////////////////////////////////////////////////////////////////////////// class TLenvalProtoSingleTableWriter : public TLenvalProtoTableWriter { public: TLenvalProtoSingleTableWriter( THolder output, const ::google::protobuf::Descriptor* descriptor); ~TLenvalProtoSingleTableWriter() override = default; void AddRow(const Message& row, size_t tableIndex) override; }; //////////////////////////////////////////////////////////////////////////////// } // namespace NYT