public class MarkerUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
MARKER_TYPE_FILENAME |
static String |
MARKERS_FILENAME_PREFIX |
| Constructor and Description |
|---|
MarkerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
deleteMarkerTypeFile(org.apache.hadoop.fs.FileSystem fileSystem,
String markerDir)
Deletes `MARKERS.type` file.
|
static boolean |
doesMarkerTypeFileExist(org.apache.hadoop.fs.FileSystem fileSystem,
String markerDir) |
static Set<String> |
readMarkersFromFile(org.apache.hadoop.fs.Path markersFilePath,
SerializableConfiguration conf)
Reads the markers stored in the underlying file.
|
static Option<MarkerType> |
readMarkerType(org.apache.hadoop.fs.FileSystem fileSystem,
String markerDir)
Reads the marker type from `MARKERS.type` file.
|
static Map<String,Set<String>> |
readTimelineServerBasedMarkersFromFileSystem(String markerDir,
org.apache.hadoop.fs.FileSystem fileSystem,
HoodieEngineContext context,
int parallelism)
Reads files containing the markers written by timeline-server-based marker mechanism.
|
static String |
stripMarkerFolderPrefix(String fullMarkerPath,
String markerDir)
Strips the marker folder prefix of any file path under the marker directory.
|
static String |
stripMarkerFolderPrefix(String fullMarkerPath,
String basePath,
String instantTime)
Strips the folder prefix of the marker file path corresponding to a data file.
|
static void |
writeMarkerTypeToFile(MarkerType markerType,
org.apache.hadoop.fs.FileSystem fileSystem,
String markerDir)
Writes the marker type to the file `MARKERS.type`.
|
public static final String MARKERS_FILENAME_PREFIX
public static final String MARKER_TYPE_FILENAME
public static String stripMarkerFolderPrefix(String fullMarkerPath, String basePath, String instantTime)
fullMarkerPath - the full path of the marker filebasePath - the base pathinstantTime - instant of interestpublic static String stripMarkerFolderPrefix(String fullMarkerPath, String markerDir)
fullMarkerPath - the full path of the filemarkerDir - marker directorypublic static boolean doesMarkerTypeFileExist(org.apache.hadoop.fs.FileSystem fileSystem,
String markerDir)
throws IOException
fileSystem - file system to use.markerDir - marker directory.true if the MARKERS.type file exists; false otherwise.IOExceptionpublic static Option<MarkerType> readMarkerType(org.apache.hadoop.fs.FileSystem fileSystem, String markerDir)
fileSystem - file system to use.markerDir - marker directory.public static void writeMarkerTypeToFile(MarkerType markerType, org.apache.hadoop.fs.FileSystem fileSystem, String markerDir)
markerType - marker type.fileSystem - file system to use.markerDir - marker directory.public static void deleteMarkerTypeFile(org.apache.hadoop.fs.FileSystem fileSystem,
String markerDir)
fileSystem - file system to use.markerDir - marker directory.public static Map<String,Set<String>> readTimelineServerBasedMarkersFromFileSystem(String markerDir, org.apache.hadoop.fs.FileSystem fileSystem, HoodieEngineContext context, int parallelism)
markerDir - marker directory.fileSystem - file system to use.context - instance of HoodieEngineContext to useparallelism - parallelism to useMap of file name to the set of markers stored in the file.public static Set<String> readMarkersFromFile(org.apache.hadoop.fs.Path markersFilePath, SerializableConfiguration conf)
markersFilePath - file path for the markersconf - serializable configSet of String.Copyright © 2022 The Apache Software Foundation. All rights reserved.