public class Submitter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DELIVERY_SCHEDULE
Offset of Delivery transaction in returned
arrays with run information.
|
private Display |
display
Display to write the output to.
|
private short |
maxW
Scale of the database.
|
static int |
NEW_ORDER
Offset of New Order transaction in returned
arrays with run information.
|
static int |
NEW_ORDER_ROLLBACK
Offset of New Order transaction that rolled back in returned
arrays with run information.
|
private Operations |
ops
How the business transactions are implemented.
|
static int |
ORDER_STATUS_BY_ID
Offset of Order Status by Id transaction in returned
arrays with run information.
|
static int |
ORDER_STATUS_BY_NAME
Offset of Order Status by Name transaction in returned
arrays with run information.
|
static int |
PAYMENT_BY_ID
Offset of Payement by ID transaction in returned
arrays with run information.
|
static int |
PAYMENT_BY_NAME
Offset of Payment by Name transaction in returned
arrays with run information.
|
private OERandom |
rand
My own random number generator.
|
static int |
STOCK_LEVEL
Offset of Stock Level transaction in returned
arrays with run information.
|
private int[] |
transactionCount
Record of how many transactions are implemented.
|
Constructor and Description |
---|
Submitter(Display display,
Operations ops,
OERandom rand,
short maxW)
Create a submitter that has a fixed mix of transactions
at input time.
|
Modifier and Type | Method and Description |
---|---|
void |
clearTransactionCount()
Reset the transaction counts to zero.
|
static OERandom |
getRuntimeRandom(java.sql.Connection conn)
Generate a new random number generator
that follows the rules according to 2.1.6.1
|
int[] |
getTransactionCount()
Get the executed transaction counts.
|
protected int |
mixType(int chooseType)
Return one of transaction constants to run that transaction.
|
static Submitter |
newOrderOnly(Display display,
Operations ops,
OERandom rand,
short maxW)
Return a Submitter than only executes new order
transactions with no rollback
|
static Submitter |
orderStatusByIdOnly(Display display,
Operations ops,
OERandom rand,
short maxW)
Return a Submitter than only executes order
status by identifier transactions.
|
static Submitter |
orderStatusByNameOnly(Display display,
Operations ops,
OERandom rand,
short maxW)
Return a Submitter than only executes order
status by name transactions.
|
static Submitter |
paymentByIdOnly(Display display,
Operations ops,
OERandom rand,
short maxW)
Return a Submitter than only executes payment
by identifier transactions.
|
static Submitter |
paymentByNameOnly(Display display,
Operations ops,
OERandom rand,
short maxW)
Return a Submitter than only executes payment
by name transactions.
|
private java.lang.String |
percent(int count,
int total) |
void |
printReport(java.io.PrintStream out)
Print a simple report of the activity.
|
protected void |
runNewOrder(java.lang.Object displayData,
boolean forRollback) |
protected void |
runOrderStatus(java.lang.Object displayData,
boolean byName)
Run an order status transaction with random input values.
|
protected void |
runPayment(java.lang.Object displayData,
boolean byName)
Run a payment transaction with random input values.
|
protected void |
runScheduleDelivery(java.lang.Object displayData) |
protected void |
runStockLevel(java.lang.Object displayData)
Run a stock level transaction with random input values.
|
void |
runTransaction(java.lang.Object displayData)
Run an order entry transaction picking the specific
transaction at random with a hard-coded mix.
|
long |
runTransactions(java.lang.Object displayData,
int count)
Run a fixed number of transactions returning the
time in milli-seconds required to execute all of them.
|
static Submitter |
stockLevelOnly(Display display,
Operations ops,
OERandom rand,
short maxW)
Return a Submitter than only executes stock level transactions.
|
private java.lang.String |
transactionCount(java.lang.String name,
int count,
int total) |
private short |
warehouse()
Return a random warehouse
|
public static final int STOCK_LEVEL
public static final int ORDER_STATUS_BY_NAME
public static final int ORDER_STATUS_BY_ID
public static final int PAYMENT_BY_NAME
public static final int PAYMENT_BY_ID
public static final int DELIVERY_SCHEDULE
public static final int NEW_ORDER
public static final int NEW_ORDER_ROLLBACK
private final Display display
private final Operations ops
private final OERandom rand
private final short maxW
private final int[] transactionCount
public Submitter(Display display, Operations ops, OERandom rand, short maxW)
mixType(int)
public static OERandom getRuntimeRandom(java.sql.Connection conn) throws java.sql.SQLException
conn
- java.sql.SQLException
public static Submitter stockLevelOnly(Display display, Operations ops, OERandom rand, short maxW)
public static Submitter orderStatusByIdOnly(Display display, Operations ops, OERandom rand, short maxW)
public static Submitter orderStatusByNameOnly(Display display, Operations ops, OERandom rand, short maxW)
public static Submitter paymentByIdOnly(Display display, Operations ops, OERandom rand, short maxW)
public static Submitter paymentByNameOnly(Display display, Operations ops, OERandom rand, short maxW)
public static Submitter newOrderOnly(Display display, Operations ops, OERandom rand, short maxW)
public void clearTransactionCount()
public long runTransactions(java.lang.Object displayData, int count) throws java.lang.Exception
displayData
- Passed onto Display callscount
- Number of transactions to runjava.lang.Exception
public void runTransaction(java.lang.Object displayData) throws java.lang.Exception
displayData
- Passed onto Display callsjava.lang.Exception
- Error executing the transactionprotected int mixType(int chooseType)
chooseType
- Random number between 1 and 100 inclusive.protected void runNewOrder(java.lang.Object displayData, boolean forRollback) throws java.lang.Exception
java.lang.Exception
protected void runScheduleDelivery(java.lang.Object displayData)
protected void runPayment(java.lang.Object displayData, boolean byName) throws java.lang.Exception
java.lang.Exception
private final short warehouse()
protected void runStockLevel(java.lang.Object displayData) throws java.lang.Exception
java.lang.Exception
protected void runOrderStatus(java.lang.Object displayData, boolean byName) throws java.lang.Exception
java.lang.Exception
public void printReport(java.io.PrintStream out)
out
- private java.lang.String transactionCount(java.lang.String name, int count, int total)
private java.lang.String percent(int count, int total)
public int[] getTransactionCount()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.