public class Runner
extends java.lang.Object
java org.apache.derbyTesting.perf.clients.Runner
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_URL |
private static java.lang.String |
DERBY_EMBEDDED_DRIVER |
private static java.lang.String |
driver
The JDBC driver class to use in the test.
|
private static java.lang.String |
generator
The name of the load generator to use in the test.
|
private static boolean |
init
Flag which tells whether the data needed by this test should be
(re)created.
|
private static java.lang.String |
load
The name of the type of load to use in the test.
|
private static java.util.HashMap<java.lang.String,java.lang.String> |
loadOpts
Map containing load-specific options.
|
private static java.lang.String |
password
Password for connecting to the database.
|
private static int |
requestsPerSecond
The number of requests to issue to the database per second (for the
load generators that take that as an argument).
|
private static int |
steadySec
The number of seconds to collect results.
|
private static int |
threads
The number of client threads to use in the test.
|
private static java.lang.String |
url
The JDBC connection URL to use in the test.
|
private static java.lang.String |
USAGE
String to print when there are errors in the command line arguments.
|
private static java.lang.String |
user
Username for connecting to the database.
|
private static int |
warmupSec
The number of seconds to spend in the warmup phase.
|
Constructor and Description |
---|
Runner() |
Modifier and Type | Method and Description |
---|---|
private static DBFiller |
getDBFiller()
Find the
DBFiller instance for the load specified on the
command line. |
private static LoadGenerator |
getLoadGenerator()
Create a load generator for the load specified on the command line.
|
(package private) static int |
getLoadOpt(java.lang.String option,
int defaultValue)
Get the
int value of the specified option. |
private static int |
getTextType()
Get the data type to be used for sr_select and sr_update types of load.
|
private static boolean |
hasOption(java.lang.String option)
Checks whether the specified option is set.
|
static void |
main(java.lang.String[] args)
Main method which starts the Runner application.
|
private static Client |
newClient()
Create a new client for the load specified on the command line.
|
private static void |
parseArgs(java.lang.String[] args)
Parse the command line arguments and set the state variables to
reflect the arguments.
|
private static void |
parseLoadOpts(java.lang.String optsString)
Parse the load-specific options.
|
private static void |
printUsage(java.io.PrintStream out)
Print the usage string.
|
private static void |
shutdownDatabase()
Shut down the database if it is a Derby embedded database.
|
private static final java.lang.String DERBY_EMBEDDED_DRIVER
private static final java.lang.String DEFAULT_URL
private static java.lang.String driver
private static java.lang.String url
private static java.lang.String user
private static java.lang.String password
private static boolean init
private static java.lang.String load
private static final java.util.HashMap<java.lang.String,java.lang.String> loadOpts
private static java.lang.String generator
private static int threads
private static int requestsPerSecond
private static int warmupSec
private static int steadySec
private static final java.lang.String USAGE
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- the command line argumentsjava.lang.Exception
private static void parseArgs(java.lang.String[] args) throws java.lang.Exception
args
- the command line argumentsjava.lang.Exception
private static void parseLoadOpts(java.lang.String optsString)
loadOpts
.optsString
- the comma-separated list of optionsprivate static boolean hasOption(java.lang.String option)
option
- the name of the optiontrue
if the option is setstatic int getLoadOpt(java.lang.String option, int defaultValue)
int
value of the specified option.option
- the name of the optiondefaultValue
- the value to return if the option is not setjava.lang.NumberFormatException
- if the value is not an int
private static void printUsage(java.io.PrintStream out)
out
- the stream to print the usage string toprivate static int getTextType()
java.sql.Types
data type constantsprivate static DBFiller getDBFiller()
DBFiller
instance for the load specified on the
command line.DBFiller
instanceprivate static Client newClient()
Client
instanceprivate static LoadGenerator getLoadGenerator()
LoadGenerator
instanceprivate static void shutdownDatabase() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.