Q - the type of query that is being cachedS - the type of answer being cachedpublic interface QueryCache<Q extends ReasonerQueryImpl,S extends Iterable<ConceptMap>>
Generic interface query caches. Defines two basic operations: - GET(Query) - RECORD(Query, Answer).
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the cache
|
boolean |
contains(Q query)
Query cache containment check
|
S |
getAnswers(Q query)
retrieve (possibly) cached answers for provided query
|
java.util.stream.Stream<ConceptMap> |
getAnswerStream(Q query) |
Set<Q> |
getQueries() |
void |
merge(QueryCacheBase<Q,S> c2)
Perform cache union
|
ConceptMap |
record(Q query,
ConceptMap answer)
record single answer to a specific query
|
S |
record(Q query,
S answers)
record answer iterable for a specific query and retrieve the updated answers
|
java.util.stream.Stream<ConceptMap> |
record(Q query,
java.util.stream.Stream<ConceptMap> answers)
record answer stream for a specific query and retrieve the updated stream
|
S record(Q query, S answers)
query - to be recordedanswers - to this queryjava.util.stream.Stream<ConceptMap> record(Q query, java.util.stream.Stream<ConceptMap> answers)
query - to be recordedanswers - answer stream of the queryConceptMap record(Q query, ConceptMap answer)
query - of interestanswer - to this queryS getAnswers(Q query)
query - for which to retrieve answersjava.util.stream.Stream<ConceptMap> getAnswerStream(Q query)
boolean contains(Q query)
query - to be checked for containmentvoid merge(QueryCacheBase<Q,S> c2)
c2 - union right operandvoid clear()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.