Package org.apache.iceberg.io
Interface FileIO
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,java.io.Serializable
- All Known Subinterfaces:
DelegateFileIO
,SupportsBulkOperations
,SupportsPrefixOperations
- All Known Implementing Classes:
ADLSFileIO
,EcsFileIO
,EncryptingFileIO
,GCSFileIO
,HadoopFileIO
,InMemoryFileIO
,OSSFileIO
,ResolvingFileIO
,S3FileIO
public interface FileIO extends java.io.Serializable, java.io.Closeable
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Close File IO to release underlying resources.void
deleteFile(java.lang.String path)
Delete the file at the given path.default void
deleteFile(InputFile file)
default void
deleteFile(OutputFile file)
Convenience method todelete
anOutputFile
.default void
initialize(java.util.Map<java.lang.String,java.lang.String> properties)
Initialize File IO from catalog properties.InputFile
newInputFile(java.lang.String path)
Get aInputFile
instance to read bytes from the file at the given path.default InputFile
newInputFile(java.lang.String path, long length)
Get aInputFile
instance to read bytes from the file at the given path, with a known file length.default InputFile
newInputFile(DataFile file)
default InputFile
newInputFile(DeleteFile file)
default InputFile
newInputFile(ManifestFile manifest)
OutputFile
newOutputFile(java.lang.String path)
Get aOutputFile
instance to write bytes to the file at the given path.default java.util.Map<java.lang.String,java.lang.String>
properties()
Returns the property map used to configure this FileIO
-
-
-
Method Detail
-
newInputFile
InputFile newInputFile(java.lang.String path)
Get aInputFile
instance to read bytes from the file at the given path.
-
newInputFile
default InputFile newInputFile(java.lang.String path, long length)
Get aInputFile
instance to read bytes from the file at the given path, with a known file length.
-
newInputFile
default InputFile newInputFile(DeleteFile file)
-
newInputFile
default InputFile newInputFile(ManifestFile manifest)
-
newOutputFile
OutputFile newOutputFile(java.lang.String path)
Get aOutputFile
instance to write bytes to the file at the given path.
-
deleteFile
void deleteFile(java.lang.String path)
Delete the file at the given path.
-
deleteFile
default void deleteFile(InputFile file)
-
deleteFile
default void deleteFile(OutputFile file)
Convenience method todelete
anOutputFile
.
-
properties
default java.util.Map<java.lang.String,java.lang.String> properties()
Returns the property map used to configure this FileIO- Throws:
java.lang.UnsupportedOperationException
- if this FileIO does not expose its configuration properties
-
initialize
default void initialize(java.util.Map<java.lang.String,java.lang.String> properties)
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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-