greenplumn compress_writer 源码

  • 2022-08-18
  • 浏览 (494)

greenplumn compress_writer 代码

文件路径:/gpcontrib/gpcloud/include/compress_writer.h

#ifndef INCLUDE_COMPRESS_WRITER_H_
#define INCLUDE_COMPRESS_WRITER_H_

#include "s3common_headers.h"
#include "s3exception.h"
#include "s3macros.h"
#include "writer.h"

// 2MB by default
extern uint64_t S3_ZIP_COMPRESS_CHUNKSIZE;

class CompressWriter : public Writer {
   public:
    CompressWriter();
    virtual ~CompressWriter();

    virtual void open(const S3Params &params);

    // write() attempts to write up to count bytes from the buffer.
    // If 'count' is larger than Zip chunk-buffer, it invokes writeOneChunk()
    // repeatedly to finish upload. Throw exception if encounters errors.
    virtual uint64_t write(const char *buf, uint64_t count);

    // This should be reentrant, has no side effects when called multiple times.
    virtual void close();

    void setWriter(Writer *writer);

   private:
    void flush();
    uint64_t writeOneChunk(const char *buf, uint64_t count);

    Writer *writer;

    // zlib related variables.
    z_stream zstream;
    char *out;  // Output buffer for compression.

    // add this flag to make close() reentrant
    bool isClosed;
};

#endif

相关信息

greenplumn 源码目录

相关文章

greenplumn decompress_reader 源码

greenplumn gpcheckcloud 源码

greenplumn gpcommon 源码

greenplumn gpreader 源码

greenplumn gpwriter 源码

greenplumn reader 源码

greenplumn restful_service 源码

greenplumn s3bucket_reader 源码

greenplumn s3common_headers 源码

greenplumn s3common_reader 源码

0  赞