public abstract class WriteMarkers extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected String |
basePath |
protected String |
instantTime |
protected StoragePath |
markerDirPath |
| Constructor and Description |
|---|
WriteMarkers(String basePath,
String markerFolderPath,
String instantTime) |
| Modifier and Type | Method and Description |
|---|---|
abstract Set<String> |
allMarkerFilePaths() |
Option<StoragePath> |
create(String partitionPath,
String fileName,
IOType type)
Creates a marker without checking if the marker already exists.
|
Option<StoragePath> |
create(String partitionPath,
String fileName,
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<StoragePath> |
createIfNotExists(String partitionPath,
String fileName,
IOType type)
Creates a marker if the marker does not exist.
|
Option<StoragePath> |
createIfNotExists(String partitionPath,
String fileName,
IOType type,
HoodieWriteConfig writeConfig,
String fileId,
HoodieActiveTimeline activeTimeline)
Creates a marker if the marker does not exist.
|
abstract Option<StoragePath> |
createWithEarlyConflictDetection(String partitionPath,
String fileName,
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 static String |
getMarkerFileName(String fileName,
IOType type)
Gets the marker file name, in the format of "[file_name].marker.[IO_type]".
|
protected StoragePath |
getMarkerPath(String partitionPath,
String fileName,
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 StoragePath markerDirPath
protected final String instantTime
public Option<StoragePath> create(String partitionPath, String fileName, IOType type)
partitionPath - partition path in the table.fileName - file name.type - write IO type.public Option<StoragePath> create(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 Option<StoragePath> createIfNotExists(String partitionPath, String fileName, IOType type)
partitionPath - partition path in the tablefileName - file nametype - write IO typepublic Option<StoragePath> 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 static String getMarkerFileName(String fileName, IOType type)
fileName - file nametype - IO typeprotected StoragePath getMarkerPath(String partitionPath, String fileName, IOType type)
partitionPath - The partition pathfileName - The 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<StoragePath> createWithEarlyConflictDetection(String partitionPath, String fileName, IOType type, boolean checkIfExists, HoodieWriteConfig config, String fileId, HoodieActiveTimeline activeTimeline)
partitionPath - partition path in the table.fileName - 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 © 2024 The Apache Software Foundation. All rights reserved.