Package org.apache.hadoop.hbase.util
Class LoadTestTool
java.lang.Object
org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.util.LoadTestTool
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable,- org.apache.hadoop.util.Tool
@LimitedPrivate("Tools")
public class LoadTestTool
extends org.apache.hadoop.hbase.util.AbstractHBaseTool
A command-line utility that reads, writes, and verifies data. Unlike
 
PerformanceEvaluation, this tool validates the data written, and
 supports simultaneously writing and reading the same set of keys.- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.apache.hadoop.hbase.util.AbstractHBaseToolorg.apache.hadoop.hbase.util.AbstractHBaseTool.OptionsOrderComparator
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate Stringprotected org.apache.hadoop.hbase.regionserver.BloomTypeprotected org.apache.hadoop.hbase.io.crypto.Cipherprotected org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineThis will be removed as we factor out the dependency on command lineprivate static final Stringprotected org.apache.hadoop.hbase.io.compress.Compression.Algorithmprotected org.apache.hadoop.hbase.io.encoding.DataBlockEncodingprotected static final intThe default data size if not specifiedstatic intprotected static final intThe number of reader/writer threads if not specifiedprotected static final longprotected static final StringTable name to use of not overridden on the command lineprotected booleanprotected longprivate byte[][]Column families for the testprotected booleanprivate booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprivate intprivate static final org.slf4j.Loggerprotected intprotected intprivate intprotected intprotected intprivate intprivate intprotected static final Stringprivate intprivate intprivate intprotected intprotected intprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final StringUsage string for the load optionprotected static final StringUsage string for the read optionprotected static final StringUsage string for the update optionprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected MultiThreadedReaderprivate intprivate intprotected longprivate Stringprivate org.apache.hadoop.hbase.TableNameTable name for the testprotected AtomicReference<Throwable>protected intprotected MultiThreadedUpdaterprivate Stringprivate org.apache.hadoop.hbase.security.Userprivate intprotected MultiThreadedWriterFields inherited from class org.apache.hadoop.hbase.util.AbstractHBaseToolcmdLineArgs, conf, EXIT_FAILURE, EXIT_SUCCESS, LONG_HELP_OPTION, options, SHORT_HELP_OPTION
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate voidaddAuthInfoToConf(Properties authConfig, org.apache.hadoop.conf.Configuration conf, String owner, String userList) protected voidprotected voidapplyColumnFamilyOptions(org.apache.hadoop.hbase.TableName tableName, byte[][] columnFamilies) Apply column family options such as Bloom filters, compression, and data block encoding.private voidCheck for errors in the writer threads.protected intdoWork()byte[][]private LoadTestDataGeneratorgetLoadGeneratorInstance(String clazzName) private MultiThreadedReadergetMultiThreadedReaderInstance(String clazzName, LoadTestDataGenerator dataGen) private MultiThreadedUpdatergetMultiThreadedUpdaterInstance(String clazzName, LoadTestDataGenerator dataGen) private MultiThreadedWritergetMultiThreadedWriterInstance(String clazzName, LoadTestDataGenerator dataGen) protected intgetNumThreads(String numThreadsStr) voidprotected intstatic voidprotected org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParserprivate intWhen NUM_TABLES is specified, the function starts multiple worker threads which individually start a LoadTestTool instance to load a table.private voidparseColumnFamilyOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) protected voidprocessOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) protected String[]splitColonSeparated(String option, int minNumCols, int maxNumCols) private voidMethods inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTooladdOption, addOptNoArg, addOptNoArg, addOptWithArg, addOptWithArg, addRequiredOption, addRequiredOptWithArg, addRequiredOptWithArg, doStaticMain, getConf, getOptionAsDouble, getOptionAsInt, getOptionAsInt, getOptionAsLong, getOptionAsLong, parseArgs, parseInt, parseLong, printUsage, printUsage, processOldArgs, run, setConf
- 
Field Details- 
LOG
- 
COLON- See Also:
 
- 
tableNameTable name for the test
- 
familiesColumn families for the test
- 
DEFAULT_TABLE_NAMETable name to use of not overridden on the command line- See Also:
 
- 
DEFAULT_DATA_SIZEThe default data size if not specified- See Also:
 
- 
DEFAULT_NUM_THREADSThe number of reader/writer threads if not specified- See Also:
 
- 
OPT_USAGE_LOADUsage string for the load option- See Also:
 
- 
OPT_USAGE_READUsage string for the read option- See Also:
 
- 
OPT_USAGE_UPDATEUsage string for the update option- See Also:
 
- 
OPT_USAGE_BLOOM
- 
OPT_USAGE_COMPRESSION
- 
OPT_VERBOSE- See Also:
 
- 
OPT_BLOOM- See Also:
 
- 
OPT_BLOOM_PARAM- See Also:
 
- 
OPT_COMPRESSION- See Also:
 
- 
OPT_DEFERRED_LOG_FLUSH- See Also:
 
- 
OPT_DEFERRED_LOG_FLUSH_USAGE- See Also:
 
- 
OPT_INMEMORY- See Also:
 
- 
OPT_USAGE_IN_MEMORY- See Also:
 
- 
OPT_GENERATOR- See Also:
 
- 
OPT_GENERATOR_USAGE- See Also:
 
- 
OPT_WRITER- See Also:
 
- 
OPT_WRITER_USAGE- See Also:
 
- 
OPT_UPDATER- See Also:
 
- 
OPT_UPDATER_USAGE- See Also:
 
- 
OPT_READER- See Also:
 
- 
OPT_READER_USAGE- See Also:
 
