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.SQLExceptionvoid setRandomGenerator()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void populateAllTables()
throws java.lang.Exception
populateAllTables in interface Loadjava.sql.SQLExceptionjava.lang.Exceptionvoid populateForOneWarehouse(short w)
throws java.sql.SQLException
w - Warehouse to be populated.java.sql.SQLExceptionpublic 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.SQLExceptionpublic void warehouseTable(short w)
throws java.sql.SQLException
w - WAREHOUSE ID (W_ID) to insert data for.java.sql.SQLExceptionpublic 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.SQLExceptionpublic void districtTable(short w,
short d)
throws java.sql.SQLException
w - -
WAREHOUSE id (W_ID)d - -
DISTRICT id (D_ID)java.sql.SQLExceptionpublic void customerTable(short w,
short d)
throws java.sql.SQLException
w - -
WAREHOUSE id (W_ID)d - -
DISTRICT id (D_ID)java.sql.SQLExceptionpublic void orderTable(short w,
short d)
throws java.sql.SQLException
w - -
WAREHOUSE id (W_ID)d - -
DISTRICT id (D_ID)java.sql.SQLExceptionpublic void setSeed(long seed)
Loadpublic void setThreadCount(int threadCount)
setThreadCount in interface LoadthreadCount - Number of threads to use if loading supports
multiple threading.Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.