orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wgtmac <...@git.apache.org>
Subject [GitHub] orc pull request #301: ORC-395: Support ZSTD in C++ writer/reader
Date Tue, 21 Aug 2018 23:48:29 GMT
Github user wgtmac commented on a diff in the pull request:

    https://github.com/apache/orc/pull/301#discussion_r211793792
  
    --- Diff: c++/src/Compression.cc ---
    @@ -899,6 +900,177 @@ DIAGNOSTIC_POP
         return static_cast<uint64_t>(result);
       }
     
    +  /**
    +   * Block compression base class
    +   */
    +  class BlockCompressionStream: public CompressionStreamBase {
    +  public:
    +    BlockCompressionStream(OutputStream * outStream,
    +                           int compressionLevel,
    +                           uint64_t capacity,
    +                           uint64_t blockSize,
    +                           MemoryPool& pool)
    +                           : CompressionStreamBase(outStream,
    +                                                   compressionLevel,
    +                                                   capacity,
    +                                                   blockSize,
    +                                                   pool)
    +                           , compressorBuffer(pool) {
    +      // PASS
    +    }
    +
    +    virtual bool Next(void** data, int*size) override;
    +    virtual std::string getName() const override = 0;
    +
    +  protected:
    +    // compresses a block and returns the compressed size
    +    virtual uint64_t doBlockCompression() = 0;
    +
    +    // return maximum possible compression size for allocating space for
    +    // compressorBuffer below
    +    virtual uint64_t estimateMaxCompressionSize() = 0;
    +
    +    // should allocate max possible compressed size
    +    DataBuffer<unsigned char> compressorBuffer;
    +  };
    +
    +  bool BlockCompressionStream::Next(void** data, int*size) {
    +    if (bufferSize != 0) {
    --- End diff --
    
    Done. Please check it again when you have time. Thanks!


---

Mime
View raw message