001/**
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *     http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 */
019
020package org.apache.hadoop.hbase.tool;
021
022
023import java.util.Map;
024import java.util.concurrent.ExecutorService;
025import org.apache.hadoop.conf.Configuration;
026import org.apache.yetus.audience.InterfaceAudience;
027
028@InterfaceAudience.Public
029public interface Canary {
030
031  static Canary create(Configuration conf, ExecutorService executor) {
032    return new CanaryTool(conf, executor);
033  }
034
035  @InterfaceAudience.Private
036  static Canary create(Configuration conf, ExecutorService executor, CanaryTool.Sink sink) {
037    return new CanaryTool(conf, executor, sink);
038  }
039
040  /**
041   * Run Canary in Region mode.
042   *
043   * @param targets -- list of monitor tables.
044   * @return the exit code of the Canary tool.
045   */
046  public int checkRegions(String[] targets) throws Exception;
047
048  /**
049   * Runs Canary in Region server mode.
050   *
051   * @param targets -- list of monitor tables.
052   * @return the exit code of the Canary tool.
053   */
054  public int checkRegionServers(String[] targets) throws Exception;
055
056  /**
057   * Runs Canary in Zookeeper mode.
058   *
059   * @return the exit code of the Canary tool.
060   */
061  public int checkZooKeeper() throws Exception;
062
063  public Map<String, String> getReadFailures();
064
065  public Map<String, String> getWriteFailures();
066}