Class Hardwood
java.lang.Object
dev.hardwood.Hardwood
- All Implemented Interfaces:
AutoCloseable
Entry point for reading Parquet files with a shared thread pool.
Use this when reading multiple files to share the executor across readers:
try (Hardwood hardwood = Hardwood.create()) {
ParquetFileReader file1 = hardwood.open(InputFile.of(path1));
ParquetFileReader file2 = hardwood.open(InputFile.of(path2));
// ...
}
For single-file usage, ParquetFileReader.open(InputFile) is simpler.
-
Method Details
-
create
Create a new Hardwood instance with a thread pool sized to available processors. -
open
Open a Parquet file from an
InputFilefor reading.The file will be opened and closed automatically; closing the returned reader closes the file.
- Throws:
IOException
-
openAll
Open multiple Parquet files for reading with cross-file prefetching.
Returns a
MultiFileParquetReaderthat reads the schema from the first file and provides factory methods for row-oriented (MultiFileParquetReader.createRowReader()) or column-oriented (MultiFileParquetReader.createColumnReaders(dev.hardwood.schema.ColumnProjection)) access. The files will be opened automatically as needed.- Parameters:
inputFiles- the input files to read (must not be empty)- Returns:
- a MultiFileParquetReader for the given files
- Throws:
IOException- if the first file cannot be opened or readIllegalArgumentException- if the list is empty
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-