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 single Parquet file. The file is opened immediately and closed when the returned reader is closed.- Throws:
IOException
-
openAll
Open multiple Parquet files for reading with cross-file prefetching. The schema is read from the first file. Files are opened on demand by the iterator and closed when the returned reader is closed.- Parameters:
inputFiles- the input files to read (must not be empty)- Throws:
IOException- if the first file cannot be opened or readIllegalArgumentException- if the list is empty
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-