LogDevice API
BufferedWriteDecoder.h
1 
8 #pragma once
9 
10 #include <memory>
11 #include <vector>
12 
13 #include "logdevice/include/Record.h"
14 
15 namespace facebook { namespace logdevice {
16 
26 class BufferedWriteDecoderImpl;
27 
29  public:
34  static std::unique_ptr<BufferedWriteDecoder> create();
35 
40  static int getBatchSize(const DataRecord& record, size_t* size_out);
41 
65  int decode(std::vector<std::unique_ptr<DataRecord>>&& records,
66  std::vector<Payload>& payloads_out);
67  int decode(std::vector<std::unique_ptr<DataRecord>>&& records,
68  std::vector<PayloadGroup>& payload_groups_out);
69 
76  int decodeOne(std::unique_ptr<DataRecord>&& record,
77  std::vector<Payload>& payloads_out);
78  int decodeOne(std::unique_ptr<DataRecord>&& record,
79  std::vector<PayloadGroup>& payload_groups_out);
80 
91  std::unique_ptr<DataRecord>&& record,
92  CompressedPayloadGroups& compressed_payload_groups_out);
93 
94  virtual ~BufferedWriteDecoder() {}
95 
96  private:
97  BufferedWriteDecoder() {} // can be constructed by the factory only
99  BufferedWriteDecoder& operator=(const BufferedWriteDecoder&) = delete;
100 
101  friend class BufferedWriteDecoderImpl;
102  BufferedWriteDecoderImpl* impl(); // downcasts (this)
103 };
104 }} // namespace facebook::logdevice
Definition: BufferedWriteDecoder.h:28
Definition: AsyncReader.h:16
static int getBatchSize(const DataRecord &record, size_t *size_out)
static std::unique_ptr< BufferedWriteDecoder > create()
int decodeOneCompressed(std::unique_ptr< DataRecord > &&record, CompressedPayloadGroups &compressed_payload_groups_out)
int decodeOne(std::unique_ptr< DataRecord > &&record, std::vector< Payload > &payloads_out)
int decode(std::vector< std::unique_ptr< DataRecord >> &&records, std::vector< Payload > &payloads_out)