You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/03/04 06:24:30 UTC

[GitHub] [carbondata] jackylk commented on a change in pull request #3638: [CARBONDATA-3731] Avoid data copy in Writer

jackylk commented on a change in pull request #3638: [CARBONDATA-3731] Avoid data copy in Writer
URL: https://github.com/apache/carbondata/pull/3638#discussion_r387469248
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datastore/compression/AbstractCompressor.java
 ##########
 @@ -48,10 +49,11 @@
   }
 
   @Override
-  public byte[] compressInt(int[] unCompInput) {
-    ByteBuffer unCompBuffer = ByteBuffer.allocate(unCompInput.length * ByteUtil.SIZEOF_INT);
+  public ByteBuffer compressInt(int[] unCompInput) {
+    ByteBuffer unCompBuffer = ByteBuffer.allocateDirect(unCompInput.length * ByteUtil.SIZEOF_INT);
 
 Review comment:
   DirectByteBuffer will be GC collected if there are no object reference to it. In our compression case, this object is temporary. So I think it is ok. @ajantha-bhat 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services