Class PartitionTempFileManager
java.lang.Object
org.apache.flink.connector.file.table.PartitionTempFileManager
Manage temporary files for writing files. Use special rules to organize directories for temporary
files.
Temporary file directory contains the following directory parts: 1.temporary base path directory. 2.task id directory. 3.directories to specify partitioning. 4.data files. eg: /tmp/task-0-attempt-0/p0=1/p1=2/fileName.
-
Constructor Summary
ConstructorsConstructorDescriptionPartitionTempFileManager(FileSystemFactory factory, org.apache.flink.core.fs.Path tmpPath, int taskNumber, int attemptNumber) PartitionTempFileManager(FileSystemFactory factory, org.apache.flink.core.fs.Path tmpPath, int taskNumber, int attemptNumber, org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig outputFileConfig) -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<LinkedHashMap<String,String>, List<org.apache.flink.core.fs.Path>> collectPartSpecToPaths(org.apache.flink.core.fs.FileSystem fs, List<org.apache.flink.core.fs.Path> taskPaths, int partColSize) Collect all partitioned paths, aggregate according to partition spec.org.apache.flink.core.fs.PathcreatePartitionDir(String... partitions) Generate a new partition directory with partitions.static List<org.apache.flink.core.fs.Path>listTaskTemporaryPaths(org.apache.flink.core.fs.FileSystem fs, org.apache.flink.core.fs.Path basePath, BiPredicate<Integer, Integer> taskAttemptFilter) Returns task temporary paths in this checkpoint.
-
Constructor Details
-
PartitionTempFileManager
public PartitionTempFileManager(FileSystemFactory factory, org.apache.flink.core.fs.Path tmpPath, int taskNumber, int attemptNumber) throws IOException - Throws:
IOException
-
PartitionTempFileManager
public PartitionTempFileManager(FileSystemFactory factory, org.apache.flink.core.fs.Path tmpPath, int taskNumber, int attemptNumber, org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig outputFileConfig) throws IOException - Throws:
IOException
-
-
Method Details
-
createPartitionDir
Generate a new partition directory with partitions. -
listTaskTemporaryPaths
public static List<org.apache.flink.core.fs.Path> listTaskTemporaryPaths(org.apache.flink.core.fs.FileSystem fs, org.apache.flink.core.fs.Path basePath, BiPredicate<Integer, Integer> taskAttemptFilter) throws ExceptionReturns task temporary paths in this checkpoint.- Throws:
Exception
-
collectPartSpecToPaths
public static Map<LinkedHashMap<String,String>, collectPartSpecToPathsList<org.apache.flink.core.fs.Path>> (org.apache.flink.core.fs.FileSystem fs, List<org.apache.flink.core.fs.Path> taskPaths, int partColSize) Collect all partitioned paths, aggregate according to partition spec.
-