blob: 1bf43d2f98345361333ca79eed8c5b17d1557817 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#pragma once
#include <yt/cpp/mapreduce/interface/io.h>
namespace NYT {
class IProxyOutput;
class TNodeTableWriter;
////////////////////////////////////////////////////////////////////////////////
class TProtoTableWriter
: public IProtoWriterImpl
{
public:
TProtoTableWriter(
THolder<IProxyOutput> output,
TVector<const ::google::protobuf::Descriptor*>&& 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<TNodeTableWriter> NodeWriter_;
TVector<const ::google::protobuf::Descriptor*> Descriptors_;
};
////////////////////////////////////////////////////////////////////////////////
class TLenvalProtoTableWriter
: public IProtoWriterImpl
{
public:
TLenvalProtoTableWriter(
THolder<IProxyOutput> output,
TVector<const ::google::protobuf::Descriptor*>&& 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;
private:
THolder<IProxyOutput> Output_;
TVector<const ::google::protobuf::Descriptor*> 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);
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT
|