public class HoodieBackedTableMetadata extends BaseTableMetadata
dataMetaClient, hiveStylePartitioningEnabled, isMetadataTableInitialized, metadataConfig, metrics, urlEncodePartitioningEnabledcaseSensitive, dataBasePath, engineContext, storage, storageConfEMPTY_PARTITION_NAME, METADATA_TABLE_NAME_SUFFIX, NON_PARTITIONED_NAME, RECORDKEY_PARTITION_LIST, SOLO_COMMIT_TIMESTAMP| Constructor and Description |
|---|
HoodieBackedTableMetadata(HoodieEngineContext engineContext,
HoodieStorage storage,
HoodieMetadataConfig metadataConfig,
String datasetBasePath) |
HoodieBackedTableMetadata(HoodieEngineContext engineContext,
HoodieStorage storage,
HoodieMetadataConfig metadataConfig,
String datasetBasePath,
boolean reuse) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
enabled() |
Map<String,List<HoodieRecord<HoodieMetadataPayload>>> |
getAllRecordsByKeys(List<String> keys,
String partitionName)
Fetch records for given keys.
|
Option<String> |
getLatestCompactionTime()
Returns the timestamp of the latest compaction.
|
Pair<HoodieMetadataLogRecordReader,Long> |
getLogRecordScanner(List<HoodieLogFile> logFiles,
String partitionName,
Option<Boolean> allowFullScanOverride) |
HoodieTableFileSystemView |
getMetadataFileSystemView() |
HoodieTableMetaClient |
getMetadataMetaClient() |
int |
getNumFileGroupsForPartition(MetadataPartitionType partition)
Returns the number of shards in a metadata table partition.
|
List<String> |
getPartitionPathWithPathPrefixes(List<String> relativePathPrefixes)
Fetches all partition paths that are the sub-directories of the list of provided (relative) paths.
|
List<String> |
getPartitionPathWithPathPrefixUsingFilterExpression(List<String> relativePathPrefixes,
Types.RecordType partitionFields,
Expression expression)
Retrieve the paths of partitions under the provided sub-directories,
and try to filter these partitions using the provided
Expression. |
protected Option<HoodieRecord<HoodieMetadataPayload>> |
getRecordByKey(String key,
String partitionName) |
HoodieData<HoodieRecord<HoodieMetadataPayload>> |
getRecordsByKeyPrefixes(List<String> keyPrefixes,
String partitionName,
boolean shouldLoadInMemory)
Fetch records by key prefixes.
|
protected Map<String,HoodieRecord<HoodieMetadataPayload>> |
getRecordsByKeys(List<String> keys,
String partitionName) |
protected Map<String,List<HoodieRecord<HoodieMetadataPayload>>> |
getSecondaryIndexRecords(List<String> keys,
String partitionName)
Returns a map of (record-key -> list-of-secondary-index-records) for the provided secondary keys.
|
protected Map<String,String> |
getSecondaryKeysForRecordKeys(List<String> recordKeys,
String partitionName) |
Option<String> |
getSyncedInstantTime()
Get the instant time to which the metadata is synced w.r.t data timeline.
|
void |
reset()
Clear the states of the table metadata.
|
Map<String,String> |
stats() |
fetchAllPartitionPaths, getAllFilesInPartition, getAllFilesInPartitions, getAllPartitionPaths, getBloomFilter, getBloomFilters, getColumnStats, getEngineContext, getLatestDataInstantTime, getMetadataConfig, getSecondaryKeys, getStorageConf, isMetadataTableInitialized, readRecordIndex, readSecondaryIndexextractPartitionValues, getPathPartitionLevelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createFSBackedTableMetadata, createHoodieBackedTableMetadata, getDatasetBasePath, getDataTableBasePathFromMetadataTable, getMetadataTableBasePath, getMetadataTableBasePath, isMetadataTable, isMetadataTablepublic HoodieBackedTableMetadata(HoodieEngineContext engineContext, HoodieStorage storage, HoodieMetadataConfig metadataConfig, String datasetBasePath)
public HoodieBackedTableMetadata(HoodieEngineContext engineContext, HoodieStorage storage, HoodieMetadataConfig metadataConfig, String datasetBasePath, boolean reuse)
protected Option<HoodieRecord<HoodieMetadataPayload>> getRecordByKey(String key, String partitionName)
getRecordByKey in class BaseTableMetadatapublic List<String> getPartitionPathWithPathPrefixUsingFilterExpression(List<String> relativePathPrefixes, Types.RecordType partitionFields, Expression expression) throws IOException
HoodieTableMetadataExpression.IOExceptionpublic List<String> getPartitionPathWithPathPrefixes(List<String> relativePathPrefixes) throws IOException
HoodieTableMetadataE.g., Table has partition 4 partitions: year=2022/month=08/day=30, year=2022/month=08/day=31, year=2022/month=07/day=03, year=2022/month=07/day=04 The relative path "year=2022" returns all partitions, while the relative path "year=2022/month=07" returns only two partitions.
IOExceptionpublic HoodieData<HoodieRecord<HoodieMetadataPayload>> getRecordsByKeyPrefixes(List<String> keyPrefixes, String partitionName, boolean shouldLoadInMemory)
HoodieTableMetadatakeyPrefixes - list of key prefixes for which interested records are looked up for.partitionName - partition name in metadata table where the records are looked up for.HoodieData of HoodieRecords with records matching the passed in key prefixes.protected Map<String,HoodieRecord<HoodieMetadataPayload>> getRecordsByKeys(List<String> keys, String partitionName)
getRecordsByKeys in class BaseTableMetadatapublic Map<String,List<HoodieRecord<HoodieMetadataPayload>>> getAllRecordsByKeys(List<String> keys, String partitionName)
HoodieTableMetadatakeys - list of key for which interested records are looked up for.partitionName - partition name in metadata table where the records are looked up for.List of HoodieRecords with records matching the passed in keys.public Pair<HoodieMetadataLogRecordReader,Long> getLogRecordScanner(List<HoodieLogFile> logFiles, String partitionName, Option<Boolean> allowFullScanOverride)
public void close()
public boolean enabled()
public HoodieTableMetaClient getMetadataMetaClient()
public HoodieTableFileSystemView getMetadataFileSystemView()
public Option<String> getSyncedInstantTime()
HoodieTableMetadatapublic Option<String> getLatestCompactionTime()
HoodieTableMetadatapublic void reset()
HoodieTableMetadatapublic int getNumFileGroupsForPartition(MetadataPartitionType partition)
HoodieTableMetadataprotected Map<String,String> getSecondaryKeysForRecordKeys(List<String> recordKeys, String partitionName)
getSecondaryKeysForRecordKeys in class BaseTableMetadataprotected Map<String,List<HoodieRecord<HoodieMetadataPayload>>> getSecondaryIndexRecords(List<String> keys, String partitionName)
BaseTableMetadatagetSecondaryIndexRecords in class BaseTableMetadataCopyright © 2024 The Apache Software Foundation. All rights reserved.