@InterfaceAudience.Private public final class Canary extends Object implements org.apache.hadoop.util.Tool
Modifier and Type | Class and Description |
---|---|
static class |
Canary.Monitor
A Monitor super-class can be extended by users
|
private static class |
Canary.RegionMonitor
A monitor for region mode.
|
private static class |
Canary.RegionServerMonitor
A monitor for regionserver mode
|
static class |
Canary.RegionServerStdOutSink
By RegionServer, for 'regionserver' mode.
|
(package private) static class |
Canary.RegionServerTask
Run a single RegionServer Task and then exit.
|
static class |
Canary.RegionStdOutSink
By Region, for 'region' mode.
|
(package private) static class |
Canary.RegionTask
Run a single Region Task and then exit.
|
static interface |
Canary.Sink
Sink interface used by the canary to output information
|
static class |
Canary.StdOutSink
Simple implementation of canary sink that allows plotting to a file or standard output.
|
private static class |
Canary.ZookeeperMonitor |
static class |
Canary.ZookeeperStdOutSink
Output for 'zookeeper' mode.
|
(package private) static class |
Canary.ZookeeperTask
Run 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> |
configuredReadTableTimeouts
This 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 |
regionServerMode
True 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 |
zookeeperMode
True 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.Configurable
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public int run(String[] args) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
public 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
Exception
private static List<Future<Void>> sniff(Admin admin, Canary.Sink sink, TableDescriptor tableDesc, ExecutorService executor, Canary.RegionTask.TaskType taskType, boolean rawScanEnabled, LongAdder rwLatency) throws Exception
Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.