Skip to content
Merged
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
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ paimon-common/src/main/java/org/apache/paimon/fs/FileRange.java
paimon-common/src/main/java/org/apache/paimon/fs/VectoredReadUtils.java
from http://hadoop.apache.org/ version 2.10.2

paimon-common/src/main/java/org/apache/paimon/lookup/hash/HashLookupStoreWriter.java
paimon-common/src/main/java/org/apache/paimon/lookup/hash/HashLookupStoreReader.java
paimon-common/src/main/java/org/apache/paimon/utils/VarLengthIntUtils.java
from https://github.com/linkedin/PalDB version 1.2.0

Expand Down
6 changes: 0 additions & 6 deletions docs/layouts/shortcodes/generated/core_configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,6 @@
<td>Float</td>
<td>The index load factor for lookup.</td>
</tr>
<tr>
<td><h5>lookup.local-file-type</h5></td>
<td style="word-wrap: break-word;">sort</td>
<td><p>Enum</p></td>
<td>The local file type for lookup.<br /><br />Possible values:<ul><li>"sort": Construct a sorted file for lookup.</li><li>"hash": Construct a hash file for lookup.</li></ul></td>
</tr>
<tr>
<td><h5>lookup.merge-buffer-size</h5></td>
<td style="word-wrap: break-word;">8 mb</td>
Expand Down
36 changes: 0 additions & 36 deletions paimon-api/src/main/java/org/apache/paimon/CoreOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,6 @@ public InlineElement getDescription() {
.withDescription(
"Define partition by table options, cannot define partition on DDL and table options at the same time.");

public static final ConfigOption<LookupLocalFileType> LOOKUP_LOCAL_FILE_TYPE =
key("lookup.local-file-type")
.enumType(LookupLocalFileType.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also remove this enum class from CoreOptions.

.defaultValue(LookupLocalFileType.SORT)
.withDescription("The local file type for lookup.");

public static final ConfigOption<Float> LOOKUP_HASH_LOAD_FACTOR =
key("lookup.hash-load-factor")
.floatType()
Expand Down Expand Up @@ -2465,10 +2459,6 @@ public int cachePageSize() {
return (int) options.get(CACHE_PAGE_SIZE).getBytes();
}

public LookupLocalFileType lookupLocalFileType() {
return options.get(LOOKUP_LOCAL_FILE_TYPE);
}

public MemorySize lookupCacheMaxMemory() {
return options.get(LOOKUP_CACHE_MAX_MEMORY_SIZE);
}
Expand Down Expand Up @@ -3815,32 +3805,6 @@ public InlineElement getDescription() {
}
}

/** Specifies the local file type for lookup. */
public enum LookupLocalFileType implements DescribedEnum {
SORT("sort", "Construct a sorted file for lookup."),

HASH("hash", "Construct a hash file for lookup.");

private final String value;

private final String description;

LookupLocalFileType(String value, String description) {
this.value = value;
this.description = description;
}

@Override
public String toString() {
return value;
}

@Override
public InlineElement getDescription() {
return text(description);
}
}

/** The time unit of materialized table freshness. */
public enum MaterializedTableIntervalFreshnessTimeUnit {
SECOND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.paimon.types.IntType;
import org.apache.paimon.types.RowType;
import org.apache.paimon.utils.BloomFilter;
import org.apache.paimon.utils.Pair;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -84,7 +83,7 @@ protected byte[] intToByteArray(int value) {
return keySerializer.serializeToBytes(reusedKey);
}

protected Pair<String, LookupStoreFactory.Context> writeData(
protected String writeData(
Path tempDir,
CoreOptions options,
byte[][] inputs,
Expand All @@ -102,9 +101,7 @@ protected Pair<String, LookupStoreFactory.Context> writeData(
new CacheManager(MemorySize.ofMebiBytes(10)),
keySerializer.createSliceComparator());

String name =
String.format(
"%s-%s-%s", options.lookupLocalFileType(), valueLength, bloomFilterEnabled);
String name = String.format("%s-%s", valueLength, bloomFilterEnabled);
File file = new File(tempDir.toFile(), UUID.randomUUID() + "-" + name);
LookupStoreWriter writer = factory.createWriter(file, createBloomFiler(bloomFilterEnabled));
int i = 0;
Expand All @@ -120,8 +117,8 @@ protected Pair<String, LookupStoreFactory.Context> writeData(
i = (i + 1) % 2;
}
}
LookupStoreFactory.Context context = writer.close();
return Pair.of(file.getAbsolutePath(), context);
writer.close();
return file.getAbsolutePath();
}

private BloomFilter.Builder createBloomFiler(boolean enabled) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.paimon.testutils.junit.parameterized.Parameters;
import org.apache.paimon.types.IntType;
import org.apache.paimon.types.RowType;
import org.apache.paimon.utils.Pair;

import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -38,10 +37,9 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

import static org.apache.paimon.CoreOptions.LOOKUP_LOCAL_FILE_TYPE;
import static org.assertj.core.api.Assertions.assertThat;

/** Benchmark for measuring the throughput of writing for lookup. */
Expand Down Expand Up @@ -87,43 +85,26 @@ private void readLookupDataBenchmark(byte[][] inputs, byte[][] randomInputs, boo
.setNumWarmupIters(1)
.setOutputPerIteration(true);
for (int valueLength : VALUE_LENGTHS) {
for (CoreOptions.LookupLocalFileType fileType :
CoreOptions.LookupLocalFileType.values()) {
CoreOptions options =
CoreOptions.fromMap(
Collections.singletonMap(
LOOKUP_LOCAL_FILE_TYPE.key(), fileType.name()));
Pair<String, LookupStoreFactory.Context> pair =
writeData(tempDir, options, inputs, valueLength, false, bloomFilterEnabled);
benchmark.addCase(
String.format(
"%s-read-%dB-value-%d-num",
fileType.name(), valueLength, randomInputs.length),
5,
() -> {
try {
readData(
options,
randomInputs,
pair.getLeft(),
pair.getRight(),
nullResult);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}
CoreOptions options = new CoreOptions(new HashMap<>());
String path =
writeData(tempDir, options, inputs, valueLength, false, bloomFilterEnabled);
benchmark.addCase(
String.format("read-%dB-value-%d-num", valueLength, randomInputs.length),
5,
() -> {
try {
readData(options, randomInputs, path, nullResult);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}

benchmark.run();
}

private void readData(
CoreOptions options,
byte[][] randomInputs,
String filePath,
LookupStoreFactory.Context context,
boolean nullResult)
CoreOptions options, byte[][] randomInputs, String filePath, boolean nullResult)
throws IOException {
LookupStoreFactory factory =
LookupStoreFactory.create(
Expand All @@ -133,7 +114,7 @@ private void readData(
.createSliceComparator());

File file = new File(filePath);
LookupStoreReader reader = factory.createReader(file, context);
LookupStoreReader reader = factory.createReader(file);
for (byte[] input : randomInputs) {
if (nullResult) {
assertThat(reader.lookup(input)).isNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@

import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

import static org.apache.paimon.CoreOptions.LOOKUP_LOCAL_FILE_TYPE;

/** Benchmark for measuring the throughput of writing for lookup. */
@ExtendWith(ParameterizedTestExtension.class)
public class LookupWriterBenchmark extends AbstractLookupBenchmark {
Expand Down Expand Up @@ -67,31 +65,23 @@ private void writeLookupDataBenchmark(byte[][] inputs, boolean sameValue) {
.setNumWarmupIters(1)
.setOutputPerIteration(true);
for (int valueLength : VALUE_LENGTHS) {
for (CoreOptions.LookupLocalFileType fileType :
CoreOptions.LookupLocalFileType.values()) {
CoreOptions options =
CoreOptions.fromMap(
Collections.singletonMap(
LOOKUP_LOCAL_FILE_TYPE.key(), fileType.name()));
benchmark.addCase(
String.format(
"%s-write-%dB-value-%d-num",
fileType.name(), valueLength, inputs.length),
5,
() -> {
try {
writeData(
tempDir,
options,
inputs,
valueLength,
sameValue,
bloomFilterEnabled);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}
CoreOptions options = new CoreOptions(new HashMap<>());
benchmark.addCase(
String.format("write-%dB-value-%d-num", valueLength, inputs.length),
5,
() -> {
try {
writeData(
tempDir,
options,
inputs,
valueLength,
sameValue,
bloomFilterEnabled);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}

benchmark.run();
Expand Down
Loading
Loading