carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1059: [CARBONDATA-1124] Use raw compression while e...
Date Wed, 21 Jun 2017 05:10:02 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1059#discussion_r123155018
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeFixLengthColumnPage.java
---
    @@ -326,9 +327,17 @@ public void encode(PrimitiveCodec codec) {
       }
     
       @Override
    -  public byte[] compress(Compressor compressor) {
    -    // TODO: use zero-copy raw compression
    -    return super.compress(compressor);
    +  public byte[] compress(Compressor compressor) throws MemoryException, IOException {
    +    // use raw compression and copy to byte[]
    +    int inputSize = pageSize << dataType.getSizeBits();
    +    int compressedMaxSize = compressor.maxCompressedLength(inputSize);
    +    MemoryBlock compressed = UnsafeMemoryManager.allocateMemoryWithRetry(compressedMaxSize);
    --- End diff --
    
    I think it is better to change the logic in UnsafeMemoryManager to simplify the usage
code. In UnsafeMemoryManager, it will use unsafe memory based on
    ```
        boolean offHeap = Boolean.parseBoolean(CarbonProperties.getInstance()
            .getProperty(CarbonCommonConstants.ENABLE_OFFHEAP_SORT,
                CarbonCommonConstants.ENABLE_OFFHEAP_SORT_DEFAULT));
    ```
    So I suggest to change this part to make one configuration only for unsafe. Then I will
remove other unsafe configuration like ENABLE_UNSAFE_COLUMN_PAGE_LOADING
    @ravipesala please check


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message