public abstract class MultiThreadedAction extends Object
LoadTestTool
).Modifier and Type | Class and Description |
---|---|
static class |
MultiThreadedAction.DefaultDataGenerator
Default implementation of LoadTestDataGenerator that uses LoadTestKVGenerator, fixed
set of column families, and random number of columns in range.
|
Modifier and Type | Field and Description |
---|---|
protected Configuration |
conf |
protected HConnection |
connection |
protected LoadTestDataGenerator |
dataGenerator |
protected long |
endKey
The end key of the key range, exclusive
|
protected AtomicLong |
numCols |
protected AtomicLong |
numKeys |
protected int |
numThreads |
protected AtomicInteger |
numThreadsWorking |
static int |
REPORTING_INTERVAL_MS |
protected long |
startKey
The start key of the key range, inclusive
|
protected TableName |
tableName |
protected AtomicLong |
totalOpTimeMs |
protected boolean |
verbose |
Constructor and Description |
---|
MultiThreadedAction(LoadTestDataGenerator dataGen,
Configuration conf,
TableName tableName,
String actionLetter) |
Modifier and Type | Method and Description |
---|---|
protected static void |
appendToStatus(StringBuilder sb,
String desc,
long v) |
protected static void |
appendToStatus(StringBuilder sb,
String desc,
String v) |
void |
close() |
long |
getEndKey() |
boolean |
isDone() |
protected abstract String |
progressInfo()
Returns a task-specific progress string
|
void |
start(long startKey,
long endKey,
int numThreads) |
protected void |
startThreads(Collection<? extends Thread> threads) |
boolean |
verifyResultAgainstDataGenerator(Result result,
boolean verifyValues)
|
boolean |
verifyResultAgainstDataGenerator(Result result,
boolean verifyValues,
boolean verifyCfAndColumnIntegrity)
Verifies the result from get or scan using the dataGenerator (that was presumably
also used to generate said result).
|
void |
waitForFinish() |
protected final TableName tableName
protected final Configuration conf
protected final HConnection connection
protected int numThreads
protected long startKey
protected long endKey
protected AtomicInteger numThreadsWorking
protected AtomicLong numKeys
protected AtomicLong numCols
protected AtomicLong totalOpTimeMs
protected boolean verbose
protected LoadTestDataGenerator dataGenerator
public static final int REPORTING_INTERVAL_MS
public MultiThreadedAction(LoadTestDataGenerator dataGen, Configuration conf, TableName tableName, String actionLetter) throws IOException
IOException
public void start(long startKey, long endKey, int numThreads) throws IOException
IOException
public void close()
public void waitForFinish()
public boolean isDone()
protected void startThreads(Collection<? extends Thread> threads)
public long getEndKey()
protected abstract String progressInfo()
protected static void appendToStatus(StringBuilder sb, String desc, long v)
protected static void appendToStatus(StringBuilder sb, String desc, String v)
public boolean verifyResultAgainstDataGenerator(Result result, boolean verifyValues)
verifyResultAgainstDataGenerator(Result, boolean, boolean)
.
Does not verify cf/column integrity.public boolean verifyResultAgainstDataGenerator(Result result, boolean verifyValues, boolean verifyCfAndColumnIntegrity)
verifyValues
- verify that values in the result make sense for row/cf/column combinationverifyCfAndColumnIntegrity
- verify that cf/column set in the result is complete. Note
that to use this multiPut should be used, or verification
has to happen after writes, otherwise there can be races.