public class HoodieIndexUtils extends Object
| Constructor and Description |
|---|
HoodieIndexUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkIfValidCommit(HoodieTimeline commitTimeline,
String commitTs)
Check if the given commit timestamp is valid for the timeline.
|
static <R> HoodieRecord<R> |
createNewTaggedHoodieRecord(HoodieRecord<R> oldRecord,
HoodieRecordGlobalLocation location,
HoodieRecord.HoodieRecordType recordType) |
static HoodieIndex |
createUserDefinedIndex(HoodieWriteConfig config) |
static List<Pair<String,Long>> |
filterKeysFromFile(StoragePath filePath,
List<String> candidateRecordKeys,
HoodieStorage storage)
Given a list of row keys and one file, return only row keys existing in that file.
|
static List<Pair<String,HoodieBaseFile>> |
getLatestBaseFilesForAllPartitions(List<String> partitions,
HoodieEngineContext context,
HoodieTable hoodieTable)
Fetches Pair of partition path and
HoodieBaseFiles for interested partitions. |
static List<HoodieBaseFile> |
getLatestBaseFilesForPartition(String partition,
HoodieTable hoodieTable)
Fetches Pair of partition path and
HoodieBaseFiles for interested partitions. |
static List<FileSlice> |
getLatestFileSlicesForPartition(String partition,
HoodieTable hoodieTable)
Fetches Pair of partition path and
FileSlices for interested partitions. |
static <R> HoodieData<HoodieRecord<R>> |
mergeForPartitionUpdatesIfNeeded(HoodieData<Pair<HoodieRecord<R>,Option<HoodieRecordGlobalLocation>>> incomingRecordsAndLocations,
HoodieWriteConfig config,
HoodieTable hoodieTable)
Merge tagged incoming records with existing records in case of partition path updated.
|
static <R> HoodieRecord<R> |
tagAsNewRecordIfNeeded(HoodieRecord<R> record,
Option<HoodieRecordLocation> location)
Get tagged record for the passed in
HoodieRecord. |
static <R> HoodieData<HoodieRecord<R>> |
tagGlobalLocationBackToRecords(HoodieData<HoodieRecord<R>> incomingRecords,
HoodiePairData<String,HoodieRecordGlobalLocation> keyAndExistingLocations,
boolean mayContainDuplicateLookup,
boolean shouldUpdatePartitionPath,
HoodieWriteConfig config,
HoodieTable table) |
static <R> HoodieRecord<R> |
tagRecord(HoodieRecord<R> record,
HoodieRecordLocation location)
Tag the record to an existing location.
|
public static List<HoodieBaseFile> getLatestBaseFilesForPartition(String partition, HoodieTable hoodieTable)
HoodieBaseFiles for interested partitions.partition - Partition of interesthoodieTable - Instance of HoodieTable of interestHoodieBaseFilepublic static List<FileSlice> getLatestFileSlicesForPartition(String partition, HoodieTable hoodieTable)
FileSlices for interested partitions.partition - Partition of interesthoodieTable - Instance of HoodieTable of interestFileSlicepublic static List<Pair<String,HoodieBaseFile>> getLatestBaseFilesForAllPartitions(List<String> partitions, HoodieEngineContext context, HoodieTable hoodieTable)
HoodieBaseFiles for interested partitions.partitions - list of partitions of interestcontext - instance of HoodieEngineContext to usehoodieTable - instance of HoodieTable of interestpublic static <R> HoodieRecord<R> tagAsNewRecordIfNeeded(HoodieRecord<R> record, Option<HoodieRecordLocation> location)
HoodieRecord.record - instance of HoodieRecord for which tagging is requestedlocation - HoodieRecordLocation for the passed in HoodieRecordHoodieRecordpublic static <R> HoodieRecord<R> tagRecord(HoodieRecord<R> record, HoodieRecordLocation location)
public static List<Pair<String,Long>> filterKeysFromFile(StoragePath filePath, List<String> candidateRecordKeys, HoodieStorage storage) throws HoodieIndexException
filePath - - File to filter keys fromcandidateRecordKeys - - Candidate keys to filterstorage - HoodieIndexExceptionpublic static boolean checkIfValidCommit(HoodieTimeline commitTimeline, String commitTs)
The commit timestamp is considered to be valid if: 1. the commit timestamp is present in the timeline, or 2. the commit timestamp is less than the first commit timestamp in the timeline
commitTimeline - The timelinecommitTs - The commit timestamp to checkpublic static HoodieIndex createUserDefinedIndex(HoodieWriteConfig config)
public static <R> HoodieData<HoodieRecord<R>> mergeForPartitionUpdatesIfNeeded(HoodieData<Pair<HoodieRecord<R>,Option<HoodieRecordGlobalLocation>>> incomingRecordsAndLocations, HoodieWriteConfig config, HoodieTable hoodieTable)
public static <R> HoodieData<HoodieRecord<R>> tagGlobalLocationBackToRecords(HoodieData<HoodieRecord<R>> incomingRecords, HoodiePairData<String,HoodieRecordGlobalLocation> keyAndExistingLocations, boolean mayContainDuplicateLookup, boolean shouldUpdatePartitionPath, HoodieWriteConfig config, HoodieTable table)
public static <R> HoodieRecord<R> createNewTaggedHoodieRecord(HoodieRecord<R> oldRecord, HoodieRecordGlobalLocation location, HoodieRecord.HoodieRecordType recordType)
Copyright © 2024 The Apache Software Foundation. All rights reserved.