Skip to content

Commit

Permalink
GH-5234: fix limited config support of FedX source selection cache
Browse files Browse the repository at this point in the history
Add an additional constructor accepting a supplier for an initialized
cache.
  • Loading branch information
aschwarte10 committed Jan 20, 2025
1 parent fbf6bea commit a22d277
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.function.Supplier;

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

/**
*
* @param cacheSupplier provider for an instantiated Guava cache
*/
public SourceSelectionMemoryCache(Supplier<Cache<SubQuery, Entry>> cacheSupplier) {
this.cache = cacheSupplier.get();
}

@Override
public StatementSourceAssurance getAssurance(SubQuery subQuery, Endpoint endpoint) {

Expand Down

0 comments on commit a22d277

Please sign in to comment.