public class SimpleInsert extends java.lang.Object implements Load
Modifier and Type | Field and Description |
---|---|
(package private) java.sql.Connection |
conn
database connection
|
(package private) OERandom |
random
Utility to generate random data per the TPC-C requirements
|
(package private) short |
scale
warehouse scale factor, default to 1.
|
(package private) long |
seed
Seed value for random number generator.
|
CUSTOMER_COUNT_W, DISTRICT_COUNT_W, HISTORY_COUNT_W, ITEM_COUNT, NEWORDERS_BREAKPOINT, NEWORDERS_COUNT_W, ORDERLINE_COUNT_WV, ORDERS_COUNT_W, STOCK_COUNT_W
Constructor and Description |
---|
SimpleInsert() |
Modifier and Type | Method and Description |
---|---|
void |
customerTable(short w,
short d)
Populate the CUSTOMER table for a given district for a specific
warehouse.
|
void |
districtTable(short w,
short d)
Populate the DISTRICT table for a given warehouse.
|
void |
itemTable(int itemStart,
int itemEnd)
Populate the ITEM table.
|
void |
orderTable(short w,
short d)
Populate the ORDER table See population requirements in section 4.3.3.1
|
void |
populateAllTables()
Follow the initial database population requirements in Section 4.3.3 and
populate all the required tables.
|
(package private) void |
populateForOneWarehouse(short w)
Populate all the tables needed for a specific warehouse.
|
(package private) void |
setRandomGenerator()
Setup the random number generator to be used for the load.
|
void |
setSeed(long seed)
Set the seed for the random number generator used to
populate the data.
|
void |
setThreadCount(int threadCount)
Ignore, this is a single threaded load.
|
(package private) void |
setupConnection(java.sql.Connection conn,
short scale)
Set the connection up to the intended state.
|
void |
setupLoad(java.sql.Connection conn,
short scale)
Perform the necessary setup before database population.
|
void |
stockTable(int itemStart,
int itemEnd,
short w)
Populate the STOCK table for a given warehouse.
|
void |
warehouseTable(short w)
Populate the WAREHOUSE table for a given warehouse.
|
java.sql.Connection conn
short scale
long seed
OERandom random
public void setupLoad(java.sql.Connection conn, short scale) throws java.sql.SQLException
void setupConnection(java.sql.Connection conn, short scale) throws java.sql.SQLException
java.sql.SQLException
void setRandomGenerator() throws java.sql.SQLException
java.sql.SQLException
public void populateAllTables() throws java.lang.Exception
populateAllTables
in interface Load
java.sql.SQLException
java.lang.Exception
void populateForOneWarehouse(short w) throws java.sql.SQLException
w
- Warehouse to be populated.java.sql.SQLException
public void itemTable(int itemStart, int itemEnd) throws java.sql.SQLException
itemStart
- insert item information starting from this Item id (ITEM.I_ID)itemEnd
- last Item id (ITEM.I_ID) for inserting information forjava.sql.SQLException
public void warehouseTable(short w) throws java.sql.SQLException
w
- WAREHOUSE ID (W_ID) to insert data for.java.sql.SQLException
public void stockTable(int itemStart, int itemEnd, short w) throws java.sql.SQLException
itemStart
- insert stocks of items from this Item id (ITEM.I_ID)itemEnd
- last Item id (ITEM.I_ID) to insert stocks of times for.w
- WAREHOUSE id (W_ID) for which the stock is populated.java.sql.SQLException
public void districtTable(short w, short d) throws java.sql.SQLException
w
- -
WAREHOUSE id (W_ID)d
- -
DISTRICT id (D_ID)java.sql.SQLException
public void customerTable(short w, short d) throws java.sql.SQLException
w
- -
WAREHOUSE id (W_ID)d
- -
DISTRICT id (D_ID)java.sql.SQLException
public void orderTable(short w, short d) throws java.sql.SQLException
w
- -
WAREHOUSE id (W_ID)d
- -
DISTRICT id (D_ID)java.sql.SQLException
public void setSeed(long seed)
Load
public void setThreadCount(int threadCount)
setThreadCount
in interface Load
threadCount
- Number of threads to use if loading supports
multiple threading.Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.