@InterfaceAudience.LimitedPrivate(value="Tools") public class CanaryTool extends Object implements org.apache.hadoop.util.Tool, Canary
| Modifier and Type | Class and Description |
|---|---|
static class |
CanaryTool.Monitor
A Monitor super-class can be extended by users
|
private static class |
CanaryTool.RegionMonitor
A monitor for region mode.
|
private static class |
CanaryTool.RegionServerMonitor
A monitor for regionserver mode
|
static class |
CanaryTool.RegionServerStdOutSink
By RegionServer, for 'regionserver' mode.
|
(package private) static class |
CanaryTool.RegionServerTask
Run a single RegionServer Task and then exit.
|
static class |
CanaryTool.RegionStdOutSink
By Region, for 'region' mode.
|
(package private) static class |
CanaryTool.RegionTask
Run a single Region Task and then exit.
|
static class |
CanaryTool.RegionTaskResult
Canary region mode-specific data structure which stores information about each region
to be scanned
|
static interface |
CanaryTool.Sink
Sink interface used by the canary to output information
|
static class |
CanaryTool.StdOutSink
Simple implementation of canary sink that allows plotting to a file or standard output.
|
private static class |
CanaryTool.ZookeeperMonitor |
static class |
CanaryTool.ZookeeperStdOutSink
Output for 'zookeeper' mode.
|
(package private) static class |
CanaryTool.ZookeeperTask
Run a single zookeeper Task and then exit.
|
| Constructor and Description |
|---|
CanaryTool() |
CanaryTool(org.apache.hadoop.conf.Configuration conf,
ExecutorService executor) |
CanaryTool(org.apache.hadoop.conf.Configuration conf,
ExecutorService executor,
CanaryTool.Sink sink) |
CanaryTool(ExecutorService executor) |
CanaryTool(ExecutorService executor,
CanaryTool.Sink sink) |
| Modifier and Type | Method and Description |
|---|---|
int |
checkRegions(String[] targets)
Run Canary in Region mode.
|
int |
checkRegionServers(String[] targets)
Runs Canary in Region server mode.
|
int |
checkZooKeeper()
Runs Canary in Zookeeper mode.
|
org.apache.hadoop.conf.Configuration |
getConf() |
Map<String,String> |
getReadFailures() |
(package private) CanaryTool.Sink |
getSink(org.apache.hadoop.conf.Configuration configuration,
Class clazz) |
Map<String,String> |
getWriteFailures() |
static void |
main(String[] args) |
private CanaryTool.Monitor |
newMonitor(Connection connection,
String[] monitorTargets)
A Factory method for
CanaryTool.Monitor. |
private int |
parseArgs(String[] args) |
private void |
populateReadTableTimeoutsMap(String configuredReadTableTimeoutsStr) |
private void |
printUsageAndExit() |
int |
run(String[] args) |
private int |
runMonitor(String[] monitorTargets) |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
private static List<Future<Void>> |
sniff(Admin admin,
CanaryTool.Sink sink,
String tableName,
ExecutorService executor,
CanaryTool.RegionTask.TaskType taskType,
boolean rawScanEnabled,
LongAdder readLatency)
Canary entry point for specified table.
|
private static List<Future<Void>> |
sniff(Admin admin,
CanaryTool.Sink sink,
TableDescriptor tableDesc,
ExecutorService executor,
CanaryTool.RegionTask.TaskType taskType,
boolean rawScanEnabled,
LongAdder rwLatency) |
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.slf4j.Logger 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 CanaryTool.Sink sink
private boolean regionServerMode
private boolean zookeeperMode
private HashMap<String,Long> configuredReadTableTimeouts
public static final String HBASE_CANARY_REGIONSERVER_ALL_REGIONS
public static final String HBASE_CANARY_REGION_WRITE_SNIFFING
public static final String HBASE_CANARY_REGION_WRITE_TABLE_TIMEOUT
public static final String HBASE_CANARY_REGION_WRITE_TABLE_NAME
public static final String HBASE_CANARY_REGION_READ_TABLE_TIMEOUT
public static final String HBASE_CANARY_ZOOKEEPER_PERMITTED_FAILURES
public static final String HBASE_CANARY_USE_REGEX
public static final String HBASE_CANARY_TIMEOUT
public static final String HBASE_CANARY_FAIL_ON_ERROR
private ExecutorService executor
public CanaryTool()
public CanaryTool(ExecutorService executor)
CanaryTool(ExecutorService executor, CanaryTool.Sink sink)
CanaryTool(org.apache.hadoop.conf.Configuration conf, ExecutorService executor)
CanaryTool(org.apache.hadoop.conf.Configuration conf, ExecutorService executor, CanaryTool.Sink sink)
public int checkRegions(String[] targets) throws Exception
CanarycheckRegions in interface Canarytargets - -- list of monitor tables.Exceptionpublic int checkRegionServers(String[] targets) throws Exception
CanarycheckRegionServers in interface Canarytargets - -- list of monitor tables.Exceptionpublic int checkZooKeeper() throws Exception
CanarycheckZooKeeper in interface CanaryExceptionpublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic int run(String[] args) throws Exception
run in interface org.apache.hadoop.util.ToolExceptionprivate int runMonitor(String[] monitorTargets) throws Exception
Exceptionpublic Map<String,String> getReadFailures()
getReadFailures in interface Canarypublic Map<String,String> getWriteFailures()
getWriteFailures in interface Canaryprivate void printUsageAndExit()
CanaryTool.Sink getSink(org.apache.hadoop.conf.Configuration configuration, Class clazz)
private CanaryTool.Monitor newMonitor(Connection connection, String[] monitorTargets)
CanaryTool.Monitor.
Makes a RegionServerMonitor, or a ZooKeeperMonitor, or a RegionMonitor.private void populateReadTableTimeoutsMap(String configuredReadTableTimeoutsStr)
private static List<Future<Void>> sniff(Admin admin, CanaryTool.Sink sink, String tableName, ExecutorService executor, CanaryTool.RegionTask.TaskType taskType, boolean rawScanEnabled, LongAdder readLatency) throws Exception
Exceptionprivate static List<Future<Void>> sniff(Admin admin, CanaryTool.Sink sink, TableDescriptor tableDesc, ExecutorService executor, CanaryTool.RegionTask.TaskType taskType, boolean rawScanEnabled, LongAdder rwLatency) throws Exception
ExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.