public abstract class RDFStreamProcessor<C,Q> extends BasicStreamProcessor<String,C,Q,org.openrdf.model.Statement,org.openrdf.query.BindingSet>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
RDFStreamProcessor.Counter |
static class |
RDFStreamProcessor.Quantity |
StreamProcessor.IncompatibleQueryException, StreamProcessor.InvalidQueryException| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
logger |
INFINITE_TTL, NEVER_EXPIRE| Modifier | Constructor and Description |
|---|---|
protected |
RDFStreamProcessor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addInputs(int ttl,
org.openrdf.model.Statement... inputs) |
Subscription |
addQuery(int ttl,
String queryStr,
java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) |
protected Subscription |
addQueryNative(int ttl,
C sparqlQuery,
java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) |
protected abstract boolean |
addTuple(org.openrdf.model.Value[] tuple,
int ttl,
long now)
Adds a tuple to an internal index, possibly generating new solutions
|
protected long |
beginOperation() |
protected void |
clearCounters() |
protected abstract BasicSubscription<C,Q,org.openrdf.query.BindingSet> |
createSubscription(int ttl,
C sparqlQuery,
java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) |
long |
get(RDFStreamProcessor.Quantity quantity)
Retrieves a quantity tracked when "performance metrics" are enabled
|
protected long |
getNow() |
protected void |
handleSolution(java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer,
org.openrdf.query.BindingSet solution,
long expirationTime) |
protected void |
increment(RDFStreamProcessor.Counter counter,
boolean logChange) |
protected void |
incrementQueries() |
protected void |
incrementSolutions() |
protected void |
incrementStatements() |
protected boolean |
isActive() |
protected void |
logEntry() |
protected void |
logHeader() |
protected abstract C |
parseQuery(String queryStr) |
void |
setClock(java.util.function.Supplier<Long> clock) |
void |
setDoPerformanceMetrics(boolean b) |
void |
setDoUseCompactLogFormat(boolean b) |
void |
shutDown() |
protected long |
toExpirationTime(int ttl,
long now) |
renew, unregisterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearprotected static final Logger logger
protected boolean isActive()
public void shutDown()
protected abstract C parseQuery(String queryStr) throws StreamProcessor.InvalidQueryException, StreamProcessor.IncompatibleQueryException
protected abstract BasicSubscription<C,Q,org.openrdf.query.BindingSet> createSubscription(int ttl, C sparqlQuery, java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer)
protected abstract boolean addTuple(org.openrdf.model.Value[] tuple,
int ttl,
long now)
tuple - the tuple to addttl - the time-to-live in secondsnow - the current time in millisecondspublic void setClock(java.util.function.Supplier<Long> clock)
public void setDoUseCompactLogFormat(boolean b)
b - whether performance metadata (if enabled) should be output only when new solutions are computed,
and not every time a statement is added.
This makes the log much smaller.public void setDoPerformanceMetrics(boolean b)
b - whether to output performance metadata
as new statements are added to the query engine and solutions are found
If enabled, this allows fine details query latency and throughput, memory usage,
and other performance variables to be studied.public Subscription addQuery(int ttl, String queryStr, java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) throws StreamProcessor.IncompatibleQueryException, StreamProcessor.InvalidQueryException, IOException
protected Subscription addQueryNative(int ttl, C sparqlQuery, java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) throws IOException
IOExceptionpublic long get(RDFStreamProcessor.Quantity quantity)
quantity - the quantity to retrievepublic boolean addInputs(int ttl,
org.openrdf.model.Statement... inputs)
protected void increment(RDFStreamProcessor.Counter counter, boolean logChange)
protected void incrementQueries()
protected void incrementStatements()
protected void incrementSolutions()
protected long beginOperation()
protected long getNow()
protected void logEntry()
protected void logHeader()
protected long toExpirationTime(int ttl,
long now)
protected void handleSolution(java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer, org.openrdf.query.BindingSet solution, long expirationTime)
protected void clearCounters()
Copyright © 2016. All Rights Reserved.