Package org.apache.hadoop.hbase.util
Class RedundantKVGenerator
java.lang.Object
org.apache.hadoop.hbase.util.RedundantKVGenerator
Generate list of key values which are very useful to test data block encoding and compression.
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private int
private int
private int
private float
private float
private float
private int
private byte[]
(package private) static int
(package private) static int
(package private) static int
(package private) static int
(package private) static float
(package private) static float
(package private) static float
(package private) static int
(package private) static byte[]
(package private) static int
(package private) static int
(package private) static int
(package private) static int
(package private) static int
(package private) static int
(package private) static int
private byte[]
private int
private int
private int
private int
private Random
Used to generate datasetprivate int
private int
private int
-
Constructor Summary
ConstructorDescriptionDefault constructor, assumes all parameters from class constants.RedundantKVGenerator
(Random randomizer, int numberOfRowPrefixes, int averagePrefixLength, int prefixLengthVariance, int averageSuffixLength, int suffixLengthVariance, int numberOfRows, float chanceForSameQualifier, float chanceForSimiliarQualifier, int averageQualifierLength, int qualifierLengthVariance, int columnFamilyLength, int valueLength, float chanceForZeroValue, int baseTimestampDivide, int timestampDiffSize) Various configuration options for generating key values -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBuffer
convertKvToByteBuffer
(List<org.apache.hadoop.hbase.KeyValue> keyValues, boolean includesMemstoreTS) Convert list of KeyValues to byte buffer.private List<byte[]>
List<org.apache.hadoop.hbase.Cell>
generateTestExtendedOffheapKeyValues
(int howMany, boolean useTags) Generate test data useful to test encoders.List<org.apache.hadoop.hbase.KeyValue>
generateTestKeyValues
(int howMany) Generate test data useful to test encoders.List<org.apache.hadoop.hbase.KeyValue>
generateTestKeyValues
(int howMany, boolean useTags) Generate test data useful to test encoders.setFamily
(byte[] family)
-
Field Details
-
DEFAULT_COMMON_PREFIX
-
DEFAULT_NUMBER_OF_ROW_PREFIXES
-
DEFAULT_AVERAGE_PREFIX_LENGTH
-
DEFAULT_PREFIX_LENGTH_VARIANCE
-
DEFAULT_AVERAGE_SUFFIX_LENGTH
-
DEFAULT_SUFFIX_LENGTH_VARIANCE
-
DEFAULT_NUMBER_OF_ROW
-
DEFAULT_CHANCE_FOR_SAME_QUALIFIER
-
DEFAULT_CHANCE_FOR_SIMILIAR_QUALIFIER
-
DEFAULT_AVERAGE_QUALIFIER_LENGTH
-
DEFAULT_QUALIFIER_LENGTH_VARIANCE
-
DEFAULT_COLUMN_FAMILY_LENGTH
-
DEFAULT_VALUE_LENGTH
-
DEFAULT_CHANCE_FOR_ZERO_VALUE
-
DEFAULT_BASE_TIMESTAMP_DIVIDE
-
DEFAULT_TIMESTAMP_DIFF_SIZE
-
randomizer
Used to generate dataset -
commonPrefix
-
numberOfRowPrefixes
-
averagePrefixLength
-
prefixLengthVariance
-
averageSuffixLength
-
suffixLengthVariance
-
numberOfRows
-
family
-
chanceForSameQualifier
-
chanceForSimilarQualifier
-
averageQualifierLength
-
qualifierLengthVariance
-
columnFamilyLength
-
valueLength
-
chanceForZeroValue
-
baseTimestampDivide
-
timestampDiffSize
-
-
Constructor Details
-
RedundantKVGenerator
public RedundantKVGenerator()Default constructor, assumes all parameters from class constants. -
RedundantKVGenerator
public RedundantKVGenerator(Random randomizer, int numberOfRowPrefixes, int averagePrefixLength, int prefixLengthVariance, int averageSuffixLength, int suffixLengthVariance, int numberOfRows, float chanceForSameQualifier, float chanceForSimiliarQualifier, int averageQualifierLength, int qualifierLengthVariance, int columnFamilyLength, int valueLength, float chanceForZeroValue, int baseTimestampDivide, int timestampDiffSize) Various configuration options for generating key values- Parameters:
randomizer
- pick things by random
-
-
Method Details
-
generateRows
-
generateTestKeyValues
Generate test data useful to test encoders.- Parameters:
howMany
- How many Key values should be generated.- Returns:
- sorted list of key values
-
generateTestKeyValues
Generate test data useful to test encoders.- Parameters:
howMany
- How many Key values should be generated.- Returns:
- sorted list of key values
-
generateTestExtendedOffheapKeyValues
public List<org.apache.hadoop.hbase.Cell> generateTestExtendedOffheapKeyValues(int howMany, boolean useTags) Generate test data useful to test encoders.- Parameters:
howMany
- How many Key values should be generated.- Returns:
- sorted list of key values
-
convertKvToByteBuffer
public static ByteBuffer convertKvToByteBuffer(List<org.apache.hadoop.hbase.KeyValue> keyValues, boolean includesMemstoreTS) Convert list of KeyValues to byte buffer.- Parameters:
keyValues
- list of KeyValues to be converted.- Returns:
- buffer with content from key values
-
setFamily
-