@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.MonitorA Monitor super-class can be extended by users | 
| private static class  | CanaryTool.RegionMonitorA monitor for region mode. | 
| private static class  | CanaryTool.RegionServerMonitorA monitor for regionserver mode | 
| static class  | CanaryTool.RegionServerStdOutSinkBy RegionServer, for 'regionserver' mode. | 
| (package private) static class  | CanaryTool.RegionServerTaskRun a single RegionServer Task and then exit. | 
| static class  | CanaryTool.RegionStdOutSinkBy Region, for 'region'  mode. | 
| (package private) static class  | CanaryTool.RegionTaskRun a single Region Task and then exit. | 
| static class  | CanaryTool.RegionTaskResultCanary region mode-specific data structure which stores information about each region
 to be scanned | 
| static interface  | CanaryTool.SinkSink interface used by the canary to output information | 
| static class  | CanaryTool.StdOutSinkSimple implementation of canary sink that allows plotting to a file or standard output. | 
| private static class  | CanaryTool.ZookeeperMonitor | 
| static class  | CanaryTool.ZookeeperStdOutSinkOutput for 'zookeeper' mode. | 
| (package private) static class  | CanaryTool.ZookeeperTaskRun 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() | 
| private void | putUpWebUI() | 
| 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,
     boolean readAllCF)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,
     boolean readAllCF) | 
public static final String HBASE_CANARY_INFO_PORT
public static final String HBASE_CANARY_INFO_BINDADDRESS
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)
@InterfaceAudience.Private 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)
private void putUpWebUI() throws IOException
IOExceptionpublic 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, boolean readAllCF) throws Exception
Exception - exceptionprivate static List<Future<Void>> sniff(Admin admin, CanaryTool.Sink sink, TableDescriptor tableDesc, ExecutorService executor, CanaryTool.RegionTask.TaskType taskType, boolean rawScanEnabled, LongAdder rwLatency, boolean readAllCF) throws Exception
ExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.