Class SourceSelectionMemoryCache
java.lang.Object
org.eclipse.rdf4j.federated.cache.SourceSelectionMemoryCache
- All Implemented Interfaces:
 SourceSelectionCache
An implementation of 
SourceSelectionCache which uses an in memory Guava Cache as data structure to
maintain information.- Author:
 - Andreas Schwarte
 
- 
Nested Class Summary
Nested classes/interfaces inherited from interface SourceSelectionCache
SourceSelectionCache.StatementSourceAssurance - 
Field Summary
Fields - 
Constructor Summary
ConstructorsConstructorDescriptionSourceSelectionMemoryCache(String cacheSpec) SourceSelectionMemoryCache(Supplier<com.google.common.cache.Cache<SubQuery, org.eclipse.rdf4j.federated.cache.SourceSelectionMemoryCache.Entry>> cacheSupplier)  - 
Method Summary
Modifier and TypeMethodDescriptiongetAssurance(SubQuery subQuery, Endpoint endpoint) Ask the cache if a given endpoint can provide results for aSubQuery.voidInvalidate the underlying cachevoidupdateInformation(SubQuery subQuery, Endpoint endpoint, boolean hasStatements)  
- 
Field Details
- 
DEFAULT_CACHE_SPEC
- See Also:
 
 
 - 
 - 
Constructor Details
- 
SourceSelectionMemoryCache
public SourceSelectionMemoryCache() - 
SourceSelectionMemoryCache
- Parameters:
 cacheSpec- a Guava compatibleCacheBuilderSpec, ifnulltheDEFAULT_CACHE_SPECis used
 - 
SourceSelectionMemoryCache
 
 - 
 - 
Method Details
- 
getAssurance
public SourceSelectionCache.StatementSourceAssurance getAssurance(SubQuery subQuery, Endpoint endpoint) Description copied from interface:SourceSelectionCacheAsk the cache if a given endpoint can provide results for aSubQuery.Implementations may infer information by applying logical rules, e.g. if a cache knows that an endpoint can provide statements {s, foaf:name, "Alan"}, it can also provide results for {s, foaf:name, ?name}.
If a cache cannot provide information for the given arguments, it must return
SourceSelectionCache.StatementSourceAssurance.POSSIBLY_HAS_STATEMENTSin order to trigger a remote check.invalid input: '<'/p- Specified by:
 getAssurancein interfaceSourceSelectionCache- Parameters:
 subQuery-endpoint-- Returns:
 - the 
SourceSelectionCache.StatementSourceAssurance 
 - 
updateInformation
Description copied from interface:SourceSelectionCacheUpdate the information for a givenSubQueryandEndpoint.Implementations must make sure that any operations are thread-safe
- Specified by:
 updateInformationin interfaceSourceSelectionCache- Parameters:
 subQuery-endpoint-hasStatements-
 - 
invalidate
public void invalidate()Description copied from interface:SourceSelectionCacheInvalidate the underlying cache- Specified by:
 invalidatein interfaceSourceSelectionCache
 
 -