Skip to content

Commit 230a437

Browse files
authored
GH-5234: fix limited programmatic configuration support of FedX source selection cache (#5235)
2 parents af17bfa + a22d277 commit 230a437

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tools/federation/src/main/java/org/eclipse/rdf4j/federated/cache/SourceSelectionMemoryCache.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import java.util.Map;
1414
import java.util.concurrent.ExecutionException;
15+
import java.util.function.Supplier;
1516

1617
import org.eclipse.rdf4j.federated.endpoint.Endpoint;
1718
import org.eclipse.rdf4j.federated.exception.FedXRuntimeException;
@@ -49,6 +50,14 @@ public SourceSelectionMemoryCache(String cacheSpec) {
4950
this.cache = CacheBuilder.from(CacheBuilderSpec.parse(cacheSpec)).build();
5051
}
5152

53+
/**
54+
*
55+
* @param cacheSupplier provider for an instantiated Guava cache
56+
*/
57+
public SourceSelectionMemoryCache(Supplier<Cache<SubQuery, Entry>> cacheSupplier) {
58+
this.cache = cacheSupplier.get();
59+
}
60+
5261
@Override
5362
public StatementSourceAssurance getAssurance(SubQuery subQuery, Endpoint endpoint) {
5463

0 commit comments

Comments
 (0)