public class FileSystemBackedTableMetadata extends AbstractHoodieTableMetadata
HoodieTableMetadata based file-system-backed table metadata.caseSensitive, dataBasePath, engineContext, storage, storageConfEMPTY_PARTITION_NAME, METADATA_TABLE_NAME_SUFFIX, NON_PARTITIONED_NAME, RECORDKEY_PARTITION_LIST, SOLO_COMMIT_TIMESTAMP| Constructor and Description |
|---|
FileSystemBackedTableMetadata(HoodieEngineContext engineContext,
HoodieStorage storage,
String datasetBasePath,
boolean assumeDatePartitioning) |
FileSystemBackedTableMetadata(HoodieEngineContext engineContext,
HoodieTableConfig tableConfig,
HoodieStorage storage,
String datasetBasePath,
boolean assumeDatePartitioning) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
List<StoragePathInfo> |
getAllFilesInPartition(StoragePath partitionPath)
Fetch all the files at the given partition path, per the latest snapshot of the metadata.
|
Map<String,List<StoragePathInfo>> |
getAllFilesInPartitions(Collection<String> partitionPaths)
Fetch all files for given partition paths.
|
List<String> |
getAllPartitionPaths()
Fetch list of all partition paths, per the latest snapshot of the metadata.
|
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.
|
Option<String> |
getLatestCompactionTime()
Returns the timestamp of the latest compaction.
|
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. |
HoodieData<HoodieRecord<HoodieMetadataPayload>> |
getRecordsByKeyPrefixes(List<String> keyPrefixes,
String partitionName,
boolean shouldLoadInMemory)
Fetch records by key prefixes.
|
HoodieStorage |
getStorage() |
Option<String> |
getSyncedInstantTime()
Get the instant time to which the metadata is synced w.r.t data timeline.
|
Map<String,HoodieRecordGlobalLocation> |
readRecordIndex(List<String> recordKeys)
Returns the location of record keys which are found in the record index.
|
void |
reset()
Clear the states of the table metadata.
|
extractPartitionValues, getPathPartitionLevelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createFSBackedTableMetadata, createHoodieBackedTableMetadata, getDatasetBasePath, getDataTableBasePathFromMetadataTable, getMetadataTableBasePath, getMetadataTableBasePath, isMetadataTablepublic FileSystemBackedTableMetadata(HoodieEngineContext engineContext, HoodieTableConfig tableConfig, HoodieStorage storage, String datasetBasePath, boolean assumeDatePartitioning)
public FileSystemBackedTableMetadata(HoodieEngineContext engineContext, HoodieStorage storage, String datasetBasePath, boolean assumeDatePartitioning)
public HoodieStorage getStorage()
public List<StoragePathInfo> getAllFilesInPartition(StoragePath partitionPath) throws IOException
HoodieTableMetadataIOExceptionpublic List<String> getAllPartitionPaths() throws IOException
HoodieTableMetadataIOExceptionpublic List<String> getPartitionPathWithPathPrefixUsingFilterExpression(List<String> relativePathPrefixes, Types.RecordType partitionFields, Expression expression) throws IOException
HoodieTableMetadataExpression.IOExceptionpublic List<String> getPartitionPathWithPathPrefixes(List<String> relativePathPrefixes)
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.
public Map<String,List<StoragePathInfo>> getAllFilesInPartitions(Collection<String> partitionPaths) throws IOException
HoodieTableMetadataIOExceptionpublic Option<String> getSyncedInstantTime()
HoodieTableMetadatapublic Option<String> getLatestCompactionTime()
HoodieTableMetadatapublic void reset()
HoodieTableMetadatapublic 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 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.public Map<String,HoodieRecordGlobalLocation> readRecordIndex(List<String> recordKeys)
HoodieTableMetadatapublic int getNumFileGroupsForPartition(MetadataPartitionType partition)
HoodieTableMetadataCopyright © 2024 The Apache Software Foundation. All rights reserved.