public class PerformanceEvaluation extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
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.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PerformanceEvaluation.BufferedMutatorTest |
(package private) static class |
PerformanceEvaluation.CmdDescriptor
Describes a command.
|
protected static class |
PerformanceEvaluation.Counter
Enum for map metrics.
|
static class |
PerformanceEvaluation.EvaluationMapTask
MapReduce job that runs a performance evaluation client in each map task.
|
(package private) static class |
PerformanceEvaluation.FilteredScanTest |
static class |
PerformanceEvaluation.PeInputFormat
InputFormat of Performance Evaluation MapReduce job.
|
static class |
PerformanceEvaluation.PeInputSplit
This class works as the InputSplit of Performance Evaluation
MapReduce InputFormat, and the Record Value of RecordReader.
|
(package private) static class |
PerformanceEvaluation.RandomReadTest |
(package private) static class |
PerformanceEvaluation.RandomScanWithRange10000Test |
(package private) static class |
PerformanceEvaluation.RandomScanWithRange1000Test |
(package private) static class |
PerformanceEvaluation.RandomScanWithRange100Test |
(package private) static class |
PerformanceEvaluation.RandomScanWithRange10Test |
(package private) static class |
PerformanceEvaluation.RandomScanWithRangeTest |
(package private) static class |
PerformanceEvaluation.RandomSeekScanTest |
(package private) static class |
PerformanceEvaluation.RandomWriteTest |
(package private) static class |
PerformanceEvaluation.ScanTest |
(package private) static class |
PerformanceEvaluation.SequentialReadTest |
(package private) static class |
PerformanceEvaluation.SequentialWriteTest |
(package private) static interface |
PerformanceEvaluation.Status
Implementations can have their status set.
|
(package private) static class |
PerformanceEvaluation.TableTest |
(package private) static class |
PerformanceEvaluation.Test |
(package private) static class |
PerformanceEvaluation.TestOptions
Wraps up options passed to
PerformanceEvaluation tests
This makes the reflection logic a little easier to understand... |
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.hbase.io.encoding.DataBlockEncoding |
blockEncoding |
protected static org.apache.hadoop.hbase.rest.client.Cluster |
cluster |
protected Map<String,PerformanceEvaluation.CmdDescriptor> |
commands |
private org.apache.hadoop.hbase.io.compress.Compression.Algorithm |
compression |
(package private) org.apache.hadoop.conf.Configuration |
conf |
private org.apache.hadoop.hbase.client.Connection |
connection |
private static int |
DEFAULT_ROW_PREFIX_LENGTH |
static byte[] |
FAMILY_NAME |
private boolean |
flushCommits |
private boolean |
inMemoryCF |
static Pattern |
LINE_PATTERN
Regex to parse lines in input file passed to mapreduce task.
|
protected static org.slf4j.Logger |
LOG |
private int |
N |
private boolean |
nomapred |
private int |
noOfTags |
private static int |
ONE_GB |
private static org.apache.hadoop.fs.Path |
PERF_EVAL_DIR |
private int |
presplitRegions |
static byte[] |
QUALIFIER_NAME |
private int |
R |
private static int |
ROW_LENGTH |
private static int |
ROWS_PER_GB |
protected org.apache.hadoop.hbase.HTableDescriptor |
TABLE_DESCRIPTOR |
static org.apache.hadoop.hbase.TableName |
TABLE_NAME |
private org.apache.hadoop.hbase.TableName |
tableName |
private static int |
TAG_LENGTH |
private boolean |
useTags |
private boolean |
writeToWAL |
Constructor and Description |
---|
PerformanceEvaluation(org.apache.hadoop.conf.Configuration c)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected 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> |
determineCommandClass(String cmd) |
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[] |
generateValue(Random r) |
private void |
getArgs(int start,
String[] args) |
(package private) static byte[] |
getRandomRow(Random random,
int totalRows) |
protected byte[][] |
getSplits()
Generates splits based on total number of rows and specified split regions
|
protected org.apache.hadoop.hbase.HTableDescriptor |
getTableDescriptor() |
static void |
main(String[] args) |
protected void |
printUsage() |
protected void |
printUsage(String message) |
int |
run(String[] args) |
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.
|
protected static final org.slf4j.Logger LOG
private static final int DEFAULT_ROW_PREFIX_LENGTH
private static final int ROW_LENGTH
private static final int TAG_LENGTH
private static final int ONE_GB
private static final int ROWS_PER_GB
public static final org.apache.hadoop.hbase.TableName TABLE_NAME
public static final byte[] FAMILY_NAME
public static final byte[] QUALIFIER_NAME
private org.apache.hadoop.hbase.TableName tableName
protected org.apache.hadoop.hbase.HTableDescriptor TABLE_DESCRIPTOR
protected Map<String,PerformanceEvaluation.CmdDescriptor> commands
protected static org.apache.hadoop.hbase.rest.client.Cluster cluster
volatile org.apache.hadoop.conf.Configuration conf
private boolean nomapred
private int N
private int R
private org.apache.hadoop.hbase.io.compress.Compression.Algorithm compression
private org.apache.hadoop.hbase.io.encoding.DataBlockEncoding blockEncoding
private boolean flushCommits
private boolean writeToWAL
private boolean inMemoryCF
private int presplitRegions
private boolean useTags
private int noOfTags
private org.apache.hadoop.hbase.client.Connection connection
private static final org.apache.hadoop.fs.Path PERF_EVAL_DIR
public static final Pattern LINE_PATTERN
public PerformanceEvaluation(org.apache.hadoop.conf.Configuration c)
c
- Configuration objectprotected void addCommandDescriptor(Class<? extends PerformanceEvaluation.Test> cmdClass, String name, String description)
private boolean checkTable(RemoteAdmin admin) throws IOException
admin
- Client to use checking.IOException
- if an operation on the table failsprotected org.apache.hadoop.hbase.HTableDescriptor getTableDescriptor()
protected byte[][] getSplits()
private void runNIsMoreThanOne(Class<? extends PerformanceEvaluation.Test> cmd) throws IOException, InterruptedException, ClassNotFoundException
cmd
- Command to run.IOException
InterruptedException
ClassNotFoundException
private void doMultipleClients(Class<? extends PerformanceEvaluation.Test> cmd) throws IOException
cmd
- Command to runIOException
- if creating a connection failsprivate void doMapReduce(Class<? extends PerformanceEvaluation.Test> cmd) throws IOException, InterruptedException, ClassNotFoundException
cmd
- Command to run.IOException
InterruptedException
ClassNotFoundException
private org.apache.hadoop.fs.Path writeInputFile(org.apache.hadoop.conf.Configuration c) throws IOException
c
- ConfigurationIOException
- if creating the directory or the file failspublic static byte[] format(int number)
number
- the integer to formatpublic static byte[] generateData(Random r, int length)
public static byte[] generateValue(Random r)
static byte[] getRandomRow(Random random, int totalRows)
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
IOException
private void runNIsOne(Class<? extends PerformanceEvaluation.Test> cmd)
private void runTest(Class<? extends PerformanceEvaluation.Test> cmd) throws IOException, InterruptedException, ClassNotFoundException
protected void printUsage()
protected void printUsage(String message)
public int run(String[] args) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
private Class<? extends PerformanceEvaluation.Test> determineCommandClass(String cmd)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.