Class AllocationManagerShim

java.lang.Object
org.elasticsearch.xpack.esql.arrow.AllocationManagerShim
All Implemented Interfaces:
org.apache.arrow.memory.AllocationManager.Factory

public class AllocationManagerShim extends Object implements org.apache.arrow.memory.AllocationManager.Factory
An Arrow memory allocation manager that always fails.

We don't actually use Arrow's memory manager as we stream dataframe buffers directly from ESQL blocks. But Arrow won't initialize properly unless it has one (and requires either the arrow-memory-netty or arrow-memory-unsafe libraries). It also does some fancy classpath scanning and calls to setAccessible which will be rejected by the security manager.

So we configure an allocation manager that will fail on any attempt to allocate memory.

See Also:
  • DefaultAllocationManagerOption
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.arrow.memory.AllocationManager
    create(org.apache.arrow.memory.BufferAllocator accountingAllocator, long size)
     
    org.apache.arrow.memory.ArrowBuf
     
    static void
    Initialize the Arrow memory allocation manager shim.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AllocationManagerShim

      public AllocationManagerShim()
  • Method Details

    • init

      public static void init()
      Initialize the Arrow memory allocation manager shim.
    • create

      public org.apache.arrow.memory.AllocationManager create(org.apache.arrow.memory.BufferAllocator accountingAllocator, long size)
      Specified by:
      create in interface org.apache.arrow.memory.AllocationManager.Factory
    • empty

      public org.apache.arrow.memory.ArrowBuf empty()
      Specified by:
      empty in interface org.apache.arrow.memory.AllocationManager.Factory