Skip to content

Commit 2f6ae3b

Browse files
authored
Propagate iteration cache sync threshold to LMDB store (#5502)
1 parent 9b6b58f commit 2f6ae3b

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbStore.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ public LmdbStore(LmdbStoreConfig config) {
133133
IsolationLevels.SNAPSHOT, IsolationLevels.SERIALIZABLE);
134134
setDefaultIsolationLevel(IsolationLevels.SNAPSHOT_READ);
135135
config.getDefaultQueryEvaluationMode().ifPresent(this::setDefaultQueryEvaluationMode);
136+
if (config.getIterationCacheSyncThreshold() > 0) {
137+
setIterationCacheSyncThreshold(config.getIterationCacheSyncThreshold());
138+
}
136139
EvaluationStrategyFactory evalStrategyFactory = config.getEvaluationStrategyFactory();
137140
if (evalStrategyFactory != null) {
138141
setEvaluationStrategyFactory(evalStrategyFactory);

core/sail/lmdb/src/test/java/org/eclipse/rdf4j/sail/lmdb/config/LmdbStoreConfigTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.eclipse.rdf4j.model.impl.LinkedHashModel;
2323
import org.eclipse.rdf4j.model.util.ModelBuilder;
2424
import org.eclipse.rdf4j.model.util.Values;
25+
import org.eclipse.rdf4j.sail.lmdb.LmdbStore;
26+
import org.junit.jupiter.api.Test;
2527
import org.junit.jupiter.params.ParameterizedTest;
2628
import org.junit.jupiter.params.provider.ValueSource;
2729

@@ -65,6 +67,17 @@ void testThatLmdbStoreConfigParseAndExportValueCacheSize(final int valueCacheSiz
6567

6668
// TODO: Add more tests for other properties
6769

70+
@Test
71+
void setIterationCacheSyncThresholdShouldApplyToCreatedStore() {
72+
final long threshold = 42;
73+
final LmdbStoreConfig config = new LmdbStoreConfig();
74+
config.setIterationCacheSyncThreshold(threshold);
75+
76+
final LmdbStore store = new LmdbStore(config);
77+
78+
assertThat(store.getIterationCacheSyncThreshold()).isEqualTo(threshold);
79+
}
80+
6881
/**
6982
* Generic method to test parsing and exporting of config properties.
7083
*

0 commit comments

Comments
 (0)