public abstract class BaseTableMetadata extends AbstractHoodieTableMetadata
| Modifier and Type | Field and Description |
|---|---|
protected HoodieTableMetaClient |
dataMetaClient |
protected boolean |
hiveStylePartitioningEnabled |
protected boolean |
isMetadataTableInitialized |
protected HoodieMetadataConfig |
metadataConfig |
protected Option<HoodieMetadataMetrics> |
metrics |
protected boolean |
urlEncodePartitioningEnabled |
caseSensitive, dataBasePath, engineContext, storage, storageConfEMPTY_PARTITION_NAME, METADATA_TABLE_NAME_SUFFIX, NON_PARTITIONED_NAME, RECORDKEY_PARTITION_LIST, SOLO_COMMIT_TIMESTAMP| Modifier | Constructor and Description |
|---|---|
protected |
BaseTableMetadata(HoodieEngineContext engineContext,
HoodieStorage storage,
HoodieMetadataConfig metadataConfig,
String dataBasePath) |
| Modifier and Type | Method and Description |
|---|---|
protected List<String> |
fetchAllPartitionPaths()
Returns a list of all partitions.
|
List<StoragePathInfo> |
getAllFilesInPartition(StoragePath partitionPath)
Return the list of files in a partition.
|
Map<String,List<StoragePathInfo>> |
getAllFilesInPartitions(Collection<String> partitions)
Fetch all files for given partition paths.
|
List<String> |
getAllPartitionPaths()
Return the list of partitions in the dataset.
|
Option<BloomFilter> |
getBloomFilter(String partitionName,
String fileName)
Get the bloom filter for the FileID from the metadata table.
|
Map<Pair<String,String>,BloomFilter> |
getBloomFilters(List<Pair<String,String>> partitionNameFileNameList)
Get bloom filters for files from the metadata table index.
|
Map<Pair<String,String>,HoodieMetadataColumnStats> |
getColumnStats(List<Pair<String,String>> partitionNameFileNameList,
String columnName)
Get column stats for files from the metadata table index.
|
protected HoodieEngineContext |
getEngineContext() |
protected String |
getLatestDataInstantTime() |
HoodieMetadataConfig |
getMetadataConfig() |
protected abstract Option<HoodieRecord<HoodieMetadataPayload>> |
getRecordByKey(String key,
String partitionName) |
protected abstract Map<String,HoodieRecord<HoodieMetadataPayload>> |
getRecordsByKeys(List<String> keys,
String partitionName) |
protected abstract 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.
|
Map<String,String> |
getSecondaryKeys(List<String> recordKeys)
Returns a map of (record-key -> secondary-key) for the provided record keys.
|
protected abstract Map<String,String> |
getSecondaryKeysForRecordKeys(List<String> recordKeys,
String partitionName) |
protected StorageConfiguration<?> |
getStorageConf() |
boolean |
isMetadataTableInitialized() |
Map<String,List<HoodieRecordGlobalLocation>> |
readRecordIndex(List<String> recordKeys)
Reads record keys from record-level index.
|
Map<String,List<HoodieRecordGlobalLocation>> |
readSecondaryIndex(List<String> secondaryKeys,
String partitionName)
Get record-location using secondary-index and record-index
|
extractPartitionValues, getPathPartitionLevelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createFSBackedTableMetadata, createHoodieBackedTableMetadata, getAllRecordsByKeys, getDatasetBasePath, getDataTableBasePathFromMetadataTable, getLatestCompactionTime, getMetadataTableBasePath, getMetadataTableBasePath, getNumFileGroupsForPartition, getPartitionPathWithPathPrefixes, getPartitionPathWithPathPrefixUsingFilterExpression, getRecordsByKeyPrefixes, getSyncedInstantTime, isMetadataTable, isMetadataTable, resetcloseprotected final HoodieTableMetaClient dataMetaClient
protected final Option<HoodieMetadataMetrics> metrics
protected final HoodieMetadataConfig metadataConfig
protected boolean isMetadataTableInitialized
protected final boolean hiveStylePartitioningEnabled
protected final boolean urlEncodePartitioningEnabled
protected BaseTableMetadata(HoodieEngineContext engineContext, HoodieStorage storage, HoodieMetadataConfig metadataConfig, String dataBasePath)
protected HoodieEngineContext getEngineContext()
public List<String> getAllPartitionPaths() throws IOException
If the Metadata Table is enabled, the listing is retrieved from the stored metadata. Otherwise, the list of
partitions is retrieved directly from the underlying FileSystem.
On any errors retrieving the listing from the metadata, defaults to using the file system listings.
IOExceptionpublic List<StoragePathInfo> getAllFilesInPartition(StoragePath partitionPath) throws IOException
If the Metadata Table is enabled, the listing is retrieved from the stored metadata. Otherwise, the list of
partitions is retrieved directly from the underlying FileSystem.
On any errors retrieving the listing from the metadata, defaults to using the file system listings.
partitionPath - The absolute path of the partition to listIOExceptionpublic Map<String,List<StoragePathInfo>> getAllFilesInPartitions(Collection<String> partitions) throws IOException
HoodieTableMetadataIOExceptionpublic Option<BloomFilter> getBloomFilter(String partitionName, String fileName) throws HoodieMetadataException
HoodieTableMetadatapartitionName - - Partition namefileName - - File name for which bloom filter needs to be retrievedHoodieMetadataExceptionpublic Map<Pair<String,String>,BloomFilter> getBloomFilters(List<Pair<String,String>> partitionNameFileNameList) throws HoodieMetadataException
HoodieTableMetadatapartitionNameFileNameList - - List of partition and file name pair for which bloom filters need to be retrievedHoodieMetadataExceptionpublic Map<Pair<String,String>,HoodieMetadataColumnStats> getColumnStats(List<Pair<String,String>> partitionNameFileNameList, String columnName) throws HoodieMetadataException
HoodieTableMetadatapartitionNameFileNameList - - List of partition and file name pair for which bloom filters need to be retrievedcolumnName - - Column name for which stats are neededHoodieMetadataExceptionpublic Map<String,List<HoodieRecordGlobalLocation>> readRecordIndex(List<String> recordKeys)
If the Metadata Table is not enabled, an exception is thrown to distinguish this from the absence of the key.
recordKeys - The list of record keys to readpublic Map<String,List<HoodieRecordGlobalLocation>> readSecondaryIndex(List<String> secondaryKeys, String partitionName)
If the Metadata Table is not enabled, an exception is thrown to distinguish this from the absence of the key.
secondaryKeys - The list of secondary keys to readpublic Map<String,String> getSecondaryKeys(List<String> recordKeys)
protected List<String> fetchAllPartitionPaths()
protected abstract Option<HoodieRecord<HoodieMetadataPayload>> getRecordByKey(String key, String partitionName)
protected abstract Map<String,HoodieRecord<HoodieMetadataPayload>> getRecordsByKeys(List<String> keys, String partitionName)
protected abstract Map<String,String> getSecondaryKeysForRecordKeys(List<String> recordKeys, String partitionName)
protected abstract Map<String,List<HoodieRecord<HoodieMetadataPayload>>> getSecondaryIndexRecords(List<String> keys, String partitionName)
public HoodieMetadataConfig getMetadataConfig()
protected StorageConfiguration<?> getStorageConf()
protected String getLatestDataInstantTime()
public boolean isMetadataTableInitialized()
Copyright © 2024 The Apache Software Foundation. All rights reserved.