@InterfaceAudience.Private public final class Canary extends Object implements org.apache.hadoop.util.Tool
| Modifier and Type | Class and Description | 
|---|---|
| static class  | Canary.MonitorA Monitor super-class can be extended by users | 
| private static class  | Canary.RegionMonitorA monitor for region mode. | 
| private static class  | Canary.RegionServerMonitorA monitor for regionserver mode | 
| static class  | Canary.RegionServerStdOutSinkBy RegionServer, for 'regionserver' mode. | 
| (package private) static class  | Canary.RegionServerTaskRun a single RegionServer Task and then exit. | 
| static class  | Canary.RegionStdOutSinkBy Region, for 'region'  mode. | 
| (package private) static class  | Canary.RegionTaskRun a single Region Task and then exit. | 
| static interface  | Canary.SinkSink interface used by the canary to output information | 
| static class  | Canary.StdOutSinkSimple implementation of canary sink that allows plotting to a file or standard output. | 
| private static class  | Canary.ZookeeperMonitor | 
| static class  | Canary.ZookeeperStdOutSinkOutput for 'zookeeper' mode. | 
| (package private) static class  | Canary.ZookeeperTaskRun a single zookeeper Task and then exit. | 
| Modifier and Type | Field and Description | 
|---|---|
| private static String | CANARY_TABLE_FAMILY_NAME | 
| private org.apache.hadoop.conf.Configuration | conf | 
| private HashMap<String,Long> | configuredReadTableTimeoutsThis is a Map of table to timeout. | 
| private long | configuredWriteTableTimeout | 
| 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.slf4j.Logger | LOG | 
| private static int | MAX_THREADS_NUM | 
| private long | permittedFailures | 
| private boolean | regionServerAllRegions | 
| private boolean | regionServerModeTrue if we are to run in 'regionServer' mode. | 
| 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 | 
| private boolean | zookeeperModeTrue if we are to run in zookeeper 'mode'. | 
| Constructor and Description | 
|---|
| Canary() | 
| Canary(ExecutorService executor) | 
| Canary(ExecutorService executor,
      Canary.Sink sink) | 
| Modifier and Type | Method and Description | 
|---|---|
| org.apache.hadoop.conf.Configuration | getConf() | 
| Map<String,String> | getReadFailures() | 
| (package private) Canary.Sink | getSink(org.apache.hadoop.conf.Configuration configuration,
       Class clazz) | 
| Map<String,String> | getWriteFailures() | 
| 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,
     String tableName,
     ExecutorService executor,
     Canary.RegionTask.TaskType taskType,
     boolean rawScanEnabled,
     LongAdder readLatency)Canary entry point for specified table. | 
| private static List<Future<Void>> | sniff(Admin admin,
     Canary.Sink sink,
     TableDescriptor tableDesc,
     ExecutorService executor,
     Canary.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 Canary.Sink sink
private boolean useRegExp
private long timeout
private boolean failOnError
private boolean regionServerMode
private boolean zookeeperMode
private long permittedFailures
private boolean regionServerAllRegions
private boolean writeSniffing
private long configuredWriteTableTimeout
private boolean treatFailureAsError
private TableName writeTableName
private HashMap<String,Long> configuredReadTableTimeouts
private ExecutorService executor
public Canary()
public Canary(ExecutorService executor)
Canary(ExecutorService executor, Canary.Sink sink)
public 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.ToolExceptionpublic Map<String,String> getReadFailures()
public Map<String,String> getWriteFailures()
private void printUsageAndExit()
Canary.Sink getSink(org.apache.hadoop.conf.Configuration configuration, Class clazz)
public Canary.Monitor newMonitor(Connection connection, int index, String[] args)
Canary.Monitor.
 Makes a RegionServerMonitor, or a ZooKeeperMonitor, or a RegionMonitor.index - a start index for monitor targetargs - args passed from userprivate static List<Future<Void>> sniff(Admin admin, Canary.Sink sink, String tableName, ExecutorService executor, Canary.RegionTask.TaskType taskType, boolean rawScanEnabled, LongAdder readLatency) throws Exception
Exceptionprivate static List<Future<Void>> sniff(Admin admin, Canary.Sink sink, TableDescriptor tableDesc, ExecutorService executor, Canary.RegionTask.TaskType taskType, boolean rawScanEnabled, LongAdder rwLatency) throws Exception
ExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.