You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/18 08:15:35 UTC

[GitHub] [arrow] zhztheplayer commented on a change in pull request #7768: ARROW-9475: [Java] Clean up usages of BaseAllocator, use BufferAllocator in…

zhztheplayer commented on a change in pull request #7768:
URL: https://github.com/apache/arrow/pull/7768#discussion_r456764886



##########
File path: java/memory/memory-core/src/main/java/org/apache/arrow/memory/BufferAllocator.java
##########
@@ -126,6 +134,30 @@ BufferAllocator newChildAllocator(
    */
   long getHeadroom();
 
+  /**
+   * Forcibly allocate bytes. Returns whether the allocation fit within limits.
+   *
+   * @param size to increase
+   * @return Whether the allocation fit within limits.
+   */
+  boolean forceAllocate(long size);

Review comment:
       Hi @rymurr,
   
   E.g. In AllocationMangager code, we were calling BaseAllocator#releaseBytes:
   
   https://github.com/apache/arrow/blob/d9525f1b19c00e440b3af83a68d1f2bba89a0a24/java/memory/memory-core/src/main/java/org/apache/arrow/memory/AllocationManager.java#L155
   
   After changes in this PR, we are now trying to call BufferAllocator#releaseBytes:
   
   https://github.com/apache/arrow/pull/7768/files#diff-68d17bac8aafb7004e2fb310f131df5fR160
   
   That's why the method is added to BufferAllocator.
   
   




----------------------------------------------------------------
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