Package org.apache.hadoop.hbase.util
Class MultiThreadedAction.DefaultDataGenerator
java.lang.Object
org.apache.hadoop.hbase.util.test.LoadTestDataGenerator
org.apache.hadoop.hbase.util.MultiThreadedAction.DefaultDataGenerator
- Direct Known Subclasses:
LoadTestDataGeneratorWithACL
,LoadTestDataGeneratorWithMOB
,LoadTestDataGeneratorWithTags
,LoadTestDataGeneratorWithVisibilityLabels
- Enclosing class:
- MultiThreadedAction
Default implementation of LoadTestDataGenerator that uses LoadTestKVGenerator, fixed set of
column families, and random number of columns in range. The table for it can be created
manually or, for example, via
HBaseTestingUtility.createPreSplitLoadTestTable(Configuration, TableName, byte[], org.apache.hadoop.hbase.io.compress.Compression.Algorithm, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[][]
private int
private int
Fields inherited from class org.apache.hadoop.hbase.util.test.LoadTestDataGenerator
args, INCREMENT, kvGenerator, MUTATE_INFO
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDataGenerator
(byte[]... columnFamilies) DefaultDataGenerator
(int minValueSize, int maxValueSize, int minColumnsPerKey, int maxColumnsPerKey, byte[]... columnFamilies) -
Method Summary
Modifier and TypeMethodDescriptionbyte[][]
generateColumnsForCf
(byte[] rowKey, byte[] cf) Generates an applicable set of columns to be used for a particular key and family.byte[]
generateValue
(byte[] rowKey, byte[] cf, byte[] column) Generates a value to be used for a particular row/cf/column.byte[][]
Gets column families for the load test table.byte[]
getDeterministicUniqueKey
(long keyBase) Generates a deterministic, unique hashed row key from a number.boolean
verify
(byte[] rowKey, byte[] cf, byte[] column, byte[] value) Checks that value for a rowKey/cf/column is valid if generated viaLoadTestDataGenerator.generateValue(byte[], byte[], byte[])
boolean
Checks that columns for a rowKey and cf are valid if generated viaLoadTestDataGenerator.generateColumnsForCf(byte[], byte[])
Methods inherited from class org.apache.hadoop.hbase.util.test.LoadTestDataGenerator
beforeGet, beforeMutate, generateData, getArgs, initialize
-
Field Details
-
columnFamilies
-
minColumnsPerKey
-
maxColumnsPerKey
-
-
Constructor Details
-
DefaultDataGenerator
public DefaultDataGenerator(int minValueSize, int maxValueSize, int minColumnsPerKey, int maxColumnsPerKey, byte[]... columnFamilies) -
DefaultDataGenerator
-
-
Method Details
-
getDeterministicUniqueKey
Description copied from class:LoadTestDataGenerator
Generates a deterministic, unique hashed row key from a number. That way, the user can keep track of numbers, without messing with byte array and ensuring key distribution.- Specified by:
getDeterministicUniqueKey
in classLoadTestDataGenerator
- Parameters:
keyBase
- Base number for a key, such as a loop counter.
-
getColumnFamilies
Description copied from class:LoadTestDataGenerator
Gets column families for the load test table.- Specified by:
getColumnFamilies
in classLoadTestDataGenerator
- Returns:
- The array of byte[]s representing column family names.
-
generateColumnsForCf
Description copied from class:LoadTestDataGenerator
Generates an applicable set of columns to be used for a particular key and family.- Specified by:
generateColumnsForCf
in classLoadTestDataGenerator
- Parameters:
rowKey
- The row key to generate for.cf
- The column family name to generate for.- Returns:
- The array of byte[]s representing column names.
-
generateValue
Description copied from class:LoadTestDataGenerator
Generates a value to be used for a particular row/cf/column.- Specified by:
generateValue
in classLoadTestDataGenerator
- Parameters:
rowKey
- The row key to generate for.cf
- The column family name to generate for.column
- The column name to generate for.- Returns:
- The value to use.
-
verify
Description copied from class:LoadTestDataGenerator
Checks that value for a rowKey/cf/column is valid if generated viaLoadTestDataGenerator.generateValue(byte[], byte[], byte[])
- Specified by:
verify
in classLoadTestDataGenerator
- Parameters:
rowKey
- The row key to verify for.cf
- The column family name to verify for.column
- The column name to verify for.value
- The value (for example, encountered by read).- Returns:
- True iff valid.
-
verify
Description copied from class:LoadTestDataGenerator
Checks that columns for a rowKey and cf are valid if generated viaLoadTestDataGenerator.generateColumnsForCf(byte[], byte[])
- Specified by:
verify
in classLoadTestDataGenerator
- Parameters:
rowKey
- The row key to verify for.cf
- The column family name to verify for.columnSet
- The column set (for example, encountered by read).- Returns:
- True iff valid.
-