Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

import static java.util.stream.Collectors.toList;
import static org.apache.hudi.common.config.HoodieMetadataConfig.GLOBAL_RECORD_LEVEL_INDEX_ENABLE_PROP;
Expand Down Expand Up @@ -277,7 +276,7 @@ public static <R> HoodieRecord<R> tagRecord(HoodieRecord<R> record, HoodieRecord
* @return List of pairs of candidate keys and positions that are available in the file
*/
public static List<Pair<String, Long>> filterKeysFromFile(StoragePath filePath,
List<String> candidateRecordKeys,
Set<String> candidateRecordKeys,
HoodieStorage storage) throws HoodieIndexException {
checkArgument(FSUtils.isBaseFile(filePath));
List<Pair<String, Long>> foundRecordKeys = new ArrayList<>();
Expand All @@ -288,7 +287,7 @@ public static List<Pair<String, Long>> filterKeysFromFile(StoragePath filePath,
// Load all rowKeys from the file, to double-confirm
if (!candidateRecordKeys.isEmpty()) {
HoodieTimer timer = HoodieTimer.start();
Set<Pair<String, Long>> fileRowKeys = fileReader.filterRowKeys(candidateRecordKeys.stream().collect(Collectors.toSet()));
Set<Pair<String, Long>> fileRowKeys = fileReader.filterRowKeys(candidateRecordKeys);
foundRecordKeys.addAll(fileRowKeys);
log.info("Checked keys against file {}, in {} ms. #candidates ({}) #found ({})", filePath,
timer.endTimer(), candidateRecordKeys.size(), foundRecordKeys.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static org.apache.hudi.metadata.MetadataPartitionType.BLOOM_FILTERS;

Expand All @@ -43,13 +44,13 @@
public class HoodieKeyLookupHandle<T, I, K, O> extends HoodieReadHandle<T, I, K, O> {

private final BloomFilter bloomFilter;
private final List<String> candidateRecordKeys;
private final Set<String> candidateRecordKeys;
private long totalKeysChecked;

public HoodieKeyLookupHandle(HoodieWriteConfig config, HoodieTable<T, I, K, O> hoodieTable,
Pair<String, String> partitionPathFileIDPair) {
super(config, hoodieTable, partitionPathFileIDPair);
this.candidateRecordKeys = new ArrayList<>();
this.candidateRecordKeys = new HashSet<>();
this.totalKeysChecked = 0;
this.bloomFilter = getBloomFilter();
}
Expand Down
Loading