Package io.trino.filesystem.local
Class LocalOutputFile
java.lang.Object
io.trino.filesystem.local.LocalOutputFile
- All Implemented Interfaces:
TrinoOutputFile
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(AggregatedMemoryContext memoryContext) Open an output stream for creating a new file.voidcreateOrOverwrite(byte[] data) Create file with the specified content, atomically if possible.location()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.trino.filesystem.TrinoOutputFile
create, createExclusive
-
Constructor Details
-
LocalOutputFile
-
LocalOutputFile
-
-
Method Details
-
create
Description copied from interface:TrinoOutputFileOpen an output stream for creating a new file. This method is expected to be used with unique locations.If the file already exists, the method may fail or the file may be overwritten, depending on the file system implementation. For example, S3 does not support creating files exclusively, and performing an existence check before creating the file is both expensive and unnecessary for locations that are expected to be unique.
The file may be created immediately, or it may be created atomically when the output stream is closed, depending on the file system implementation.
- Specified by:
createin interfaceTrinoOutputFile- Throws:
IOException
-
createOrOverwrite
Description copied from interface:TrinoOutputFileCreate file with the specified content, atomically if possible. The file will be replaced if it already exists. If an error occurs while writing and the implementation does not support atomic writes, then a partial file may be written, or the original file may be deleted or left unchanged.- Specified by:
createOrOverwritein interfaceTrinoOutputFile- Throws:
IOException
-
location
- Specified by:
locationin interfaceTrinoOutputFile
-
toString
-