public class SourceSelectionMemoryCache extends Object implements SourceSelectionCache
SourceSelectionCache which uses an in memory Guava Cache as data structure to
maintain information.SourceSelectionCache.StatementSourceAssurance| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CACHE_SPEC |
| Constructor and Description |
|---|
SourceSelectionMemoryCache() |
SourceSelectionMemoryCache(String cacheSpec) |
| Modifier and Type | Method and Description |
|---|---|
SourceSelectionCache.StatementSourceAssurance |
getAssurance(SubQuery subQuery,
Endpoint endpoint)
Ask the cache if a given endpoint can provide results for a
SubQuery. |
void |
updateInformation(SubQuery subQuery,
Endpoint endpoint,
boolean hasStatements)
|
public static final String DEFAULT_CACHE_SPEC
public SourceSelectionMemoryCache()
public SourceSelectionMemoryCache(String cacheSpec)
cacheSpec - a Guava compatible CacheBuilderSpec, if null the
DEFAULT_CACHE_SPEC is usedpublic SourceSelectionCache.StatementSourceAssurance getAssurance(SubQuery subQuery, Endpoint endpoint)
SourceSelectionCacheSubQuery.
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_STATEMENTS in order to trigger a remote check.
getAssurance in interface SourceSelectionCacheSourceSelectionCache.StatementSourceAssurancepublic void updateInformation(SubQuery subQuery, Endpoint endpoint, boolean hasStatements)
SourceSelectionCacheSubQuery and Endpoint.
Implementations must make sure that any operations are thread-safe
updateInformation in interface SourceSelectionCacheCopyright © 2015-2022 Eclipse Foundation. All Rights Reserved.