|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.sparql.benchmarking.operations.AbstractOperationCallable<T>
net.sf.sparql.benchmarking.operations.query.callables.AbstractQueryCallable<T>
net.sf.sparql.benchmarking.operations.query.callables.WrapperQueryCallable<T,TCallable>
T - Options typeTCallable - Callable typepublic abstract class WrapperQueryCallable<T extends Options,TCallable extends AbstractQueryCallable<T>>
A decorator to allow query callables to have parts of their behaviour modified without extending them directly. This is useful for making decorators that change behaviour for both local and remote queries.
Note that we specifically prevent decoration of the call() method
because we want it to call our versions of the relevant protected methods. If
we simply decorated this method and called call() on the underlying
callable then its versions of those methods would be called rather than our
decorated versions and the decorator would have no effect.
| Constructor Summary | |
|---|---|
WrapperQueryCallable(Runner<T> runner,
T options,
TCallable callable)
Creates a new decorator |
|
| Method Summary | |
|---|---|
QueryRun |
call()
Runs the Query counting the number of Results |
protected long |
countResults(T options,
boolean result)
Counts the results for queries that return a boolean |
protected long |
countResults(T options,
Model m)
Counts results for queries that return a model. |
protected long |
countResults(T options,
ResultSet rset)
Counts results for queries that return a result set |
protected QueryExecution |
createQueryExecution(Query query)
Creates the query execution to use for the query |
protected void |
customizeRequest(QueryExecution qe)
Provides derived implementations the option to customize the query execution before actually executing the query e.g. |
protected Query |
getQuery()
Gets the query to be run |
| Methods inherited from class net.sf.sparql.benchmarking.operations.AbstractOperationCallable |
|---|
cancel, getOptions, getRunner, isCancelled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WrapperQueryCallable(Runner<T> runner,
T options,
TCallable callable)
runner - Runneroptions - Optionscallable - Callable to decorate| Method Detail |
|---|
public final QueryRun call()
AbstractQueryCallable
call in interface Callable<OperationRun>call in class AbstractQueryCallable<T extends Options>protected Query getQuery()
AbstractQueryCallable
getQuery in class AbstractQueryCallable<T extends Options>
protected long countResults(T options,
boolean result)
AbstractQueryCallable
The default implementation always returns 1
countResults in class AbstractQueryCallable<T extends Options>options - Optionsresult - Result
protected long countResults(T options,
Model m)
AbstractQueryCallableThe default implementation returns the size of the model
countResults in class AbstractQueryCallable<T extends Options>options - Optionsm - Model
protected long countResults(T options,
ResultSet rset)
AbstractQueryCallable
The default implementation either returns OperationRun.UNKNOWN if
the options indicate that counting is disabled or iterates over the
results to count them.
countResults in class AbstractQueryCallable<T extends Options>options - Optionsrset - Result Set
protected void customizeRequest(QueryExecution qe)
AbstractQueryCallableThe default implementation does nothing.
customizeRequest in class AbstractQueryCallable<T extends Options>qe - Query Executionprotected QueryExecution createQueryExecution(Query query)
AbstractQueryCallable
createQueryExecution in class AbstractQueryCallable<T extends Options>query - Query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||