@InterfaceAudience.LimitedPrivate(value="Tools") public class PerformanceEvaluation extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
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.
By default, runs as a mapreduce job where each mapper runs a single test
client. Can also run as a non-mapreduce, multithreaded application by
specifying --nomapred
. Each client does about 1GB of data, unless
specified otherwise.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PerformanceEvaluation.AppendTest |
(package private) static class |
PerformanceEvaluation.AsyncRandomReadTest |
(package private) static class |
PerformanceEvaluation.AsyncRandomWriteTest |
(package private) static class |
PerformanceEvaluation.AsyncScanTest |
(package private) static class |
PerformanceEvaluation.AsyncSequentialReadTest |
(package private) static class |
PerformanceEvaluation.AsyncSequentialWriteTest |
(package private) static class |
PerformanceEvaluation.AsyncTableTest |
(package private) static class |
PerformanceEvaluation.AsyncTest |
(package private) static class |
PerformanceEvaluation.BufferedMutatorTest |
(package private) static class |
PerformanceEvaluation.CASTableTest
Base class for operations that are CAS-like; that read a value and then set it based off what
they read.
|
(package private) static class |
PerformanceEvaluation.CheckAndDeleteTest |
(package private) static class |
PerformanceEvaluation.CheckAndMutateTest |
(package private) static class |
PerformanceEvaluation.CheckAndPutTest |
(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 |
(package private) static class |
PerformanceEvaluation.IncrementTest |
(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 |
protected static class |
PerformanceEvaluation.RunResult |
(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.TestBase |
(package private) static class |
PerformanceEvaluation.TestOptions
Wraps up options passed to
PerformanceEvaluation . |
Modifier and Type | Field and Description |
---|---|
private static BigDecimal |
BYTES_PER_MB |
static byte[] |
COLUMN_ZERO |
private static Map<String,PerformanceEvaluation.CmdDescriptor> |
COMMANDS |
private static MathContext |
CXT |
private static PerformanceEvaluation.TestOptions |
DEFAULT_OPTS |
private static int |
DEFAULT_ROWS_PER_GB |
static int |
DEFAULT_VALUE_LENGTH |
static String |
FAMILY_NAME_BASE |
static byte[] |
FAMILY_ZERO |
private static DecimalFormat |
FMT |
(package private) static String |
JOB_INPUT_FILENAME
Each client has one mapper to do the work, and client do the resulting count in a map task.
|
private static org.slf4j.Logger |
LOG |
private static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
private static BigDecimal |
MS_PER_SEC |
private static int |
ONE_GB |
private static org.apache.hadoop.fs.Path |
PERF_EVAL_DIR |
(package private) static String |
RANDOM_READ |
(package private) static String |
RANDOM_SEEK_SCAN |
static int |
ROW_LENGTH |
static String |
TABLE_NAME |
private static int |
TAG_LENGTH |
Constructor and Description |
---|
PerformanceEvaluation(org.apache.hadoop.conf.Configuration conf)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected static void |
addCommandDescriptor(Class<? extends PerformanceEvaluation.TestBase> cmdClass,
String name,
String description) |
private static String |
calculateMbps(int rows,
long timeMs,
int valueSize,
int families,
int columns)
Compute a throughput rate in MB/s.
|
(package private) static PerformanceEvaluation.TestOptions |
calculateRowsAndSize(PerformanceEvaluation.TestOptions opts) |
(package private) static boolean |
checkTable(org.apache.hadoop.hbase.client.Admin admin,
PerformanceEvaluation.TestOptions opts) |
private static Class<? extends PerformanceEvaluation.TestBase> |
determineCommandClass(String cmd) |
(package private) static PerformanceEvaluation.RunResult[] |
doLocalClients(PerformanceEvaluation.TestOptions opts,
org.apache.hadoop.conf.Configuration conf) |
(package private) static org.apache.hadoop.mapreduce.Job |
doMapReduce(PerformanceEvaluation.TestOptions opts,
org.apache.hadoop.conf.Configuration conf) |
static byte[] |
format(int number) |
static byte[] |
generateData(Random r,
int length) |
(package private) static int |
generateRandomRow(Random random,
int totalRows) |
private static int |
getAverageValueLength(PerformanceEvaluation.TestOptions opts) |
(package private) static byte[] |
getRandomRow(Random random,
int totalRows) |
(package private) static int |
getRowsPerGB(PerformanceEvaluation.TestOptions opts) |
protected static byte[][] |
getSplits(PerformanceEvaluation.TestOptions opts)
generates splits based on total number of rows and specified split regions
|
protected static org.apache.hadoop.hbase.HTableDescriptor |
getTableDescriptor(PerformanceEvaluation.TestOptions opts)
Create an HTableDescriptor from provided TestOptions.
|
private static boolean |
isCommandClass(String cmd) |
static void |
main(String[] args) |
(package private) static PerformanceEvaluation.TestOptions |
parseOpts(Queue<String> args)
Parse options passed in via an arguments array.
|
protected void |
printUsage() |
protected static void |
printUsage(String message) |
protected static void |
printUsage(String className,
String message) |
protected static void |
printUsageAndExit(String message,
int exitCode) |
int |
run(String[] args) |
(package private) static PerformanceEvaluation.RunResult |
runOneClient(Class<? extends PerformanceEvaluation.TestBase> cmd,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.client.Connection con,
org.apache.hadoop.hbase.client.AsyncConnection asyncCon,
PerformanceEvaluation.TestOptions opts,
PerformanceEvaluation.Status status) |
private void |
runTest(Class<? extends PerformanceEvaluation.TestBase> cmd,
PerformanceEvaluation.TestOptions opts) |
(package private) static org.apache.hadoop.fs.Path |
writeInputFile(org.apache.hadoop.conf.Configuration c,
PerformanceEvaluation.TestOptions opts) |
(package private) static org.apache.hadoop.fs.Path |
writeInputFile(org.apache.hadoop.conf.Configuration c,
PerformanceEvaluation.TestOptions opts,
org.apache.hadoop.fs.Path basedir) |
static final String RANDOM_SEEK_SCAN
static final String RANDOM_READ
private static final org.slf4j.Logger LOG
private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
public static final String TABLE_NAME
public static final String FAMILY_NAME_BASE
public static final byte[] FAMILY_ZERO
public static final byte[] COLUMN_ZERO
public static final int DEFAULT_VALUE_LENGTH
public static final int ROW_LENGTH
private static final int ONE_GB
private static final int DEFAULT_ROWS_PER_GB
private static final int TAG_LENGTH
private static final DecimalFormat FMT
private static final MathContext CXT
private static final BigDecimal MS_PER_SEC
private static final BigDecimal BYTES_PER_MB
private static final PerformanceEvaluation.TestOptions DEFAULT_OPTS
private static Map<String,PerformanceEvaluation.CmdDescriptor> COMMANDS
private static final org.apache.hadoop.fs.Path PERF_EVAL_DIR
static String JOB_INPUT_FILENAME
public PerformanceEvaluation(org.apache.hadoop.conf.Configuration conf)
conf
- Configuration objectprotected static void addCommandDescriptor(Class<? extends PerformanceEvaluation.TestBase> cmdClass, String name, String description)
static boolean checkTable(org.apache.hadoop.hbase.client.Admin admin, PerformanceEvaluation.TestOptions opts) throws IOException
IOException
protected static org.apache.hadoop.hbase.HTableDescriptor getTableDescriptor(PerformanceEvaluation.TestOptions opts)
protected static byte[][] getSplits(PerformanceEvaluation.TestOptions opts)
static PerformanceEvaluation.RunResult[] doLocalClients(PerformanceEvaluation.TestOptions opts, org.apache.hadoop.conf.Configuration conf) throws IOException, InterruptedException, ExecutionException
static org.apache.hadoop.mapreduce.Job doMapReduce(PerformanceEvaluation.TestOptions opts, org.apache.hadoop.conf.Configuration conf) throws IOException, InterruptedException, ClassNotFoundException
static org.apache.hadoop.fs.Path writeInputFile(org.apache.hadoop.conf.Configuration c, PerformanceEvaluation.TestOptions opts) throws IOException
IOException
static org.apache.hadoop.fs.Path writeInputFile(org.apache.hadoop.conf.Configuration c, PerformanceEvaluation.TestOptions opts, org.apache.hadoop.fs.Path basedir) throws IOException
IOException
private static String calculateMbps(int rows, long timeMs, int valueSize, int families, int columns)
rows
- Number of records consumed.timeMs
- Time taken in milliseconds.public static byte[] format(int number)
public static byte[] generateData(Random r, int length)
static byte[] getRandomRow(Random random, int totalRows)
static int generateRandomRow(Random random, int totalRows)
static PerformanceEvaluation.RunResult runOneClient(Class<? extends PerformanceEvaluation.TestBase> cmd, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.Connection con, org.apache.hadoop.hbase.client.AsyncConnection asyncCon, PerformanceEvaluation.TestOptions opts, PerformanceEvaluation.Status status) throws IOException, InterruptedException
IOException
InterruptedException
private static int getAverageValueLength(PerformanceEvaluation.TestOptions opts)
private void runTest(Class<? extends PerformanceEvaluation.TestBase> cmd, PerformanceEvaluation.TestOptions opts) throws IOException, InterruptedException, ClassNotFoundException, ExecutionException
protected void printUsage()
protected static void printUsage(String message)
protected static void printUsageAndExit(String message, int exitCode)
protected static void printUsage(String className, String message)
static PerformanceEvaluation.TestOptions parseOpts(Queue<String> args)
Queue
. Any unknown arguments will remain
in the queue at the conclusion of this method call. It's up to the caller to deal
with these unrecognized arguments.static PerformanceEvaluation.TestOptions calculateRowsAndSize(PerformanceEvaluation.TestOptions opts)
static int getRowsPerGB(PerformanceEvaluation.TestOptions opts)
public int run(String[] args) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
private static boolean isCommandClass(String cmd)
private static Class<? extends PerformanceEvaluation.TestBase> determineCommandClass(String cmd)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.