public abstract class MultiThreadedWriterBase extends MultiThreadedAction
Modifier and Type | Class and Description |
---|---|
private class |
MultiThreadedWriterBase.WroteKeysTracker
A thread that keeps track of the highest key in the contiguous range of inserted/updated keys.
|
MultiThreadedAction.DefaultDataGenerator
Modifier and Type | Field and Description |
---|---|
protected Set<Long> |
failedKeySet
The sorted set of keys NOT inserted/updated by the writers
|
private static org.slf4j.Logger |
LOG |
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,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.TableName tableName,
String actionLetter) |
Modifier and Type | Method and Description |
---|---|
protected BlockingQueue<Long> |
createWriteKeysQueue(org.apache.hadoop.conf.Configuration conf) |
boolean |
failedToWriteKey(long k) |
int |
getNumWriteFailures() |
protected String |
getRegionDebugInfoSafe(org.apache.hadoop.hbase.client.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, waitForFinish
private static final org.slf4j.Logger LOG
protected 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, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName tableName, String actionLetter) throws IOException
IOException
protected BlockingQueue<Long> createWriteKeysQueue(org.apache.hadoop.conf.Configuration conf)
public void start(long startKey, long endKey, int numThreads) throws IOException
start
in class MultiThreadedAction
IOException
protected String getRegionDebugInfoSafe(org.apache.hadoop.hbase.client.Table table, byte[] rowKey)
public int getNumWriteFailures()
public long wroteUpToKey()
public boolean failedToWriteKey(long k)
protected String progressInfo()
MultiThreadedAction
progressInfo
in class MultiThreadedAction
public void setTrackWroteKeys(boolean enable)
enable
- whether to enable tracking the last inserted/updated keyCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.