@InterfaceAudience.LimitedPrivate(value="Tools") public class LoadTestTool extends org.apache.hadoop.hbase.util.AbstractHBaseTool
PerformanceEvaluation
, this tool validates the data written,
and supports simultaneously writing and reading the same set of keys.Modifier and Type | Class and Description |
---|---|
(package private) class |
LoadTestTool.WorkerThread |
Modifier and Type | Field and Description |
---|---|
private String |
authnFileName |
protected org.apache.hadoop.hbase.regionserver.BloomType |
bloomType |
protected org.apache.hadoop.hbase.io.crypto.Cipher |
cipher |
protected org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine |
cmd
This will be removed as we factor out the dependency on command line
|
private static String |
COLON |
protected org.apache.hadoop.hbase.io.compress.Compression.Algorithm |
compressAlgo |
protected org.apache.hadoop.hbase.io.encoding.DataBlockEncoding |
dataBlockEncodingAlgo |
protected static int |
DEFAULT_DATA_SIZE
The default data size if not specified
|
static int |
DEFAULT_NUM_REGIONS_PER_SERVER |
protected static int |
DEFAULT_NUM_THREADS
The number of reader/writer threads if not specified
|
protected static long |
DEFAULT_START_KEY |
protected static String |
DEFAULT_TABLE_NAME
Table name to use of not overridden on the command line
|
protected boolean |
deferredLogFlush |
protected long |
endKey |
private byte[][] |
families
Column families for the test
|
protected boolean |
ignoreConflicts |
private boolean |
inMemoryCF |
protected boolean |
isBatchUpdate |
protected boolean |
isInitOnly |
protected boolean |
isMultiPut |
protected boolean |
isRead |
protected boolean |
isSkipInit |
protected boolean |
isUpdate |
protected boolean |
isVerbose |
protected boolean |
isWrite |
private int |
keyWindow |
private static org.slf4j.Logger |
LOG |
protected int |
maxColDataSize |
protected int |
maxColsPerKey |
private int |
maxReadErrors |
protected int |
minColDataSize |
protected int |
minColsPerKey |
private int |
mobThreshold |
private int |
multiGetBatchSize |
protected static String |
NUM_TABLES |
private int |
numReaderThreads |
private int |
numRegionsPerServer |
private int |
numTables |
protected int |
numUpdaterThreads |
protected int |
numWriterThreads |
protected static String |
OPT_BATCHUPDATE |
static String |
OPT_BLOOM |
static String |
OPT_COLUMN_FAMILIES |
static String |
OPT_COMPRESSION |
static String |
OPT_DEFERRED_LOG_FLUSH |
static String |
OPT_DEFERRED_LOG_FLUSH_USAGE |
static String |
OPT_ENCRYPTION |
protected static String |
OPT_ENCRYPTION_USAGE |
static String |
OPT_GENERATOR |
static String |
OPT_GENERATOR_USAGE |
protected static String |
OPT_INIT_ONLY |
static String |
OPT_INMEMORY |
protected static String |
OPT_KEY_WINDOW |
protected static String |
OPT_MAX_READ_ERRORS |
static String |
OPT_MOB_THRESHOLD |
protected static String |
OPT_MOB_THRESHOLD_USAGE |
static String |
OPT_MULTIGET |
static String |
OPT_MULTIPUT |
protected static String |
OPT_NUM_KEYS |
static String |
OPT_NUM_REGIONS_PER_SERVER |
protected static String |
OPT_NUM_REGIONS_PER_SERVER_USAGE |
protected static String |
OPT_READ |
static String |
OPT_READER |
static String |
OPT_READER_USAGE |
static String |
OPT_REGION_REPLICA_ID |
protected static String |
OPT_REGION_REPLICA_ID_USAGE |
static String |
OPT_REGION_REPLICATION |
protected static String |
OPT_REGION_REPLICATION_USAGE |
protected static String |
OPT_SKIP_INIT |
protected static String |
OPT_START_KEY |
static String |
OPT_TABLE_NAME |
protected static String |
OPT_UPDATE |
static String |
OPT_UPDATER |
static String |
OPT_UPDATER_USAGE |
protected static String |
OPT_USAGE_BLOOM |
protected static String |
OPT_USAGE_COMPRESSION |
static String |
OPT_USAGE_IN_MEMORY |
protected static String |
OPT_USAGE_LOAD
Usage string for the load option
|
protected static String |
OPT_USAGE_READ
Usage string for the read option
|
protected static String |
OPT_USAGE_UPDATE
Usage string for the update option
|
protected static String |
OPT_VERBOSE |
protected static String |
OPT_WRITE |
static String |
OPT_WRITER |
static String |
OPT_WRITER_USAGE |
protected static String |
OPT_ZK_PARENT_NODE |
protected static String |
OPT_ZK_QUORUM |
protected MultiThreadedReader |
readerThreads |
private int |
regionReplicaId |
private int |
regionReplication |
protected long |
startKey |
private String |
superUser |
private org.apache.hadoop.hbase.TableName |
tableName
Table name for the test
|
protected AtomicReference<Throwable> |
thrown |
protected int |
updatePercent |
protected MultiThreadedUpdater |
updaterThreads |
private String |
userNames |
private org.apache.hadoop.hbase.security.User |
userOwner |
private int |
verifyPercent |
protected MultiThreadedWriter |
writerThreads |
Constructor and Description |
---|
LoadTestTool() |
Modifier and Type | Method and Description |
---|---|
private void |
addAuthInfoToConf(Properties authConfig,
org.apache.hadoop.conf.Configuration conf,
String owner,
String userList) |
protected void |
addOptions() |
protected void |
applyColumnFamilyOptions(org.apache.hadoop.hbase.TableName tableName,
byte[][] columnFamilies)
Apply column family options such as Bloom filters, compression, and data
block encoding.
|
private void |
checkForErrors()
Check for errors in the writer threads.
|
protected int |
doWork() |
byte[][] |
getColumnFamilies() |
private LoadTestDataGenerator |
getLoadGeneratorInstance(String clazzName) |
private MultiThreadedReader |
getMultiThreadedReaderInstance(String clazzName,
LoadTestDataGenerator dataGen) |
private MultiThreadedUpdater |
getMultiThreadedUpdaterInstance(String clazzName,
LoadTestDataGenerator dataGen) |
private MultiThreadedWriter |
getMultiThreadedWriterInstance(String clazzName,
LoadTestDataGenerator dataGen) |
protected int |
getNumThreads(String numThreadsStr) |
void |
initTestTable() |
protected int |
loadTable() |
static void |
main(String[] args) |
protected org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParser |
newParser() |
private int |
parallelLoadTables()
When NUM_TABLES is specified, the function starts multiple worker threads
which individually start a LoadTestTool instance to load a table.
|
private void |
parseColumnFamilyOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) |
protected void |
processOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) |
protected String[] |
splitColonSeparated(String option,
int minNumCols,
int maxNumCols) |
private void |
workerThreadError(Throwable t) |
addOption, addOptNoArg, addOptNoArg, addOptWithArg, addOptWithArg, addRequiredOption, addRequiredOptWithArg, addRequiredOptWithArg, doStaticMain, getConf, getOptionAsDouble, getOptionAsInt, getOptionAsLong, parseArgs, parseInt, parseLong, printUsage, printUsage, processOldArgs, run, setConf
private static final org.slf4j.Logger LOG
private static final String COLON
private org.apache.hadoop.hbase.TableName tableName
private byte[][] families
protected static final String DEFAULT_TABLE_NAME
protected static final int DEFAULT_DATA_SIZE
protected static final int DEFAULT_NUM_THREADS
protected static final String OPT_USAGE_LOAD
protected static final String OPT_USAGE_READ
protected static final String OPT_USAGE_UPDATE
protected static final String OPT_USAGE_BLOOM
protected static final String OPT_USAGE_COMPRESSION
protected static final String OPT_VERBOSE
public static final String OPT_BLOOM
public static final String OPT_COMPRESSION
public static final String OPT_DEFERRED_LOG_FLUSH
public static final String OPT_DEFERRED_LOG_FLUSH_USAGE
public static final String OPT_INMEMORY
public static final String OPT_USAGE_IN_MEMORY
public static final String OPT_GENERATOR
public static final String OPT_GENERATOR_USAGE
public static final String OPT_WRITER
public static final String OPT_WRITER_USAGE
public static final String OPT_UPDATER
public static final String OPT_UPDATER_USAGE
public static final String OPT_READER
public static final String OPT_READER_USAGE
protected static final String OPT_KEY_WINDOW
protected static final String OPT_WRITE
protected static final String OPT_MAX_READ_ERRORS
public static final String OPT_MULTIPUT
public static final String OPT_MULTIGET
protected static final String OPT_NUM_KEYS
protected static final String OPT_READ
protected static final String OPT_START_KEY
public static final String OPT_TABLE_NAME
public static final String OPT_COLUMN_FAMILIES
protected static final String OPT_ZK_QUORUM
protected static final String OPT_ZK_PARENT_NODE
protected static final String OPT_SKIP_INIT
protected static final String OPT_INIT_ONLY
protected static final String NUM_TABLES
protected static final String OPT_BATCHUPDATE
protected static final String OPT_UPDATE
public static final String OPT_ENCRYPTION
protected static final String OPT_ENCRYPTION_USAGE
public static final String OPT_NUM_REGIONS_PER_SERVER
protected static final String OPT_NUM_REGIONS_PER_SERVER_USAGE
public static int DEFAULT_NUM_REGIONS_PER_SERVER
public static final String OPT_REGION_REPLICATION
protected static final String OPT_REGION_REPLICATION_USAGE
public static final String OPT_REGION_REPLICA_ID
protected static final String OPT_REGION_REPLICA_ID_USAGE
public static final String OPT_MOB_THRESHOLD
protected static final String OPT_MOB_THRESHOLD_USAGE
protected static final long DEFAULT_START_KEY
protected org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd
protected MultiThreadedWriter writerThreads
protected MultiThreadedReader readerThreads
protected MultiThreadedUpdater updaterThreads
protected long startKey
protected long endKey
protected boolean isVerbose
protected boolean isWrite
protected boolean isRead
protected boolean isUpdate
protected boolean deferredLogFlush
protected org.apache.hadoop.hbase.io.encoding.DataBlockEncoding dataBlockEncodingAlgo
protected org.apache.hadoop.hbase.io.compress.Compression.Algorithm compressAlgo
protected org.apache.hadoop.hbase.regionserver.BloomType bloomType
private boolean inMemoryCF
private org.apache.hadoop.hbase.security.User userOwner
protected int numWriterThreads
protected int minColsPerKey
protected int maxColsPerKey
protected int minColDataSize
protected int maxColDataSize
protected boolean isMultiPut
protected int numUpdaterThreads
protected int updatePercent
protected boolean ignoreConflicts
protected boolean isBatchUpdate
private int numReaderThreads
private int keyWindow
private int multiGetBatchSize
private int maxReadErrors
private int verifyPercent
private int numTables
private String authnFileName
private int numRegionsPerServer
private int regionReplication
private int regionReplicaId
private int mobThreshold
protected boolean isSkipInit
protected boolean isInitOnly
protected org.apache.hadoop.hbase.io.crypto.Cipher cipher
protected AtomicReference<Throwable> thrown
public LoadTestTool()
protected String[] splitColonSeparated(String option, int minNumCols, int maxNumCols)
protected int getNumThreads(String numThreadsStr)
public byte[][] getColumnFamilies()
protected void applyColumnFamilyOptions(org.apache.hadoop.hbase.TableName tableName, byte[][] columnFamilies) throws IOException
IOException
protected void addOptions()
addOptions
in class org.apache.hadoop.hbase.util.AbstractHBaseTool
protected org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParser newParser()
newParser
in class org.apache.hadoop.hbase.util.AbstractHBaseTool
protected void processOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd)
processOptions
in class org.apache.hadoop.hbase.util.AbstractHBaseTool
private void parseColumnFamilyOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd)
public void initTestTable() throws IOException
IOException
protected int doWork() throws IOException
doWork
in class org.apache.hadoop.hbase.util.AbstractHBaseTool
IOException
protected int loadTable() throws IOException
IOException
private LoadTestDataGenerator getLoadGeneratorInstance(String clazzName) throws IOException
IOException
private MultiThreadedWriter getMultiThreadedWriterInstance(String clazzName, LoadTestDataGenerator dataGen) throws IOException
IOException
private MultiThreadedUpdater getMultiThreadedUpdaterInstance(String clazzName, LoadTestDataGenerator dataGen) throws IOException
IOException
private MultiThreadedReader getMultiThreadedReaderInstance(String clazzName, LoadTestDataGenerator dataGen) throws IOException
IOException
private int parallelLoadTables() throws IOException
IOException
private void workerThreadError(Throwable t)
private void checkForErrors() throws IOException
IOException
private void addAuthInfoToConf(Properties authConfig, org.apache.hadoop.conf.Configuration conf, String owner, String userList) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.