public abstract class MultiThreadedAction extends Object
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.
|
private class |
MultiThreadedAction.ProgressReporter
Asynchronously reports progress
|
Modifier and Type | Field and Description |
---|---|
private String |
actionLetter
"R" or "W"
|
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.hbase.client.ClusterConnection |
connection |
protected LoadTestDataGenerator |
dataGenerator |
protected long |
endKey
The end key of the key range, exclusive
|
private static org.slf4j.Logger |
LOG |
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
|
private boolean |
streamingCounters
Whether we need to print out Hadoop Streaming-style counters
|
protected org.apache.hadoop.hbase.TableName |
tableName |
protected AtomicLong |
totalOpTimeMs |
protected boolean |
verbose |
Constructor and Description |
---|
MultiThreadedAction(LoadTestDataGenerator dataGen,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.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() |
private static String |
formatTime(long elapsedTime) |
long |
getEndKey() |
boolean |
isDone() |
private Map<String,org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType> |
parseMutateInfo(byte[] mutateInfo) |
private void |
printLocations(org.apache.hadoop.hbase.client.Result r) |
protected abstract String |
progressInfo()
Returns a task-specific progress string
|
private String |
resultToString(org.apache.hadoop.hbase.client.Result result) |
void |
start(long startKey,
long endKey,
int numThreads) |
protected void |
startThreads(Collection<? extends Thread> threads) |
boolean |
verifyResultAgainstDataGenerator(org.apache.hadoop.hbase.client.Result result,
boolean verifyValues)
|
boolean |
verifyResultAgainstDataGenerator(org.apache.hadoop.hbase.client.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() |
private static final org.slf4j.Logger LOG
protected final org.apache.hadoop.hbase.TableName tableName
protected final org.apache.hadoop.conf.Configuration conf
protected final org.apache.hadoop.hbase.client.ClusterConnection 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
private String actionLetter
private boolean streamingCounters
public static final int REPORTING_INTERVAL_MS
public MultiThreadedAction(LoadTestDataGenerator dataGen, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName tableName, String actionLetter) throws IOException
IOException
public void start(long startKey, long endKey, int numThreads) throws IOException
IOException
private static String formatTime(long elapsedTime)
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(org.apache.hadoop.hbase.client.Result result, boolean verifyValues)
verifyResultAgainstDataGenerator(Result, boolean, boolean)
.
Does not verify cf/column integrity.public boolean verifyResultAgainstDataGenerator(org.apache.hadoop.hbase.client.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.private void printLocations(org.apache.hadoop.hbase.client.Result r)
private String resultToString(org.apache.hadoop.hbase.client.Result result)
private Map<String,org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType> parseMutateInfo(byte[] mutateInfo)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.