public abstract class WriteMarkers extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected String |
basePath |
protected String |
instantTime |
protected org.apache.hadoop.fs.Path |
markerDirPath |
| Constructor and Description |
|---|
WriteMarkers(String basePath,
String markerFolderPath,
String instantTime) |
| Modifier and Type | Method and Description |
|---|---|
abstract Set<String> |
allMarkerFilePaths() |
Option<org.apache.hadoop.fs.Path> |
create(String partitionPath,
String dataFileName,
IOType type)
Creates a marker without checking if the marker already exists.
|
Option<org.apache.hadoop.fs.Path> |
create(String partitionPath,
String dataFileName,
IOType type,
HoodieWriteConfig writeConfig,
String fileId,
HoodieActiveTimeline activeTimeline)
Creates a marker without checking if the marker already exists.
|
abstract Set<String> |
createdAndMergedDataPaths(HoodieEngineContext context,
int parallelism) |
Option<org.apache.hadoop.fs.Path> |
createIfNotExists(String partitionPath,
String dataFileName,
IOType type)
Creates a marker if the marker does not exist.
|
Option<org.apache.hadoop.fs.Path> |
createIfNotExists(String partitionPath,
String fileName,
IOType type,
HoodieWriteConfig writeConfig,
String fileId,
HoodieActiveTimeline activeTimeline)
Creates a marker if the marker does not exist.
|
abstract Option<org.apache.hadoop.fs.Path> |
createWithEarlyConflictDetection(String partitionPath,
String dataFileName,
IOType type,
boolean checkIfExists,
HoodieWriteConfig config,
String fileId,
HoodieActiveTimeline activeTimeline)
Creates a marker with early conflict detection for multi-writers.
|
abstract boolean |
deleteMarkerDir(HoodieEngineContext context,
int parallelism)
Deletes the marker directory.
|
abstract boolean |
doesMarkerDirExist() |
protected String |
getMarkerFileName(String dataFileName,
IOType type)
Gets the marker file name, in the format of "[data_file_name].marker.[IO_type]".
|
protected org.apache.hadoop.fs.Path |
getMarkerPath(String partitionPath,
String dataFileName,
IOType type)
Returns the marker path.
|
void |
quietDeleteMarkerDir(HoodieEngineContext context,
int parallelism)
Quietly deletes the marker directory.
|
static String |
stripMarkerSuffix(String path)
Strips the marker file suffix from the input path, i.e., ".marker.[IO_type]".
|
protected final String basePath
protected final transient org.apache.hadoop.fs.Path markerDirPath
protected final String instantTime
public Option<org.apache.hadoop.fs.Path> create(String partitionPath, String dataFileName, IOType type)
partitionPath - partition path in the table.dataFileName - data file name.type - write IO type.public Option<org.apache.hadoop.fs.Path> create(String partitionPath, String dataFileName, IOType type, HoodieWriteConfig writeConfig, String fileId, HoodieActiveTimeline activeTimeline)
partitionPath - partition path in the tabledataFileName - data file nametype - write IO typewriteConfig - Hudi write configs.fileId - File ID.activeTimeline - Active timeline for the write operation.public Option<org.apache.hadoop.fs.Path> createIfNotExists(String partitionPath, String dataFileName, IOType type)
partitionPath - partition path in the tabledataFileName - data file nametype - write IO typepublic Option<org.apache.hadoop.fs.Path> createIfNotExists(String partitionPath, String fileName, IOType type, HoodieWriteConfig writeConfig, String fileId, HoodieActiveTimeline activeTimeline)
partitionPath - partition path in the tablefileName - file nametype - write IO typewriteConfig - Hudi write configs.fileId - File ID.activeTimeline - Active timeline for the write operation.public void quietDeleteMarkerDir(HoodieEngineContext context, int parallelism)
context - HoodieEngineContext instance.parallelism - parallelism for deleting the marker files in the directory.public static String stripMarkerSuffix(String path)
path - file pathprotected String getMarkerFileName(String dataFileName, IOType type)
dataFileName - data file nametype - IO typeprotected org.apache.hadoop.fs.Path getMarkerPath(String partitionPath, String dataFileName, IOType type)
partitionPath - The partition pathdataFileName - The data file nametype - The IO typepublic abstract boolean deleteMarkerDir(HoodieEngineContext context, int parallelism)
context - HoodieEngineContext instance.parallelism - parallelism for deleting the marker files in the directory.public abstract boolean doesMarkerDirExist()
throws IOException
IOExceptionpublic abstract Set<String> createdAndMergedDataPaths(HoodieEngineContext context, int parallelism) throws IOException
context - HoodieEngineContext instance.parallelism - parallelism for reading the marker files in the directory.IOExceptionpublic abstract Set<String> allMarkerFilePaths() throws IOException
IOExceptionpublic abstract Option<org.apache.hadoop.fs.Path> createWithEarlyConflictDetection(String partitionPath, String dataFileName, IOType type, boolean checkIfExists, HoodieWriteConfig config, String fileId, HoodieActiveTimeline activeTimeline)
partitionPath - partition path in the table.dataFileName - data file name.type - write IO type.checkIfExists - whether to check if the marker already exists.config - Hudi write configs.fileId - File ID.activeTimeline - Active timeline for the write operation.checkIfExists is true.Copyright © 2023 The Apache Software Foundation. All rights reserved.