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
Modifier and TypeClassDescription(package private) static class
(package private) static class
Describes a command.protected static enum
Enum for map metrics.static class
MapReduce job that runs a performance evaluation client in each map task.(package private) static class
static class
InputFormat of Performance Evaluation MapReduce job.static class
This 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 interface
Implementations can have their status set.(package private) static class
(package private) static class
(package private) static class
Wraps up options passed toPerformanceEvaluation
tests This makes the reflection logic a little easier to understand... -
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.io.encoding.DataBlockEncoding
protected static org.apache.hadoop.hbase.rest.client.Cluster
protected Map<String,
PerformanceEvaluation.CmdDescriptor> private org.apache.hadoop.hbase.io.compress.Compression.Algorithm
(package private) org.apache.hadoop.conf.Configuration
private org.apache.hadoop.hbase.client.Connection
private static final int
static final byte[]
private boolean
private boolean
static final Pattern
Regex to parse lines in input file passed to mapreduce task.protected static final org.slf4j.Logger
private int
private boolean
private int
private static final int
private static final org.apache.hadoop.fs.Path
private int
static final byte[]
private int
private static final int
private static final int
protected org.apache.hadoop.hbase.client.TableDescriptor
static final org.apache.hadoop.hbase.TableName
private org.apache.hadoop.hbase.TableName
private static final int
private boolean
private boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCommandDescriptor
(Class<? extends PerformanceEvaluation.Test> cmdClass, String name, String description) private boolean
checkTable
(RemoteAdmin admin) If table does not already exist, create.private Class<? extends PerformanceEvaluation.Test>
private void
doMapReduce
(Class<? extends PerformanceEvaluation.Test> cmd) Run a mapreduce job.private void
doMultipleClients
(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 void
protected 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 void
protected void
protected void
printUsage
(String message) int
private void
runNIsMoreThanOne
(Class<? extends PerformanceEvaluation.Test> cmd) We're to run multiple clients concurrently.private void
runNIsOne
(Class<? extends PerformanceEvaluation.Test> cmd) (package private) 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) private void
runTest
(Class<? extends PerformanceEvaluation.Test> cmd) private org.apache.hadoop.fs.Path
writeInputFile
(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, setConf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
IOException
InterruptedException
ClassNotFoundException
-
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:
IOException
InterruptedException
ClassNotFoundException
-
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:
run
in interfaceorg.apache.hadoop.util.Tool
- Throws:
Exception
-
determineCommandClass
-
main
- Throws:
Exception
-