public abstract class MultiThreadedWriterBase extends MultiThreadedAction
MultiThreadedAction.DefaultDataGenerator| Modifier and Type | Field and Description |
|---|---|
protected Set<Long> |
failedKeySet
The sorted set of keys NOT inserted/updated by the writers
|
protected AtomicLong |
nextKeyToWrite
This is the current key to be inserted/updated by any thread.
|
protected boolean |
trackWroteKeys
Enable this if used in conjunction with a concurrent reader.
|
protected AtomicLong |
wroteKeyQueueSize
The total size of the temporary inserted/updated key set that have not yet lined
up in a our contiguous sequence starting from startKey.
|
protected BlockingQueue<Long> |
wroteKeys
A temporary place to keep track of inserted/updated keys.
|
protected AtomicLong |
wroteUpToKey
The highest key in the contiguous range of keys .
|
conf, connection, dataGenerator, endKey, numCols, numKeys, numThreads, numThreadsWorking, REPORTING_INTERVAL_MS, startKey, tableName, totalOpTimeMs, verbose| Constructor and Description |
|---|
MultiThreadedWriterBase(LoadTestDataGenerator dataGen,
Configuration conf,
TableName tableName,
String actionLetter) |
| Modifier and Type | Method and Description |
|---|---|
protected BlockingQueue<Long> |
createWriteKeysQueue(Configuration conf) |
boolean |
failedToWriteKey(long k) |
int |
getNumWriteFailures() |
protected String |
getRegionDebugInfoSafe(Table table,
byte[] rowKey) |
protected String |
progressInfo()
Returns a task-specific progress string
|
void |
setTrackWroteKeys(boolean enable)
Used for a joint write/read workload.
|
void |
start(long startKey,
long endKey,
int numThreads) |
long |
wroteUpToKey()
The max key until which all keys have been inserted/updated (successfully or not).
|
appendToStatus, appendToStatus, close, getEndKey, isDone, startThreads, verifyResultAgainstDataGenerator, verifyResultAgainstDataGenerator, waitForFinishprotected BlockingQueue<Long> wroteKeys
wroteUpToKey, the maximum key in the contiguous range of keys
being inserted/updated. This queue is supposed to stay small.protected AtomicLong nextKeyToWrite
protected AtomicLong wroteUpToKey
protected Set<Long> failedKeySet
protected AtomicLong wroteKeyQueueSize
protected boolean trackWroteKeys
public MultiThreadedWriterBase(LoadTestDataGenerator dataGen, Configuration conf, TableName tableName, String actionLetter) throws IOException
IOExceptionprotected BlockingQueue<Long> createWriteKeysQueue(Configuration conf)
public void start(long startKey,
long endKey,
int numThreads)
throws IOException
start in class MultiThreadedActionIOExceptionpublic int getNumWriteFailures()
public long wroteUpToKey()
public boolean failedToWriteKey(long k)
protected String progressInfo()
MultiThreadedActionprogressInfo in class MultiThreadedActionpublic void setTrackWroteKeys(boolean enable)
enable - whether to enable tracking the last inserted/updated key