|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rdf.sail.webapp.BigdataRDFContext.AbstractQueryTask
public abstract class BigdataRDFContext.AbstractQueryTask
Abstract base class for running queries handles the timing, pipe, reporting, obtains the connection, and provides the finally {} semantics for each type of query task.
| Field Summary | |
|---|---|
protected ASTContainer |
astContainer
The ASTContainer provides access to the original SPARQL
query, the query model, the query plan, etc. |
protected String |
baseURI
The baseURI is set from the effective request URI. |
protected Charset |
charset
The character encoding to use with the negotiated mimeType
-or- null (it will be null for a binary
encoding). |
protected String |
fileExt
The file extension (without the leading ".") to use with the negotiated mimeType -or- null if this is a
SPARQL UPDATE request |
protected String |
mimeType
The negotiated MIME type to be used for the query response (this does not include the charset encoding) -or- null if
this is a SPARQL UPDATE request. |
protected OutputStream |
os
Where to write the response. |
protected Long |
queryId
The queryId as assigned by the SPARQL end point (rather than the QueryEngine). |
protected UUID |
queryId2
The queryId used by the QueryEngine. |
protected QueryType |
queryType
A symbolic constant indicating the type of query. |
protected javax.servlet.http.HttpServletRequest |
req
The request. |
protected AbstractOperation |
sailQueryOrUpdate
The parsed query. |
long |
timestamp
The timestamp of the view for that namespace against which the query will be run. |
protected boolean |
update
true iff this is a SPARQL UPDATE request. |
| Constructor Summary | |
|---|---|
protected |
BigdataRDFContext.AbstractQueryTask(String namespace,
long timestamp,
String baseURI,
ASTContainer astContainer,
javax.servlet.http.HttpServletRequest req,
OutputStream os)
|
protected |
BigdataRDFContext.AbstractQueryTask(String namespace,
long timestamp,
String baseURI,
ASTContainer astContainer,
QueryType queryType,
String mimeType,
Charset charset,
String fileExt,
javax.servlet.http.HttpServletRequest req,
OutputStream os)
|
| Method Summary | |
|---|---|
Void |
call()
|
protected abstract void |
doQuery(BigdataSailRepositoryConnection cxn,
OutputStream os)
Execute the query. |
protected void |
overrideDataset(AbstractOperation queryOrUpdate)
If the HttpServletRequest included one or more of
then the Dataset for the query is replaced by the
Dataset constructed from those protocol parameters (the
parameters which are recognized are different for query and SPARQL
update). |
protected UUID |
setQueryId(ASTContainer astContainer)
Determines the UUID which will be associated with the
IRunningQuery. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final long timestamp
protected final String baseURI
protected final ASTContainer astContainer
ASTContainer provides access to the original SPARQL
query, the query model, the query plan, etc.
protected final boolean update
true iff this is a SPARQL UPDATE request.
protected final QueryType queryType
protected final String mimeType
null if
this is a SPARQL UPDATE request.
protected final Charset charset
mimeType
-or- null (it will be null for a binary
encoding).
protected final String fileExt
mimeType -or- null if this is a
SPARQL UPDATE request
protected final javax.servlet.http.HttpServletRequest req
protected final OutputStream os
protected final Long queryId
QueryEngine).
protected volatile UUID queryId2
QueryEngine. If the application has
not specified this using QueryHints.QUERYID then this is
assigned and set on the query using QueryHints.QUERYID. This
decision can not be made until we parse the query so the behavior is
handled by the subclasses.
protected AbstractOperation sailQueryOrUpdate
BigdataSailQuery
implementations or BigdataSailUpdate. They all extend
AbstractOperation.
Note: This field is made visible by the volatile write on
queryId2.
| Constructor Detail |
|---|
protected BigdataRDFContext.AbstractQueryTask(String namespace,
long timestamp,
String baseURI,
ASTContainer astContainer,
QueryType queryType,
String mimeType,
Charset charset,
String fileExt,
javax.servlet.http.HttpServletRequest req,
OutputStream os)
namespace - The namespace against which the query will be run.timestamp - The timestamp of the view for that namespace against which
the query will be run.baseURI - The base URI.astContainer - The container with all the information about the submitted
query, including the original SPARQL query, the parse
tree, etc.queryType - The QueryType.mimeType - The MIME type to be used for the response. The caller must
verify that the MIME Type is appropriate for the query
type.charset - The character encoding to use with the negotiated MIME
type (this is null for binary encodings).fileExt - The file extension (without the leading ".") to use with
that MIME Type.req - The request.os - Where to write the data for the query result.
protected BigdataRDFContext.AbstractQueryTask(String namespace,
long timestamp,
String baseURI,
ASTContainer astContainer,
javax.servlet.http.HttpServletRequest req,
OutputStream os)
namespace - The namespace against which the query will be run.timestamp - The timestamp of the view for that namespace against which
the query will be run.baseURI - The base URI.astContainer - The container with all the information about the submitted
query, including the original SPARQL query, the parse
tree, etc.req - The request.os - Where to write the data for the query result.| Method Detail |
|---|
protected void overrideDataset(AbstractOperation queryOrUpdate)
HttpServletRequest included one or more of
Dataset for the query is replaced by the
Dataset constructed from those protocol parameters (the
parameters which are recognized are different for query and SPARQL
update).
queryOrUpdate - The query.protected UUID setQueryId(ASTContainer astContainer)
UUID which will be associated with the
IRunningQuery. If QueryHints.QUERYID has already been
used by the application to specify the UUID then that
UUID is noted. Otherwise, a random UUID is generated
and assigned to the query by binding it on the query hints.
Note: The ability to provide metadata from the ASTContainer
in the StatusServlet or the "EXPLAIN" page depends on the
ability to cross walk the queryIds as established by this method.
query - The query.
UUID which will be associated with the
IRunningQuery.
protected abstract void doQuery(BigdataSailRepositoryConnection cxn,
OutputStream os)
throws Exception
cxn - The connection.os - Where the write the query results.
Exception
public final Void call()
throws Exception
call in interface Callable<Void>Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||