Package org.apache.iceberg.io
Interface FileIO
- All Superinterfaces:
AutoCloseable,Closeable,Serializable
- All Known Subinterfaces:
DelegateFileIO,SupportsBulkOperations,SupportsPrefixOperations
- All Known Implementing Classes:
ADLSFileIO,EcsFileIO,EncryptingFileIO,GCSFileIO,HadoopFileIO,InMemoryFileIO,OSSFileIO,ResolvingFileIO,S3FileIO
Pluggable module for reading, writing, and deleting files.
Both table metadata files and data files can be written and read by this module. Implementations must be serializable because various clients of Spark tables may initialize this once and pass it off to a separate module that would then interact with the streams.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Close File IO to release underlying resources.voiddeleteFile(String path) Delete the file at the given path.default voiddeleteFile(InputFile file) default voiddeleteFile(OutputFile file) Convenience method todeleteanOutputFile.default voidinitialize(Map<String, String> properties) Initialize File IO from catalog properties.newInputFile(String path) Get aInputFileinstance to read bytes from the file at the given path.default InputFilenewInputFile(String path, long length) Get aInputFileinstance to read bytes from the file at the given path, with a known file length.default InputFilenewInputFile(DataFile file) default InputFilenewInputFile(DeleteFile file) default InputFilenewInputFile(ManifestFile manifest) newOutputFile(String path) Get aOutputFileinstance to write bytes to the file at the given path.Returns the property map used to configure this FileIO
-
Method Details
-
newInputFile
Get aInputFileinstance to read bytes from the file at the given path. -
newInputFile
Get aInputFileinstance to read bytes from the file at the given path, with a known file length. -
newInputFile
-
newInputFile
-
newInputFile
-
newOutputFile
Get aOutputFileinstance to write bytes to the file at the given path. -
deleteFile
Delete the file at the given path. -
deleteFile
-
deleteFile
Convenience method todeleteanOutputFile. -
properties
Returns the property map used to configure this FileIO- Throws:
UnsupportedOperationException- if this FileIO does not expose its configuration properties
-
initialize
Initialize File IO from catalog properties.- Parameters:
properties- catalog properties
-
close
default void close()Close File IO to release underlying resources.Calling this method is only required when this FileIO instance is no longer expected to be used, and the resources it holds need to be explicitly released to avoid resource leaks.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-