001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.util;
019
020import java.util.ArrayList;
021
022import org.apache.yetus.audience.InterfaceAudience;
023import org.apache.yetus.audience.InterfaceStability;
024
025@InterfaceAudience.Private
026@InterfaceStability.Evolving
027public interface HbckErrorReporter {
028
029  enum ERROR_CODE {
030    UNKNOWN, NO_META_REGION, NULL_META_REGION, NO_VERSION_FILE, NOT_IN_META_HDFS, NOT_IN_META,
031    NOT_IN_META_OR_DEPLOYED, NOT_IN_HDFS_OR_DEPLOYED, NOT_IN_HDFS, SERVER_DOES_NOT_MATCH_META,
032    NOT_DEPLOYED, MULTI_DEPLOYED, SHOULD_NOT_BE_DEPLOYED, MULTI_META_REGION, RS_CONNECT_FAILURE,
033    FIRST_REGION_STARTKEY_NOT_EMPTY, LAST_REGION_ENDKEY_NOT_EMPTY, DUPE_STARTKEYS,
034    HOLE_IN_REGION_CHAIN, OVERLAP_IN_REGION_CHAIN, REGION_CYCLE, DEGENERATE_REGION,
035    ORPHAN_HDFS_REGION, LINGERING_SPLIT_PARENT, NO_TABLEINFO_FILE, LINGERING_REFERENCE_HFILE,
036    LINGERING_HFILELINK, WRONG_USAGE, EMPTY_META_CELL, EXPIRED_TABLE_LOCK, BOUNDARIES_ERROR,
037    ORPHAN_TABLE_STATE, NO_TABLE_STATE, UNDELETED_REPLICATION_QUEUE, DUPE_ENDKEYS,
038    UNSUPPORTED_OPTION, INVALID_TABLE
039  }
040
041  void clear();
042
043  void report(String message);
044
045  void reportError(String message);
046
047  void reportError(ERROR_CODE errorCode, String message);
048
049  void reportError(ERROR_CODE errorCode, String message, HbckTableInfo table);
050
051  void reportError(ERROR_CODE errorCode, String message, HbckTableInfo table, HbckRegionInfo info);
052
053  void reportError(ERROR_CODE errorCode, String message, HbckTableInfo table, HbckRegionInfo info1,
054      HbckRegionInfo info2);
055
056  int summarize();
057
058  void detail(String details);
059
060  ArrayList<ERROR_CODE> getErrorList();
061
062  void progress();
063
064  void print(String message);
065
066  void resetErrors();
067
068  boolean tableHasErrors(HbckTableInfo table);
069}