Class TPCCConfiguration
TableConfigurations for the TPC-C schema
(see create_tpcc.*.sql), suitable for passing to a
DatabaseConfiguration.
The composite primary/foreign keys are populated as a dense, row-ordered
cartesian product using CompositeKeyComponentGenerator, so each table
receives exactly its cartesian cardinality of rows with unique keys and valid
references. Realistic values (last names, zip codes, credit, i_data/s_data) use
the TPC-C generators in this package; the remaining non-key columns are
configured with bounded generators matching the value ranges and seed values
from the TPC-C specification (clause 4.3.3.1).
In line with the spec: each order has a random o_ol_cnt number of
order lines in [minLinesPerOrder, maxLinesPerOrder] (default
[5, 15]) and order_line holds exactly that many rows per order
(see ChildCardinality); new_order holds only the
most recent newOrdersPerDistrict orders per district (the highest
o_ids) rather than mirroring every order; o_c_id is a per-district
random permutation of customer ids (each customer has exactly one order); and
c_last enumerates the first 1000 last
names per district deterministically, using NURand only for the remainder.
Delivery state is modelled too: the most recent newOrdersPerDistrict
orders per district are undelivered (the new_order subset), so their
o_carrier_id and the ol_delivery_d of their order lines are NULL,
while delivered orders carry a carrier id [1, 10] and a delivery timestamp.
The result matches the TPC-C initial database population (clause 4.3.3.1).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault customers (and orders) per district (C), per the spec.static final intDefault districts per warehouse (D), per the spec.static final intDefault number ofc_lastnames enumerated deterministically per district.static final intDefault number of items (I), per the spec.static final intDefault maximum order lines per order (inclusive), per the spec.static final intDefault minimum order lines per order (inclusive), per the spec.static final intDefault most-recent (undelivered) orders per district held innew_order, per the spec. -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<TableConfiguration> build(int warehouses) Builds a TPC-C configuration using the default per-warehouse cardinalities.static Set<TableConfiguration> build(int warehouses, int items, int districtsPerWarehouse, int customersPerDistrict, int minLinesPerOrder, int maxLinesPerOrder) Builds a TPC-C configuration with explicit cardinalities (useful for tests).static Set<TableConfiguration> build(int warehouses, int items, int districtsPerWarehouse, int customersPerDistrict, int minLinesPerOrder, int maxLinesPerOrder, int newOrdersPerDistrict) Builds a TPC-C configuration with explicit cardinalities, including the number ofnew_orderrows per district.
-
Field Details
-
DEFAULT_ITEMS
public static final int DEFAULT_ITEMSDefault number of items (I), per the spec.- See Also:
-
DEFAULT_DISTRICTS_PER_WAREHOUSE
public static final int DEFAULT_DISTRICTS_PER_WAREHOUSEDefault districts per warehouse (D), per the spec.- See Also:
-
DEFAULT_CUSTOMERS_PER_DISTRICT
public static final int DEFAULT_CUSTOMERS_PER_DISTRICTDefault customers (and orders) per district (C), per the spec.- See Also:
-
DEFAULT_MIN_LINES_PER_ORDER
public static final int DEFAULT_MIN_LINES_PER_ORDERDefault minimum order lines per order (inclusive), per the spec.- See Also:
-
DEFAULT_MAX_LINES_PER_ORDER
public static final int DEFAULT_MAX_LINES_PER_ORDERDefault maximum order lines per order (inclusive), per the spec.- See Also:
-
DEFAULT_NEW_ORDERS_PER_DISTRICT
public static final int DEFAULT_NEW_ORDERS_PER_DISTRICTDefault most-recent (undelivered) orders per district held innew_order, per the spec.- See Also:
-
DEFAULT_ENUMERATED_LAST_NAMES
public static final int DEFAULT_ENUMERATED_LAST_NAMESDefault number ofc_lastnames enumerated deterministically per district.- See Also:
-
-
Method Details
-
build
Builds a TPC-C configuration using the default per-warehouse cardinalities.- Parameters:
warehouses- the number of warehouses (the TPC-C scale factor)- Returns:
- the set of table configurations
-
build
public static Set<TableConfiguration> build(int warehouses, int items, int districtsPerWarehouse, int customersPerDistrict, int minLinesPerOrder, int maxLinesPerOrder) Builds a TPC-C configuration with explicit cardinalities (useful for tests). The number ofnew_orderrows per district defaults toDEFAULT_NEW_ORDERS_PER_DISTRICT, clamped to the orders-per-district.- Parameters:
warehouses- number of warehouses (W)items- number of items (I)districtsPerWarehouse- districts per warehouse (D)customersPerDistrict- customers per district (C); also used as orders per districtminLinesPerOrder- minimum order lines per order (inclusive)maxLinesPerOrder- maximum order lines per order (inclusive); pass the same value asminLinesPerOrderfor a fixed line count- Returns:
- the set of table configurations
-
build
public static Set<TableConfiguration> build(int warehouses, int items, int districtsPerWarehouse, int customersPerDistrict, int minLinesPerOrder, int maxLinesPerOrder, int newOrdersPerDistrict) Builds a TPC-C configuration with explicit cardinalities, including the number ofnew_orderrows per district.- Parameters:
warehouses- number of warehouses (W)items- number of items (I)districtsPerWarehouse- districts per warehouse (D)customersPerDistrict- customers per district (C); also used as orders per districtminLinesPerOrder- minimum order lines per order (inclusive)maxLinesPerOrder- maximum order lines per order (inclusive); pass the same value asminLinesPerOrderfor a fixed line countnewOrdersPerDistrict- most-recent orders per district mirrored intonew_order; clamped to[0, customersPerDistrict]- Returns:
- the set of table configurations
-