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.client;
019
020import java.io.Closeable;
021import java.io.IOException;
022import org.apache.hadoop.hbase.Abortable;
023import org.apache.hadoop.hbase.HBaseInterfaceAudience;
024import org.apache.yetus.audience.InterfaceAudience;
025
026/**
027 * Hbck APIs for HBase. Obtain an instance from {@link ClusterConnection#getHbck()} and call
028 * {@link #close()} when done.
029 * <p>Hbck client APIs will be mostly used by hbck tool which in turn can be used by operators to
030 * fix HBase and bringging it to consistent state.</p>
031 *
032 * @see ConnectionFactory
033 * @see ClusterConnection
034 * @since 2.2.0
035 */
036@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.HBCK)
037public interface Hbck extends Abortable, Closeable {
038  /**
039   * Update table state in Meta only. No procedures are submitted to open/ assign or close/
040   * unassign regions of the table. This is useful only when some procedures/ actions are stuck
041   * beause of inconsistency between region and table states.
042   *
043   * NOTE: This is a dangerous action, as existing running procedures for the table or regions
044   * which belong to the table may get confused.
045   *
046   * @param state table state
047   * @return previous state of the table in Meta
048   */
049  TableState setTableStateInMeta(TableState state) throws IOException;
050}