public class OptionsImpl extends Object implements Options
DEFAULT_FORMAT_ASK, DEFAULT_FORMAT_GRAPH, DEFAULT_FORMAT_SELECT, DEFAULT_HALT_BEHAVIOUR, DEFAULT_LIMIT, DEFAULT_MAX_DELAY, DEFAULT_PARALLEL_THREADS, DEFAULT_SANITY_CHECKS, DEFAULT_TIMEOUT| Constructor and Description |
|---|
OptionsImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ProgressListener listener)
Adds a Progress Listener if it is not already registered
|
<T extends Options> |
copy()
Makes a copy of the options
|
protected void |
copyStandardOptions(OptionsImpl copy)
Copies standard options across from this instance
|
boolean |
getAllowCompression()
Gets whether the client will allow the server to return Deflate/GZip
compressed responses
|
HttpAuthenticator |
getAuthenticator()
Gets the HTTP authenticator in use
|
String |
getCustomEndpoint(String name)
Gets a custom endpoint
|
Map<String,String> |
getCustomEndpoints()
Gets an unmodifiable copy of the defined custom endpoints
|
Map<String,Object> |
getCustomSettings()
Gets a map that may be used to get/set custom settings
|
Dataset |
getDataset()
Gets a dataset that is used for in-memory queries and updates
|
boolean |
getEnsureAbsoluteURIs()
Gets whether the API should ensure that relative URIs are presented as
absolute URIs to services the harness interacts with
|
ExecutorService |
getExecutor()
Gets the in-use executor for running queries and query mixes in threads
using the Java concurrent framework
|
long |
getGlobalOrder()
Gets the Global Run Order
|
String |
getGraphStoreEndpoint()
Gets the SPARQL graph store protocol endpoint that is in use
|
boolean |
getHaltAny()
Gets Halt on Any behavior
|
HaltBehaviour |
getHaltBehaviour()
Gets the Halting Behaviour
|
boolean |
getHaltOnError()
Gets the Halt on Error behavior
|
boolean |
getHaltOnTimeout()
Gets the Halt on Timeout behavior
|
long |
getLimit()
Gets the LIMIT to impose on queries
|
List<ProgressListener> |
getListeners()
Gets the Progress Listeners registered
|
long |
getLocalLimit()
Gets the limit on the number of query results that will be counted
|
int |
getMaxDelay()
Gets the maximum delay between operations
|
OperationMixRunner |
getMixRunner()
Gets the operation mix runner to use, if
null is returned then
the default DefaultOperationMixRunner should be used |
boolean |
getNoCount()
Gets whether query results are counted or just thrown away
|
OperationMix |
getOperationMix()
Gets the Query Mix that is used
|
OperationRunner |
getOperationRunner()
Gets the operation runner to use, if
null is returned then the
default OperationRunner should be used |
int |
getParallelThreads()
Gets the number of parallel threads used for testing
|
String |
getQueryEndpoint()
Gets the SPARQL query endpoint that is in use
|
boolean |
getRandomizeOrder()
Gets whether operation order should be randomized
|
String |
getResultsAskFormat()
Gets the Results format used for operations that make ASK queries
|
String |
getResultsGraphFormat()
Gets the Results format used for operations that make CONSTRUCT/DESCRIBE
queries or that retrieve RDF graphs
|
String |
getResultsSelectFormat()
Gets the Results format used for operations that make SELECT queries
|
int |
getSanityCheckLevel()
Gets the Sanity Checking Level
|
OperationMix |
getSetupMix()
Gets the setup mix to be run,
null indicates no setup mix is
requested. |
OperationMix |
getTeardownMix()
Gets the tear down mix to be run,
null indicates no tear down mix
is requested. |
int |
getTimeout()
Gets the timeout for operations, a zero/negative value indicates no
timeout
|
String |
getUpdateEndpoint()
Gets the SPARQL Update endpoint that is in use
|
void |
removeListener(ProgressListener listener)
Removes a Progress Listener if it is registered
|
void |
resetGlobalOrder()
Resets the global run order
|
void |
setAllowCompression(boolean allowed)
Sets whether the client will allow the server to return Deflate/GZip
compressed responses
|
void |
setAuthenticator(HttpAuthenticator authenticator)
Sets the HTTP authenticator used
|
void |
setCustomEndpoint(String name,
String endpoint)
Sets a custom defined endpoint
|
void |
setDataset(Dataset dataset)
Sets a dataset to be used for in-memory queries and updates
|
void |
setEnsureAbsoluteURIs(boolean ensureAbsolute)
Sets whether the API should ensure that relative URIs are presented as
absolute URIs to services the harness interacts with
|
void |
setGraphStoreEndpoint(String endpoint)
Gets the SPARQL graph store protocol endpoint that is in use
|
void |
setHaltAny(boolean halt)
Sets Halt on Any behavior, if set to true sets Halt on Error and Halt on
Timeout to true as well
|
void |
setHaltBehaviour(HaltBehaviour behaviour)
Sets the Halting Behaviour
|
void |
setHaltOnError(boolean halt)
Sets the Halt on Error behavior
|
void |
setHaltOnTimeout(boolean halt)
Sets the Halt on Timeout behavior
|
void |
setLimit(long limit)
Sets the LIMIT to impose on queries
|
void |
setLocalLimit(long limit)
Sets the limit on the number of query results that will be counted
|
void |
setMaxDelay(int milliseconds)
Sets the maximum delay between operations
|
void |
setMixRunner(OperationMixRunner runner)
Sets the operation mix runner to use, if set to
null then the
default DefaultOperationMixRunner should be used |
void |
setNoCount(boolean noCount)
Sets whether query results are counted or just thrown away
|
void |
setOperationMix(OperationMix queries)
Sets the Query Mix to use
|
void |
setOperationRunner(OperationRunner runner)
Sets the operation runner to use, if set to
null then the default
DefaultOperationRunner should be used |
void |
setParallelThreads(int threads)
Sets the number of parallel threads used for testing
|
void |
setQueryEndpoint(String endpoint)
Sets the SPARQL query endpoint to be used
|
void |
setRandomizeOrder(boolean randomize)
Sets whether operation order should be randomized
|
void |
setResultsAskFormat(String contentType)
Sets the Results format to be used for operations that make ASK queries
|
void |
setResultsGraphFormat(String contentType)
Sets the Results format used for operations that CONSTRUCT/DESCRIBE
queries or that retrieve RDF graphs
|
void |
setResultsSelectFormat(String contentType)
Sets the Results format to be used for operations that make SELECT
queries
|
void |
setSanityCheckLevel(int level)
Sets the Sanity Checking level
|
void |
setSetupMix(OperationMix mix)
Sets the setup mix that will be run once before testing starts.
|
void |
setTeardownMix(OperationMix mix)
Sets the tear down mix that will be run once after testing completes
successfully.
|
void |
setTimeout(int timeout)
Sets the timeout for operations, a zero/negative value indicates no
timeout
|
void |
setUpdateEndpoint(String endpoint)
Sets the SPARQL update endpoint that is in use
|
public void addListener(ProgressListener listener)
OptionsaddListener in interface Optionslistener - Progress Listenerpublic <T extends Options> T copy()
OptionsWhile this is guaranteed to take a copy of primitive typed properties there is no guarantee that it takes a copy of reference types so changing some properties will still affect the original options. This method is primarily intended for use in cases where you need to tweak an option without interfering with other consumers of the options which is particularly relevant when running multi-threaded testing.
protected final void copyStandardOptions(OptionsImpl copy)
Primarily intended for use by derived implementations which extend the basic options to make it easier for them to create copies of themselves.
copy - Copy to copy topublic boolean getAllowCompression()
OptionsgetAllowCompression in interface Optionspublic HttpAuthenticator getAuthenticator()
OptionsgetAuthenticator in interface Optionspublic String getCustomEndpoint(String name)
OptionsgetCustomEndpoint in interface Optionsname - Endpoint namepublic Map<String,String> getCustomEndpoints()
Options
Custom endpoints are a more specific form of the
Options.getCustomSettings() and provide a slightly more user friendly
and type safe interface when the custom setting to be defined has a
string value.
getCustomEndpoints in interface Optionspublic Map<String,Object> getCustomSettings()
Options
This is provided so custom operations may be created that can share state
or that need custom settings to be provided and can't modify/extend the
standard Options interface since they want to run with existing
standard runners.
getCustomSettings in interface Optionspublic Dataset getDataset()
OptionsgetDataset in interface Optionspublic boolean getEnsureAbsoluteURIs()
OptionsgetEnsureAbsoluteURIs in interface Optionspublic ExecutorService getExecutor()
OptionsgetExecutor in interface Optionspublic long getGlobalOrder()
OptionsCalled elsewhere so that mix runs and operation runs record what order they were run in
getGlobalOrder in interface Optionspublic String getGraphStoreEndpoint()
OptionsgetGraphStoreEndpoint in interface Optionspublic boolean getHaltAny()
OptionsgetHaltAny in interface Optionspublic HaltBehaviour getHaltBehaviour()
OptionsgetHaltBehaviour in interface Optionspublic boolean getHaltOnError()
OptionsgetHaltOnError in interface Optionspublic boolean getHaltOnTimeout()
OptionsgetHaltOnTimeout in interface Optionspublic long getLimit()
Optionspublic long getLocalLimit()
Options
This setting provides a compromise between enforcing a limit on actual
queries and not counting results at all. If you impose a limit on queries
via the Options.getLimit()/Options.setLimit(long) option it can change
how a store evaluates a query because you are asking it to do less work.
On the other hand not counting results at all via the
Options.getNoCount()/Options.setNoCount(boolean) option can yield
unrealistic results because often a store can very quickly produce the
first result but producing many results may require substantially more
work.
getLocalLimit in interface Optionspublic List<ProgressListener> getListeners()
OptionsgetListeners in interface Optionspublic int getMaxDelay()
OptionsgetMaxDelay in interface Optionspublic OperationMixRunner getMixRunner()
Optionsnull is returned then
the default DefaultOperationMixRunner should be usedgetMixRunner in interface Optionspublic boolean getNoCount()
OptionsgetNoCount in interface Optionspublic OperationMix getOperationMix()
OptionsgetOperationMix in interface Optionspublic OperationRunner getOperationRunner()
Optionsnull is returned then the
default OperationRunner should be usedgetOperationRunner in interface Optionspublic int getParallelThreads()
OptionsgetParallelThreads in interface Optionspublic String getQueryEndpoint()
OptionsgetQueryEndpoint in interface Optionspublic boolean getRandomizeOrder()
OptionsgetRandomizeOrder in interface Optionspublic String getResultsAskFormat()
OptionsgetResultsAskFormat in interface Optionspublic String getResultsGraphFormat()
OptionsgetResultsGraphFormat in interface Optionspublic String getResultsSelectFormat()
OptionsgetResultsSelectFormat in interface Optionspublic int getSanityCheckLevel()
OptionsgetSanityCheckLevel in interface Optionspublic OperationMix getSetupMix()
Optionsnull indicates no setup mix is
requested.
Operations in a setup mix are guaranteed to be run exactly in the order given. >
getSetupMix in interface Optionspublic OperationMix getTeardownMix()
Optionsnull indicates no tear down mix
is requested.
Operations in a tear down mix are guaranteed to be run exactly in the order given.
getTeardownMix in interface Optionspublic int getTimeout()
OptionsgetTimeout in interface Optionspublic String getUpdateEndpoint()
OptionsgetUpdateEndpoint in interface Optionspublic void removeListener(ProgressListener listener)
OptionsremoveListener in interface Optionslistener - Progress Listenerpublic void resetGlobalOrder()
OptionsUseful for runners that incorporate warmups into their runs
resetGlobalOrder in interface Optionspublic void setAllowCompression(boolean allowed)
OptionssetAllowCompression in interface Optionsallowed - Whether Deflate/GZip compression is allowedpublic void setAuthenticator(HttpAuthenticator authenticator)
OptionssetAuthenticator in interface Optionsauthenticator - HTTP authenticatorpublic void setCustomEndpoint(String name, String endpoint)
OptionssetCustomEndpoint in interface Optionsname - Nameendpoint - Endpoint URIpublic void setDataset(Dataset dataset)
OptionssetDataset in interface Optionsdataset - Datasetpublic void setEnsureAbsoluteURIs(boolean ensureAbsolute)
OptionssetEnsureAbsoluteURIs in interface Optionspublic void setGraphStoreEndpoint(String endpoint)
OptionssetGraphStoreEndpoint in interface Optionspublic void setHaltAny(boolean halt)
OptionssetHaltAny in interface Optionshalt - Whether any issue should cause benchmarking to abortpublic void setHaltBehaviour(HaltBehaviour behaviour)
OptionssetHaltBehaviour in interface Optionsbehaviour - Halting Behaviourpublic void setHaltOnError(boolean halt)
OptionssetHaltOnError in interface Optionshalt - Whether an error should cause benchmarking to abortpublic void setHaltOnTimeout(boolean halt)
OptionssetHaltOnTimeout in interface Optionshalt - Whether a timeout should cause benchmarking to abortpublic void setLimit(long limit)
OptionsValues less than or equal to zero mean existing limits are left unchanged, non-zero values will be imposed iff existing limit is greater than the set limit
public void setLocalLimit(long limit)
Options
This setting provides a compromise between enforcing a limit on actual
queries and not counting results at all. If you impose a limit on queries
via the Options.getLimit()/Options.setLimit(long) option it can change
how a store evaluates a query because you are asking it to do less work.
On the other hand not counting results at all via the
Options.getNoCount()/Options.setNoCount(boolean) option can yield
unrealistic results because often a store can very quickly produce the
first result but producing many results may require substantially more
work.
setLocalLimit in interface Optionspublic void setMaxDelay(int milliseconds)
OptionssetMaxDelay in interface Optionsmilliseconds - Maximum Delay in millisecondspublic void setMixRunner(OperationMixRunner runner)
Optionsnull then the
default DefaultOperationMixRunner should be usedsetMixRunner in interface Optionsrunner - Operation mix runnerpublic void setNoCount(boolean noCount)
OptionsCurrently enabling this only applies to SELECT queries as only SELECT queries stream the results currently, future versions of this tool will also stream CONSTRUCT/DESCRIBE results but this is yet to be implemented
setNoCount in interface OptionsnoCount - Whether query results are countedpublic void setOperationMix(OperationMix queries)
OptionssetOperationMix in interface Optionsqueries - Query Mixpublic void setOperationRunner(OperationRunner runner)
Optionsnull then the default
DefaultOperationRunner should be usedsetOperationRunner in interface Optionsrunner - Operation runnerpublic void setParallelThreads(int threads)
OptionssetParallelThreads in interface Optionsthreads - Number of Parallel Threadspublic void setQueryEndpoint(String endpoint)
OptionssetQueryEndpoint in interface Optionsendpoint - SPARQL query endpoint URIpublic void setRandomizeOrder(boolean randomize)
OptionssetRandomizeOrder in interface Optionsrandomize - Whether operation order should be randompublic void setResultsAskFormat(String contentType)
OptionssetResultsAskFormat in interface OptionscontentType - MIME Type for ASK resultspublic void setResultsGraphFormat(String contentType)
OptionssetResultsGraphFormat in interface OptionscontentType - MIME Type for CONSTRUCT/DESCRIBE results and RDF graphspublic void setResultsSelectFormat(String contentType)
OptionssetResultsSelectFormat in interface OptionscontentType - MIME Type for SELECT resultspublic void setSanityCheckLevel(int level)
OptionssetSanityCheckLevel in interface Optionslevel - Sanity Check Levelpublic void setSetupMix(OperationMix mix)
OptionsOperations in a setup mix are guaranteed to be run exactly in the order given. >
setSetupMix in interface Optionsmix - Setup mixpublic void setTeardownMix(OperationMix mix)
OptionsOperations in a tear down mix are guaranteed to be run exactly in the order given.
setTeardownMix in interface Optionsmix - Tear down mixpublic void setTimeout(int timeout)
OptionssetTimeout in interface Optionstimeout - Timeout in secondspublic void setUpdateEndpoint(String endpoint)
OptionssetUpdateEndpoint in interface Optionsendpoint - SPARQL update endpoint URICopyright © 2016. All rights reserved.