Class CustomerLastNameGenerator
- All Implemented Interfaces:
DataGenerator<String>
Generates TPC-C customer last names (clause 4.3.2.3): three concatenated
syllables selected from a fixed set by a number in
[0, 999].
The result is at most 15 characters, fitting the c_last varchar(16) column.
By default the number is drawn via NURand for every row. To match the
load procedure (clause 4.3.3.1), configure groupSize
(the customers per district) and enumeratedCount
(typically 1000): the first enumeratedCount customers of
each district then enumerate the numbers 0..enumeratedCount-1 deterministically
— guaranteeing every distinct last name is present — and only the remaining customers
use NURand.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe spec enumerates last-name numbers[0, 999]for the first 1000 customers per district.Fields inherited from class AbstractDataGenerator
random, randomUtils -
Method Summary
Methods inherited from class AbstractDataGenerator
generateAndSet, generateAsString, reseed, set
-
Field Details
-
MAX_ENUMERATED
public static final int MAX_ENUMERATEDThe spec enumerates last-name numbers[0, 999]for the first 1000 customers per district.- See Also:
-
-
Method Details
-
generate
Description copied from interface:DataGeneratorGenerates a random value of type T.- Returns:
- a generated value, may be null if the generator supports nullable columns
-
lastName
Builds the TPC-C last name for a number in[0, 999]by indexing the syllable set with its three decimal digits.- Parameters:
num- a value in[0, 999]- Returns:
- the concatenated three-syllable last name
-
get
Description copied from interface:DataGeneratorRetrieves a value from a ResultSet column.- Parameters:
resultSet- the result set to read fromcolumnIndex- the 1-based column index- Returns:
- the value from the result set, properly cast to type T
- Throws:
SQLException- if the database operation fails
-