java.lang.Object
org.apache.jena.riot.system.AsyncParserBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.jena.atlas.iterator.IteratorCloseable<Quad>
asyncParseSources
(StreamRDF output) Calling the returned runnable stops parsing.org.apache.jena.atlas.iterator.IteratorCloseable<org.apache.jena.graph.Triple>
int
int
boolean
mutateSources
(Consumer<RDFParserBuilder> mutator) Run an operation on all RDFParserBuilder sources in this builder.setChunkSize
(int chunkSize) The chunk size controls the maxmimum number of elements the parser thread transfers at once to the client iterator's queue.setDaemonMode
(boolean daemonMode) Whether the parser thread should run as a daemon thread.setPrematureDispatch
(Predicate<EltStreamRDF> prematureDispatch) Set a custom dispatch (flush) policy: When the predicate returns true for an element then that element and any gathered data is dispatched immediately.setQueueSize
(int queueSize) The queue size controls the number of chunks the parser thread can read ahead.setSources
(List<RDFParserBuilder> sources) Stream<org.apache.jena.graph.Triple>
-
Constructor Details
-
AsyncParserBuilder
public AsyncParserBuilder() -
AsyncParserBuilder
-
-
Method Details
-
getChunkSize
public int getChunkSize() -
setChunkSize
The chunk size controls the maxmimum number of elements the parser thread transfers at once to the client iterator's queue. The default value (100000) is optimized for throughput however it introduces a delay until the first item arrives. Data can be dispatched prematurely by settingsetPrematureDispatch(Predicate)
. -
getQueueSize
public int getQueueSize() -
setQueueSize
The queue size controls the number of chunks the parser thread can read ahead. A full queue blocks that thread. The default value is 10. -
isDaemonMode
public boolean isDaemonMode() -
setDaemonMode
Whether the parser thread should run as a daemon thread. A JVM will terminate as soon as there are no more non-daemon threads. -
setPrematureDispatch
Set a custom dispatch (flush) policy: When the predicate returns true for an element then that element and any gathered data is dispatched immediately. Before dispatch a check is made whether parsing has been (concurrently) aborted. -
getPrematureDispatch
-
getSources
-
setSources
-
mutateSources
Run an operation on all RDFParserBuilder sources in this builder. Allows for e.g. configuring prefixes, the error handler or the label-to-node strategy -
asyncParseTriples
public org.apache.jena.atlas.iterator.IteratorCloseable<org.apache.jena.graph.Triple> asyncParseTriples() -
asyncParseQuads
-
streamElements
-
streamTriples
-
streamQuads
-
asyncParseSources
Calling the returned runnable stops parsing. The sink will see no further data.
-