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:
[email protected]


With regards,
Apache Git Services

Reply via email to