Package org.apache.hadoop.hbase.rest
Class PerformanceEvaluation
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.rest.PerformanceEvaluation
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.util.Tool
public class PerformanceEvaluation
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
Script used evaluating Stargate performance and scalability. Runs a SG client that steps through
one of a set of hardcoded tests or 'experiments' (e.g. a random reads test, a random writes test,
etc.). Pass on the command-line which test to run and how many clients are participating in this
experiment. Run
java PerformanceEvaluation --help to obtain usage.
This class sets up and runs the evaluation programs described in Section 7, Performance Evaluation, of the Bigtable paper, pages 8-10.
If number of clients > 1, we start up a MapReduce job. Each map task runs an individual client. Each client does about 1GB of data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static classDescribes a command.protected static enumEnum for map metrics.static classMapReduce job that runs a performance evaluation client in each map task.(package private) static classstatic classInputFormat of Performance Evaluation MapReduce job.static classThis class works as the InputSplit of Performance Evaluation MapReduce InputFormat, and the Record Value of RecordReader.(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static interfaceImplementations can have their status set.(package private) static class(package private) static class(package private) static classWraps up options passed toPerformanceEvaluationtests This makes the reflection logic a little easier to understand... -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.io.encoding.DataBlockEncodingprotected static org.apache.hadoop.hbase.rest.client.Clusterprotected Map<String,PerformanceEvaluation.CmdDescriptor> private org.apache.hadoop.hbase.io.compress.Compression.Algorithm(package private) org.apache.hadoop.conf.Configurationprivate org.apache.hadoop.hbase.client.Connectionprivate static final intstatic final byte[]private booleanprivate booleanstatic final PatternRegex to parse lines in input file passed to mapreduce task.protected static final org.slf4j.Loggerprivate intprivate booleanprivate intprivate static final intprivate static final org.apache.hadoop.fs.Pathprivate intstatic final byte[]private intprivate static final intprivate static final intprotected org.apache.hadoop.hbase.client.TableDescriptorstatic final org.apache.hadoop.hbase.TableNameprivate org.apache.hadoop.hbase.TableNameprivate static final intprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCommandDescriptor(Class<? extends PerformanceEvaluation.Test> cmdClass, String name, String description) private booleancheckTable(RemoteAdmin admin) If table does not already exist, create.private Class<? extends PerformanceEvaluation.Test>private voiddoMapReduce(Class<? extends PerformanceEvaluation.Test> cmd) Run a mapreduce job.private voiddoMultipleClients(Class<? extends PerformanceEvaluation.Test> cmd) Run all clients in this vm each to its own thread.static byte[]format(int number) Format passed integer.static byte[]generateData(Random r, int length) static byte[]private voidprotected org.apache.hadoop.hbase.client.TableDescriptor(package private) static byte[]getRandomRow(Random random, int totalRows) protected byte[][]Generates splits based on total number of rows and specified split regionsstatic voidprotected voidprotected voidprintUsage(String message) intprivate voidrunNIsMoreThanOne(Class<? extends PerformanceEvaluation.Test> cmd) We're to run multiple clients concurrently.private voidrunNIsOne(Class<? extends PerformanceEvaluation.Test> cmd) (package private) longrunOneClient(Class<? extends PerformanceEvaluation.Test> cmd, int startRow, int perClientRunRows, int totalRows, boolean flushCommits, boolean writeToWAL, boolean useTags, int noOfTags, org.apache.hadoop.hbase.client.Connection connection, PerformanceEvaluation.Status status) private voidrunTest(Class<? extends PerformanceEvaluation.Test> cmd) private org.apache.hadoop.fs.PathwriteInputFile(org.apache.hadoop.conf.Configuration c) Write input file of offsets-per-client for the mapreduce job.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Field Details
-
LOG
-
DEFAULT_ROW_PREFIX_LENGTH
- See Also:
-
ROW_LENGTH
- See Also:
-
TAG_LENGTH
- See Also:
-
ONE_GB
- See Also:
-
ROWS_PER_GB
- See Also:
-
TABLE_NAME
-
FAMILY_NAME
-
QUALIFIER_NAME
-
tableName
-
TABLE_DESCRIPTOR
-
commands
-
cluster
-
conf
-
nomapred
-
N
-
R
-
compression
-
blockEncoding
-
flushCommits
-
writeToWAL
-
inMemoryCF
-
presplitRegions
-
useTags
-
noOfTags
-
connection
-
PERF_EVAL_DIR
-
LINE_PATTERN
Regex to parse lines in input file passed to mapreduce task.
-
-
Constructor Details
-
PerformanceEvaluation
Constructor- Parameters:
c- Configuration object
-
-
Method Details
-
addCommandDescriptor
protected void addCommandDescriptor(Class<? extends PerformanceEvaluation.Test> cmdClass, String name, String description) -
checkTable
If table does not already exist, create.- Parameters:
admin- Client to use checking.- Returns:
- True if we created the table.
- Throws:
IOException- if an operation on the table fails
-
getDescriptor
-
getSplits
Generates splits based on total number of rows and specified split regions- Returns:
- splits : array of byte []
-
runNIsMoreThanOne
private void runNIsMoreThanOne(Class<? extends PerformanceEvaluation.Test> cmd) throws IOException, InterruptedException, ClassNotFoundException We're to run multiple clients concurrently. Setup a mapreduce job. Run one map per client. Then run a single reduce to sum the elapsed times.- Parameters:
cmd- Command to run.- Throws:
IOExceptionInterruptedExceptionClassNotFoundException
-
doMultipleClients
Run all clients in this vm each to its own thread.- Parameters:
cmd- Command to run- Throws:
IOException- if creating a connection fails
-
doMapReduce
private void doMapReduce(Class<? extends PerformanceEvaluation.Test> cmd) throws IOException, InterruptedException, ClassNotFoundException Run a mapreduce job. Run as many maps as asked-for clients. Before we start up the job, write out an input file with instruction per client regards which row they are to start on.- Parameters:
cmd- Command to run.- Throws:
IOExceptionInterruptedExceptionClassNotFoundException
-
writeInputFile
private org.apache.hadoop.fs.Path writeInputFile(org.apache.hadoop.conf.Configuration c) throws IOException Write input file of offsets-per-client for the mapreduce job.- Parameters:
c- Configuration- Returns:
- Directory that contains file written.
- Throws:
IOException- if creating the directory or the file fails
-
format
Format passed integer.- Parameters:
number- the integer to format- Returns:
- Returns zero-prefixed 10-byte wide decimal version of passed number (Does absolute in case number is negative).
-
generateData
-
generateValue
-
getRandomRow
-
runOneClient
long runOneClient(Class<? extends PerformanceEvaluation.Test> cmd, int startRow, int perClientRunRows, int totalRows, boolean flushCommits, boolean writeToWAL, boolean useTags, int noOfTags, org.apache.hadoop.hbase.client.Connection connection, PerformanceEvaluation.Status status) throws IOException - Throws:
IOException
-
runNIsOne
-
runTest
private void runTest(Class<? extends PerformanceEvaluation.Test> cmd) throws IOException, InterruptedException, ClassNotFoundException -
printUsage
-
printUsage
-
getArgs
-
run
- Specified by:
runin interfaceorg.apache.hadoop.util.Tool- Throws:
Exception
-
determineCommandClass
-
main
- Throws:
Exception
-