@InterfaceAudience.Private public class LoadTestKVGenerator extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private static int |
logLimit |
private int |
maxValueSize |
private int |
minValueSize |
private Random |
randomForValueSize
A random number generator for determining value size
|
Constructor and Description |
---|
LoadTestKVGenerator(int minValueSize,
int maxValueSize) |
Modifier and Type | Method and Description |
---|---|
byte[] |
generateRandomSizeValue(byte[]... seedStrings)
Generates a value for the given key index and column qualifier.
|
private static byte[] |
getValueForRowColumn(int dataSize,
byte[]... seedStrings)
Generates random bytes of the given size for the given row and column qualifier.
|
static String |
md5PrefixedKey(long key)
Converts the given key to string, and prefixes it with the MD5 hash of the index's string
representation.
|
static boolean |
verify(byte[] value,
byte[]... seedStrings)
Verifies that the given byte array is the same as what would be generated for the given seed
strings (row/cf/column/...).
|
private static final org.slf4j.Logger LOG
private static int logLimit
private Random randomForValueSize
private final int minValueSize
private final int maxValueSize
public LoadTestKVGenerator(int minValueSize, int maxValueSize)
public static boolean verify(byte[] value, byte[]... seedStrings)
public static String md5PrefixedKey(long key)
public byte[] generateRandomSizeValue(byte[]... seedStrings)
private static byte[] getValueForRowColumn(int dataSize, byte[]... seedStrings)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.