Class NativeDatasetFactory

java.lang.Object
org.apache.arrow.dataset.jni.NativeDatasetFactory
All Implemented Interfaces:
AutoCloseable, DatasetFactory
Direct Known Subclasses:
FileSystemDatasetFactory

public class NativeDatasetFactory extends Object implements DatasetFactory
Native implementation of DatasetFactory.
  • Constructor Details

    • NativeDatasetFactory

      public NativeDatasetFactory(BufferAllocator allocator, NativeMemoryPool memoryPool, long datasetFactoryId)
      Constructor.
      Parameters:
      allocator - a context allocator associated with this factory. Any buffer that will be created natively will be then bound to this allocator.
      memoryPool - the native memory pool associated with this factory. Any buffer created natively should request for memory spaces from this memory pool. This is a mapped instance of c++ arrow::MemoryPool.
      datasetFactoryId - an ID, at the same time the native pointer of the underlying native instance of this factory. Make sure in c++ side the pointer is pointing to the shared pointer wrapping the actual instance so we could successfully decrease the reference count once close() is called.
      See Also:
  • Method Details

    • inspect

      public Schema inspect()
      Description copied from interface: DatasetFactory
      Get unified schema for the resulting Dataset.
      Specified by:
      inspect in interface DatasetFactory
      Returns:
      the schema object inspected
    • finish

      public NativeDataset finish()
      Description copied from interface: DatasetFactory
      Create a Dataset with auto-inferred schema. Which means, the schema of the resulting Dataset will be the same with calling DatasetFactory.inspect() manually.
      Specified by:
      finish in interface DatasetFactory
      Returns:
      the Dataset instance
    • finish

      public NativeDataset finish(Schema schema)
      Description copied from interface: DatasetFactory
      Create a Dataset with predefined schema. Schema inference will not be performed.
      Specified by:
      finish in interface DatasetFactory
      Parameters:
      schema - a predefined schema
      Returns:
      the Dataset instance
    • close

      public void close()
      Close this factory by release the pointer of the native instance.
      Specified by:
      close in interface AutoCloseable