- 
OPT_KEY_WINDOW- See Also:
 
- 
OPT_WRITE- See Also:
 
- 
OPT_MAX_READ_ERRORS- See Also:
 
- 
OPT_MULTIPUT- See Also:
 
- 
OPT_MULTIGET- See Also:
 
- 
OPT_NUM_KEYS- See Also:
 
- 
OPT_READ- See Also:
 
- 
OPT_START_KEY- See Also:
 
- 
OPT_TABLE_NAME- See Also:
 
- 
OPT_COLUMN_FAMILIES- See Also:
 
- 
OPT_ZK_QUORUM- See Also:
 
- 
OPT_ZK_PARENT_NODE- See Also:
 
- 
OPT_SKIP_INIT- See Also:
 
- 
OPT_INIT_ONLY- See Also:
 
- 
NUM_TABLES- See Also:
 
- 
OPT_BATCHUPDATE- See Also:
 
- 
OPT_UPDATE- See Also:
 
- 
OPT_ENCRYPTION- See Also:
 
- 
OPT_ENCRYPTION_USAGE
- 
OPT_NUM_REGIONS_PER_SERVER- See Also:
 
- 
OPT_NUM_REGIONS_PER_SERVER_USAGE- See Also:
 
- 
DEFAULT_NUM_REGIONS_PER_SERVER
- 
OPT_REGION_REPLICATION- See Also:
 
- 
OPT_REGION_REPLICATION_USAGE- See Also:
 
- 
OPT_REGION_REPLICA_ID- See Also:
 
- 
OPT_REGION_REPLICA_ID_USAGE- See Also:
 
- 
OPT_MOB_THRESHOLD- See Also:
 
- 
OPT_MOB_THRESHOLD_USAGE- See Also:
 
- 
DEFAULT_START_KEY- See Also:
 
- 
cmdThis will be removed as we factor out the dependency on command line
- 
writerThreads
- 
readerThreads
- 
updaterThreads
- 
startKey
- 
endKey
- 
isVerbose
- 
isWrite
- 
isRead
- 
isUpdate
- 
deferredLogFlush
- 
dataBlockEncodingAlgo
- 
compressAlgo
- 
bloomType
- 
inMemoryCF
- 
userOwner
- 
numWriterThreads
- 
minColsPerKey
- 
maxColsPerKey
- 
minColDataSize
- 
maxColDataSize
- 
isMultiPut
- 
numUpdaterThreads
- 
updatePercent
- 
ignoreConflicts
- 
isBatchUpdate
- 
numReaderThreads
- 
keyWindow
- 
multiGetBatchSize
- 
maxReadErrors
- 
verifyPercent
- 
numTables
- 
superUser
- 
userNames
- 
authnFileName
- 
numRegionsPerServer
- 
regionReplication
- 
regionReplicaId
- 
mobThreshold
- 
isSkipInit
- 
isInitOnly
- 
cipher
- 
thrown
 
- 
- 
Constructor Details- 
LoadTestToolpublic LoadTestTool()
 
- 
- 
Method Details- 
splitColonSeparated
- 
getNumThreads
- 
getColumnFamilies
- 
applyColumnFamilyOptionsprotected void applyColumnFamilyOptions(org.apache.hadoop.hbase.TableName tableName, byte[][] columnFamilies) throws IOException Apply column family options such as Bloom filters, compression, and data block encoding.- Throws:
- IOException
 
- 
addOptions- Specified by:
- addOptionsin class- org.apache.hadoop.hbase.util.AbstractHBaseTool
 
- 
newParser- Overrides:
- newParserin class- org.apache.hadoop.hbase.util.AbstractHBaseTool
 
- 
processOptions- Specified by:
- processOptionsin class- org.apache.hadoop.hbase.util.AbstractHBaseTool
 
- 
parseColumnFamilyOptionsprivate void parseColumnFamilyOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) 
- 
initTestTable- Throws:
- IOException
 
- 
doWork- Specified by:
- doWorkin class- org.apache.hadoop.hbase.util.AbstractHBaseTool
- Throws:
- IOException
 
- 
loadTable- Throws:
- IOException
 
- 
getLoadGeneratorInstance- Throws:
- IOException
 
- 
getMultiThreadedWriterInstanceprivate MultiThreadedWriter getMultiThreadedWriterInstance(String clazzName, LoadTestDataGenerator dataGen) throws IOException - Throws:
- IOException
 
- 
getMultiThreadedUpdaterInstanceprivate MultiThreadedUpdater getMultiThreadedUpdaterInstance(String clazzName, LoadTestDataGenerator dataGen) throws IOException - Throws:
- IOException
 
- 
getMultiThreadedReaderInstanceprivate MultiThreadedReader getMultiThreadedReaderInstance(String clazzName, LoadTestDataGenerator dataGen) throws IOException - Throws:
- IOException
 
- 
main
- 
parallelLoadTablesWhen NUM_TABLES is specified, the function starts multiple worker threads which individually start a LoadTestTool instance to load a table. Each table name is in format <tn>_<index>. For example, "-tn test -num_tables 2" , table names will be "test_1", "test_2"- Throws:
- IOException- if one of the load tasks is unable to complete
 
- 
workerThreadError
- 
checkForErrorsCheck for errors in the writer threads. If any is found, rethrow it.- Throws:
- IOException
 
- 
addAuthInfoToConfprivate void addAuthInfoToConf(Properties authConfig, org.apache.hadoop.conf.Configuration conf, String owner, String userList) throws IOException - Throws:
- IOException
 
 
-