Q - the query typeI - the input data typeS - the solution data typepublic interface StreamProcessor<Q,I,S>
| Modifier and Type | Interface and Description |
|---|---|
static class |
StreamProcessor.IncompatibleQueryException
An exception thrown when a valid query is incompatible with a QueryEngine implementation
|
static class |
StreamProcessor.InvalidQueryException
An exception thrown when a query is not syntactically valid
|
| Modifier and Type | Field and Description |
|---|---|
static int |
INFINITE_TTL
A special time-to-live value for statements or queries which are valid indefinitely.
|
static long |
NEVER_EXPIRE
A special value representing an infinitely remote expiration time
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addInputs(int ttl,
I... inputs)
Adds new input data to this query engine.
|
Subscription |
addQuery(int ttl,
Q query,
java.util.function.BiConsumer<S,Long> consumer)
Adds a new query subscription to this query engine
|
void |
clear()
Removes all triple patterns along with their associated partial solutions, queries, and subscriptions
|
void |
setClock(java.util.function.Supplier<Long> clock)
Sets the clock used by this query engine to determine the expiration of queries and solutions,
overriding a default clock (e.g.
|
static final int INFINITE_TTL
static final long NEVER_EXPIRE
void clear()
Subscription addQuery(int ttl, Q query, java.util.function.BiConsumer<S,Long> consumer) throws IOException, StreamProcessor.IncompatibleQueryException, StreamProcessor.InvalidQueryException
ttl - the time-to-live of the generated subscription, in seconds.
If ttl is greater than 0, the query has a finite lifetime and will be
automatically unregistered at the end of that lifetime.
Note: the query engine may be configured to reject a ttl which is too high, including 0 (infinite).query - the query to addconsumer - a handler for future query solutions together with their expiration timeStreamProcessor.InvalidQueryException - if the query is not validStreamProcessor.IncompatibleQueryException - if the query is valid,
but it is not supported by this query engineIOException - if there is a problem communicating with this query engine
(for example, if there are network operations involved)boolean addInputs(int ttl,
I... inputs)
ttl - the time-to-live of the inputs, in seconds.
If ttl is greater than 0, any partial solutions which are computed in response to those inputs
have a finite lifetime, and will expire from the index at the end of that lifetime.inputs - the input data to add. Inputs are added in array ordervoid setClock(java.util.function.Supplier<Long> clock)
clock - the new clockCopyright © 2016. All Rights Reserved.