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
Builder for
Properties. |
| Modifier and Type | Field and Description |
|---|---|
protected HoodieActiveTimeline |
activeTimeline |
static String |
AUXILIARYFOLDER_NAME |
protected StoragePath |
basePath |
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 |
HASHING_METADATA_FOLDER_NAME |
static String |
HEARTBEAT_FOLDER_NAME |
static String |
MARKER_EXTN |
static String |
METADATA_TABLE_FOLDER_PATH |
static String |
METAFOLDER_NAME |
protected StoragePath |
metaPath |
protected HoodieMetaserverConfig |
metaserverConfig |
static String |
SAMPLE_WRITES_FOLDER_PATH |
static String |
SCHEMA_FOLDER_NAME |
protected StorageConfiguration<?> |
storageConf |
protected HoodieTableConfig |
tableConfig |
static String |
TEMPFOLDER_NAME |
| Modifier | Constructor and Description |
|---|---|
|
HoodieTableMetaClient()
Deprecated.
|
protected |
HoodieTableMetaClient(HoodieStorage storage,
String basePath,
boolean loadActiveTimelineOnLoad,
ConsistencyGuardConfig consistencyGuardConfig,
Option<TimelineLayoutVersion> layoutVersion,
String payloadClassName,
String recordMergerStrategy,
FileSystemRetryConfig fileSystemRetryConfig)
Instantiate HoodieTableMetaClient.
|
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 SAMPLE_WRITES_FOLDER_PATH
public static final String HEARTBEAT_FOLDER_NAME
public static final String METADATA_TABLE_FOLDER_PATH
public static final String HASHING_METADATA_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 SCHEMA_FOLDER_NAME
public static final String MARKER_EXTN
protected StoragePath basePath
protected StoragePath metaPath
protected StorageConfiguration<?> storageConf
protected HoodieTableConfig tableConfig
protected HoodieActiveTimeline activeTimeline
protected HoodieMetaserverConfig metaserverConfig
protected HoodieTableMetaClient(HoodieStorage storage, String basePath, boolean loadActiveTimelineOnLoad, ConsistencyGuardConfig consistencyGuardConfig, Option<TimelineLayoutVersion> layoutVersion, String payloadClassName, String recordMergerStrategy, FileSystemRetryConfig fileSystemRetryConfig)
public HoodieTableMetaClient()
public static HoodieTableMetaClient reload(HoodieTableMetaClient oldMetaClient)
public StoragePath getBasePathV2()
@Deprecated public String getBasePath()
getBasePathV2()public HoodieTableType getTableType()
public StoragePath getMetaPath()
public String getSchemaFolderName()
public String getHashingMetadataPath()
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 HoodieStorage getStorage()
public void setHoodieStorage(HoodieStorage storage)
public HoodieStorage getRawHoodieStorage()
public StorageConfiguration<?> getStorageConf()
public HoodieActiveTimeline getActiveTimeline()
public HoodieActiveTimeline reloadActiveTimeline()
public ConsistencyGuardConfig getConsistencyGuardConfig()
public FileSystemRetryConfig getFileSystemRetryConfig()
public HoodieArchivedTimeline getArchivedTimeline()
public HoodieMetaserverConfig getMetaserverConfig()
public HoodieArchivedTimeline getArchivedTimeline(String startTs)
startTs - The start instant time (inclusive) of the archived timeline.public HoodieArchivedTimeline getArchivedTimeline(String startTs, boolean useCache)
Instantiating an archived timeline is costly operation if really early startTs is specified.
This method is not thread safe.
startTs - The start instant time (inclusive) of the archived timeline.useCache - Whether to use in-memory cache.public void validateTableProperties(Properties properties)
properties - Properties from writeConfig.public static HoodieTableMetaClient initTableAndGetMetaClient(StorageConfiguration<?> storageConf, String basePath, Properties props) throws IOException
IOExceptionpublic static void initializeBootstrapDirsIfNotExists(String basePath, HoodieStorage storage) throws IOException
IOExceptionpublic static List<StoragePathInfo> scanFiles(HoodieStorage storage, StoragePath metaPath, StoragePathFilter nameFilter) throws IOException
storage - 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 boolean isTimelineNonEmpty()
true if any commits are found, else false.public 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(StoragePath 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 static HoodieTableMetaClient.Builder builder()
public static HoodieTableMetaClient.PropertyBuilder withPropertyBuilder()
Copyright © 2024 The Apache Software Foundation. All rights reserved.