public class HoodieTableMetaClient extends Object implements Serializable
HoodieTableMetaClient allows to access meta-data about a hoodie table It returns meta-data about
commits, savepoints, compactions, cleanups as a HoodieTimeline Create an instance of the
HoodieTableMetaClient with FileSystem and basePath to start getting the meta-data.
All the timelines are computed lazily, once computed the timeline is cached and never refreshed. Use the
HoodieTimeline.reload() to refresh timelines.
HoodieTimeline,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
HoodieTableMetaClient.Builder
Builder for
HoodieTableMetaClient. |
static class |
HoodieTableMetaClient.PropertyBuilder |
| Modifier and Type | Field and Description |
|---|---|
static String |
AUXILIARYFOLDER_NAME |
static String |
BOOTSTRAP_INDEX_BY_FILE_ID_FOLDER_PATH |
static String |
BOOTSTRAP_INDEX_BY_PARTITION_FOLDER_PATH |
static String |
BOOTSTRAP_INDEX_ROOT_FOLDER_PATH |
static String |
HEARTBEAT_FOLDER_NAME |
static String |
MARKER_EXTN |
static String |
METAFOLDER_NAME |
static String |
TEMPFOLDER_NAME |
| Constructor and Description |
|---|
HoodieTableMetaClient()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static HoodieTableMetaClient.Builder |
builder() |
boolean |
equals(Object o) |
HoodieActiveTimeline |
getActiveTimeline()
Get the active instants as a timeline.
|
HoodieArchivedTimeline |
getArchivedTimeline()
Get the archived commits as a timeline.
|
String |
getArchivePath() |
String |
getBasePath() |
String |
getBootstrapIndexByFileIdFolderNameFolderPath() |
String |
getBootstrapIndexByPartitionFolderPath() |
String |
getCommitActionType()
Gets the commit action type.
|
HoodieTimeline |
getCommitsAndCompactionTimeline()
Get the commit + pending-compaction timeline visible for this table.
|
HoodieTimeline |
getCommitsTimeline()
Get the commit timeline visible for this table.
|
HoodieTimeline |
getCommitTimeline()
Get the compacted commit timeline visible for this table.
|
ConsistencyGuardConfig |
getConsistencyGuardConfig() |
HoodieWrapperFileSystem |
getFs()
Get the FS implementation for this table.
|
org.apache.hadoop.conf.Configuration |
getHadoopConf() |
static String |
getHeartbeatFolderPath(String basePath) |
String |
getMarkerFolderPath(String instantTs)
Returns Marker folder path.
|
String |
getMetaAuxiliaryPath() |
String |
getMetaPath() |
org.apache.hadoop.fs.FileSystem |
getRawFs()
Return raw file-system.
|
HoodieTableConfig |
getTableConfig() |
HoodieTableType |
getTableType() |
String |
getTempFolderPath() |
TimelineLayoutVersion |
getTimelineLayoutVersion() |
int |
hashCode() |
void |
initializeBootstrapDirsIfNotExists() |
static void |
initializeBootstrapDirsIfNotExists(org.apache.hadoop.conf.Configuration hadoopConf,
String basePath,
org.apache.hadoop.fs.FileSystem fs) |
static HoodieTableMetaClient |
initTableAndGetMetaClient(org.apache.hadoop.conf.Configuration hadoopConf,
String basePath,
Properties props)
Helper method to initialize a given path as a hoodie table with configs passed in as as Properties.
|
static HoodieTableMetaClient |
reload(HoodieTableMetaClient oldMetaClient) |
HoodieActiveTimeline |
reloadActiveTimeline()
Reload ActiveTimeline and cache.
|
static org.apache.hadoop.fs.FileStatus[] |
scanFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path metaPath,
org.apache.hadoop.fs.PathFilter nameFilter)
Helper method to scan all hoodie-instant metafiles.
|
List<HoodieInstant> |
scanHoodieInstantsFromFileSystem(org.apache.hadoop.fs.Path timelinePath,
Set<String> includedExtensions,
boolean applyLayoutVersionFilters)
Helper method to scan all hoodie-instant metafiles and construct HoodieInstant objects.
|
List<HoodieInstant> |
scanHoodieInstantsFromFileSystem(Set<String> includedExtensions,
boolean applyLayoutVersionFilters)
Helper method to scan all hoodie-instant metafiles and construct HoodieInstant objects.
|
void |
setActiveTimeline(HoodieActiveTimeline activeTimeline) |
void |
setBasePath(String basePath) |
void |
setMetaPath(String metaPath) |
String |
toString() |
static HoodieTableMetaClient.PropertyBuilder |
withPropertyBuilder() |
public static final String METAFOLDER_NAME
public static final String TEMPFOLDER_NAME
public static final String AUXILIARYFOLDER_NAME
public static final String BOOTSTRAP_INDEX_ROOT_FOLDER_PATH
public static final String HEARTBEAT_FOLDER_NAME
public static final String BOOTSTRAP_INDEX_BY_PARTITION_FOLDER_PATH
public static final String BOOTSTRAP_INDEX_BY_FILE_ID_FOLDER_PATH
public static final String MARKER_EXTN
public HoodieTableMetaClient()
public static HoodieTableMetaClient reload(HoodieTableMetaClient oldMetaClient)
public String getBasePath()
public HoodieTableType getTableType()
public String getMetaPath()
public String getTempFolderPath()
public String getMarkerFolderPath(String instantTs)
instantTs - Instant Timestamppublic String getMetaAuxiliaryPath()
public static String getHeartbeatFolderPath(String basePath)
public String getBootstrapIndexByPartitionFolderPath()
public String getBootstrapIndexByFileIdFolderNameFolderPath()
public String getArchivePath()
public HoodieTableConfig getTableConfig()
public TimelineLayoutVersion getTimelineLayoutVersion()
public HoodieWrapperFileSystem getFs()
public org.apache.hadoop.fs.FileSystem getRawFs()
public org.apache.hadoop.conf.Configuration getHadoopConf()
public HoodieActiveTimeline getActiveTimeline()
public HoodieActiveTimeline reloadActiveTimeline()
public ConsistencyGuardConfig getConsistencyGuardConfig()
public HoodieArchivedTimeline getArchivedTimeline()
public static HoodieTableMetaClient initTableAndGetMetaClient(org.apache.hadoop.conf.Configuration hadoopConf, String basePath, Properties props) throws IOException
IOExceptionpublic static void initializeBootstrapDirsIfNotExists(org.apache.hadoop.conf.Configuration hadoopConf,
String basePath,
org.apache.hadoop.fs.FileSystem fs)
throws IOException
IOExceptionpublic static org.apache.hadoop.fs.FileStatus[] scanFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path metaPath,
org.apache.hadoop.fs.PathFilter nameFilter)
throws IOException
fs - The file system implementation for this tablemetaPath - The meta path where meta files are storednameFilter - The name filter to filter meta filesIOException - In case of failurepublic HoodieTimeline getCommitsTimeline()
public HoodieTimeline getCommitsAndCompactionTimeline()
public HoodieTimeline getCommitTimeline()
public String getCommitActionType()
public List<HoodieInstant> scanHoodieInstantsFromFileSystem(Set<String> includedExtensions, boolean applyLayoutVersionFilters) throws IOException
includedExtensions - Included hoodie extensionsapplyLayoutVersionFilters - Depending on Timeline layout version, if there are multiple states for the same
action instant, only include the highest stateIOException - in case of failurepublic List<HoodieInstant> scanHoodieInstantsFromFileSystem(org.apache.hadoop.fs.Path timelinePath, Set<String> includedExtensions, boolean applyLayoutVersionFilters) throws IOException
timelinePath - MetaPath where instant files are storedincludedExtensions - Included hoodie extensionsapplyLayoutVersionFilters - Depending on Timeline layout version, if there are multiple states for the same
action instant, only include the highest stateIOException - in case of failurepublic void initializeBootstrapDirsIfNotExists()
throws IOException
IOExceptionpublic void setBasePath(String basePath)
public void setMetaPath(String metaPath)
public void setActiveTimeline(HoodieActiveTimeline activeTimeline)
public static HoodieTableMetaClient.Builder builder()
public static HoodieTableMetaClient.PropertyBuilder withPropertyBuilder()
Copyright © 2021 The Apache Software Foundation. All rights reserved.