Record Class TableConfiguration
- Record Components:
tableName- the name of the table to configurerowCount- the number of rows to generate for this tablecolumnConfigurations- optional per-column generator overrides; may be null or emptypartitions- the number of intra-table partitions for parallel fills;1(the default) disables intra-table partitioning. Must be>= 1.
Intra-table partitioning. When partitions > 1 and the fill
runs on the parallel (DataSource + threads) path, this table's rows are split into
that many contiguous ranges filled concurrently, one connection per range — useful when a single
large table dominates the fill. It is ignored on the sequential (single-Connection) path.
Partitioning is reproducible for a given configuration, including the partition count: key columns and the columns correlated with them (foreign keys, sequences, permutations) are byte-for-byte identical to a sequential fill, so foreign-key validity always holds; only plain non-key random columns take different (but still deterministic) values when the partition count changes. One case is unsupported: partitioning a parent table whose primary key is a plain random generator referenced by a foreign key can orphan those references — partition the child table instead, or use the positional key generators (as the bundled TPC-C/TPC-H configurations do).
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionTableConfiguration(String tableName, long rowCount) Creates a table configuration with no per-column overrides and no intra-table partitioning.TableConfiguration(String tableName, long rowCount, int partitions) Creates a table configuration with an intra-table partition count and no per-column overrides.TableConfiguration(String tableName, long rowCount, Set<ColumnConfiguration> columnConfigurations) Creates a table configuration with per-column overrides and no intra-table partitioning.TableConfiguration(String tableName, long rowCount, Set<ColumnConfiguration> columnConfigurations, int partitions) Validates and normalizes the partition count: a non-positive value defaults to1(no intra-table partitioning). -
Method Summary
Modifier and TypeMethodDescriptioncolumnConfiguration(String columnName) Retrieves the per-column configuration for the given column name.Returns the value of thecolumnConfigurationsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepartitionsrecord component.longrowCount()Returns the value of therowCountrecord component.Returns the value of thetableNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TableConfiguration
public TableConfiguration(String tableName, long rowCount, Set<ColumnConfiguration> columnConfigurations, int partitions) Validates and normalizes the partition count: a non-positive value defaults to1(no intra-table partitioning). -
TableConfiguration
Creates a table configuration with no per-column overrides and no intra-table partitioning.- Parameters:
tableName- the name of the table to configurerowCount- the number of rows to generate for this table
-
TableConfiguration
public TableConfiguration(String tableName, long rowCount, Set<ColumnConfiguration> columnConfigurations) Creates a table configuration with per-column overrides and no intra-table partitioning.- Parameters:
tableName- the name of the table to configurerowCount- the number of rows to generate for this tablecolumnConfigurations- optional per-column generator overrides; may be null or empty
-
TableConfiguration
Creates a table configuration with an intra-table partition count and no per-column overrides.- Parameters:
tableName- the name of the table to configurerowCount- the number of rows to generate for this tablepartitions- the number of intra-table partitions for parallel fills (>= 1)
-
-
Method Details
-
columnConfiguration
Retrieves the per-column configuration for the given column name.- Parameters:
columnName- the name of the column (matched case-insensitively)- Returns:
- the column configuration if one is defined, or null otherwise
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
tableName
-
rowCount
-
columnConfigurations
Returns the value of thecolumnConfigurationsrecord component.- Returns:
- the value of the
columnConfigurationsrecord component
-
partitions
public int partitions()Returns the value of thepartitionsrecord component.- Returns:
- the value of the
partitionsrecord component
-