Class JNIFile

java.lang.Object
dev.vortex.jni.JNIFile
All Implemented Interfaces:
File, AutoCloseable

public final class JNIFile extends Object implements File
  • Constructor Details

    • JNIFile

      public JNIFile(long pointer)
  • Method Details

    • getDType

      public DType getDType()
      Description copied from interface: File
      Returns the data type (schema) of this Vortex file.

      The returned DType describes the logical structure and types of the data contained in this file. For structured data, this will typically be a DType.Variant.STRUCT containing field names and their corresponding data types. The schema remains constant for the lifetime of the file.

      Specified by:
      getDType in interface File
      Returns:
      the DType representing the schema of this file
    • rowCount

      public long rowCount()
      Description copied from interface: File
      Returns the total number of rows in this Vortex file.

      This method provides the count of logical rows contained in the file, which represents the number of records or tuples that can be read. This count is independent of any filtering or projection that may be applied during scanning operations.

      Specified by:
      rowCount in interface File
      Returns:
      the total number of rows as a non-negative long value
    • newScan

      public ArrayIterator newScan(ScanOptions options)
      Description copied from interface: File
      Creates a new iterator for scanning this file with the specified options.

      This method returns an ArrayIterator that can be used to traverse the data in this file according to the provided ScanOptions. The scan options allow for column projection, row filtering via predicates, and row range or index selection. Each call to this method creates a new independent iterator.

      The returned iterator must be properly closed when no longer needed to release any underlying resources. It is recommended to use the iterator within a try-with-resources statement.

      Specified by:
      newScan in interface File
      Parameters:
      options - the ScanOptions configuring the scan behavior, including column selection, filtering, and row selection
      Returns:
      a new ArrayIterator for scanning the file data
      See Also:
    • close

      public void close()
      Description copied from interface: File
      Closes this file and releases any associated resources.

      This method should be called when the file is no longer needed to ensure proper cleanup of any underlying file handles, native memory, or other resources. After calling this method, the file should not be used for any further operations. This method is idempotent and can be called multiple times safely.

      It is recommended to use this file within a try-with-resources statement to ensure automatic cleanup:

      
       try (File file = VortexReader.open(path)) {
           // Use file
       } // close() is called automatically
       
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface File