public final class Canary extends Object implements org.apache.hadoop.util.Tool
Modifier and Type | Class and Description |
---|---|
static interface |
Canary.ExtendedSink |
static class |
Canary.Monitor |
private static class |
Canary.RegionMonitor |
private static class |
Canary.RegionServerMonitor |
static class |
Canary.RegionServerStdOutSink |
(package private) static class |
Canary.RegionServerTask
Get one row from a region on the regionserver and outputs the latency, or the failure.
|
(package private) static class |
Canary.RegionTask
For each column family of the region tries to get one row and outputs the latency, or the
failure.
|
static interface |
Canary.Sink |
static class |
Canary.StdOutSink |
Modifier and Type | Field and Description |
---|---|
private static String |
CANARY_TABLE_FAMILY_NAME |
private org.apache.hadoop.conf.Configuration |
conf |
private static long |
DEFAULT_INTERVAL |
private static long |
DEFAULT_TIMEOUT |
static TableName |
DEFAULT_WRITE_TABLE_NAME |
private static int |
ERROR_EXIT_CODE |
private ExecutorService |
executor |
private boolean |
failOnError |
private static int |
FAILURE_EXIT_CODE |
private static int |
INIT_ERROR_EXIT_CODE |
private long |
interval |
private static org.apache.commons.logging.Log |
LOG |
private static int |
MAX_THREADS_NUM |
private boolean |
regionServerAllRegions |
private boolean |
regionServerMode |
private Canary.Sink |
sink |
private long |
timeout |
private static int |
TIMEOUT_ERROR_EXIT_CODE |
private boolean |
treatFailureAsError |
private static int |
USAGE_EXIT_CODE |
private boolean |
useRegExp |
private boolean |
writeSniffing |
private TableName |
writeTableName |
Constructor and Description |
---|
Canary() |
Canary(ExecutorService executor,
Canary.Sink sink) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
getConf() |
static void |
main(String[] args) |
Canary.Monitor |
newMonitor(Connection connection,
int index,
String[] args)
A Factory method for
Canary.Monitor . |
private int |
parseArgs(String[] args) |
private void |
printUsageAndExit() |
int |
run(String[] args) |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
private static List<Future<Void>> |
sniff(Admin admin,
Canary.Sink sink,
HTableDescriptor tableDesc,
ExecutorService executor,
Canary.RegionTask.TaskType taskType) |
private static List<Future<Void>> |
sniff(Admin admin,
Canary.Sink sink,
String tableName,
ExecutorService executor,
Canary.RegionTask.TaskType taskType)
Canary entry point for specified table.
|
static void |
sniff(Admin admin,
TableName tableName)
Canary entry point for specified table.
|
static void |
sniff(Admin admin,
TableName tableName,
Canary.RegionTask.TaskType taskType)
Canary entry point for specified table with task type(read/write)
|
private static void |
sniffRegion(Admin admin,
Canary.Sink sink,
HRegionInfo region,
Table table) |
private static final int USAGE_EXIT_CODE
private static final int INIT_ERROR_EXIT_CODE
private static final int TIMEOUT_ERROR_EXIT_CODE
private static final int ERROR_EXIT_CODE
private static final int FAILURE_EXIT_CODE
private static final long DEFAULT_INTERVAL
private static final long DEFAULT_TIMEOUT
private static final int MAX_THREADS_NUM
private static final org.apache.commons.logging.Log LOG
public static final TableName DEFAULT_WRITE_TABLE_NAME
private static final String CANARY_TABLE_FAMILY_NAME
private org.apache.hadoop.conf.Configuration conf
private long interval
private Canary.Sink sink
private boolean useRegExp
private long timeout
private boolean failOnError
private boolean regionServerMode
private boolean regionServerAllRegions
private boolean writeSniffing
private boolean treatFailureAsError
private TableName writeTableName
private ExecutorService executor
public Canary()
public Canary(ExecutorService executor, Canary.Sink sink)
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
private int parseArgs(String[] args)
public int run(String[] args) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
private void printUsageAndExit()
public Canary.Monitor newMonitor(Connection connection, int index, String[] args)
Canary.Monitor
.
Can be overridden by user.index
- a start index for monitor targetargs
- args passed from userpublic static void sniff(Admin admin, TableName tableName) throws Exception
Exception
public static void sniff(Admin admin, TableName tableName, Canary.RegionTask.TaskType taskType) throws Exception
Exception
private static List<Future<Void>> sniff(Admin admin, Canary.Sink sink, String tableName, ExecutorService executor, Canary.RegionTask.TaskType taskType) throws Exception
Exception
private static List<Future<Void>> sniff(Admin admin, Canary.Sink sink, HTableDescriptor tableDesc, ExecutorService executor, Canary.RegionTask.TaskType taskType) throws Exception
Exception
private static void sniffRegion(Admin admin, Canary.Sink sink, HRegionInfo region, Table table) throws Exception
Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.