Skip to content

Commit

Permalink
[core] Check bucket only cache enabled for scan in write
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Aug 11, 2024
1 parent c4ef181 commit cd6808b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ public Factory(
this.cache = cache;
}

public boolean isCacheEnabled() {
return cache != null;
}

public ManifestFile create() {
RowType entryType = VersionedObjectSerializer.versionType(ManifestEntry.schema());
return new ManifestFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public FileStoreScan withBucketFilter(Filter<Integer> bucketFilter) {

@Override
public FileStoreScan withPartitionBucket(BinaryRow partition, int bucket) {
if (manifestCacheFilter != null) {
if (manifestCacheFilter != null && manifestFileFactory.isCacheEnabled()) {
checkArgument(
manifestCacheFilter.test(partition, bucket),
String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
Expand Down

0 comments on commit cd6808b

Please sign in to comment.