public interface FileIO
extends java.io.Serializable, java.io.Closeable
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.
Modifier and Type | Method and Description |
---|---|
default void |
close()
Close File IO to release underlying resources.
|
default void |
deleteFile(InputFile file)
|
default void |
deleteFile(OutputFile file)
Convenience method to
delete an OutputFile . |
void |
deleteFile(java.lang.String path)
Delete the file at the given path.
|
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 a
InputFile instance to read bytes from the file at the given path. |
OutputFile |
newOutputFile(java.lang.String path)
Get a
OutputFile instance to write bytes to the file at the given path. |
InputFile newInputFile(java.lang.String path)
InputFile
instance to read bytes from the file at the given path.OutputFile newOutputFile(java.lang.String path)
OutputFile
instance to write bytes to the file at the given path.void deleteFile(java.lang.String path)
default void deleteFile(InputFile file)
default void deleteFile(OutputFile file)
delete
an OutputFile
.default void initialize(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- catalog propertiesdefault void close()
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.
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable