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 
61  int decode(std::vector<std::unique_ptr<DataRecord>>&& records,
62  std::vector<Payload>& payloads_out);
63 
70  int decodeOne(std::unique_ptr<DataRecord>&& record,
71  std::vector<Payload>& payloads_out);
72 
73  virtual ~BufferedWriteDecoder() {}
74 
75  private:
76  BufferedWriteDecoder() {} // can be constructed by the factory only
78  BufferedWriteDecoder& operator=(const BufferedWriteDecoder&) = delete;
79 
80  friend class BufferedWriteDecoderImpl;
81  BufferedWriteDecoderImpl* impl(); // downcasts (this)
82 };
83 }} // 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 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)