Package org.apache.flink.core.fs
Class RefCountedTmpFileCreator
- java.lang.Object
-
- org.apache.flink.core.fs.RefCountedTmpFileCreator
-
- All Implemented Interfaces:
org.apache.flink.util.function.FunctionWithException<File,RefCountedFileWithStream,IOException>
@Internal public class RefCountedTmpFileCreator extends Object implements org.apache.flink.util.function.FunctionWithException<File,RefCountedFileWithStream,IOException>
A utility class that creates localreference counted filesthat serve as temporary files.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RefCountedFileWithStreamapply(File file)Gets the next temp file and stream to temp file.static RefCountedTmpFileCreatorinDirectories(File... tmpDirectories)
-
-
-
Method Detail
-
apply
public RefCountedFileWithStream apply(File file) throws IOException
Gets the next temp file and stream to temp file. This creates the temp file atomically, making sure no previous file is overwritten.This method is safe against concurrent use.
- Specified by:
applyin interfaceorg.apache.flink.util.function.FunctionWithException<File,RefCountedFileWithStream,IOException>- Returns:
- A pair of temp file and output stream to that temp file.
- Throws:
IOException- Thrown, if the stream to the temp file could not be opened.
-
inDirectories
public static RefCountedTmpFileCreator inDirectories(File... tmpDirectories)
-
-