orc-dev mailing list archives

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

    https://github.com/apache/orc/pull/301#discussion_r211036369
  
    --- 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 --
    
    Can we move this common compression header code to `CompressionStreamBase` ?


---

Mime
View raw message