All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hadoop.hbase.client.Admin Maven / Gradle / Ivy

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.hadoop.hbase.client;

import java.io.Closeable;
import java.io.IOException;
import java.util.Collection;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
import java.util.regex.Pattern;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.Abortable;
import org.apache.hadoop.hbase.CacheEvictionStats;
import org.apache.hadoop.hbase.ClusterMetrics;
import org.apache.hadoop.hbase.ClusterMetrics.Option;
import org.apache.hadoop.hbase.ClusterStatus;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.NamespaceNotFoundException;
import org.apache.hadoop.hbase.RegionMetrics;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableExistsException;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.client.replication.TableCFs;
import org.apache.hadoop.hbase.client.security.SecurityCapability;
import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel;
import org.apache.hadoop.hbase.quotas.QuotaFilter;
import org.apache.hadoop.hbase.quotas.QuotaRetriever;
import org.apache.hadoop.hbase.quotas.QuotaSettings;
import org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException;
import org.apache.hadoop.hbase.replication.ReplicationException;
import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
import org.apache.hadoop.hbase.replication.ReplicationPeerDescription;
import org.apache.hadoop.hbase.snapshot.HBaseSnapshotException;
import org.apache.hadoop.hbase.snapshot.RestoreSnapshotException;
import org.apache.hadoop.hbase.snapshot.SnapshotCreationException;
import org.apache.hadoop.hbase.snapshot.UnknownSnapshotException;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.yetus.audience.InterfaceAudience;

/**
 * The administrative API for HBase. Obtain an instance from {@link Connection#getAdmin()} and
 * call {@link #close()} when done.
 * 

Admin can be used to create, drop, list, enable and disable and otherwise modify tables, * as well as perform other administrative operations. * * @see ConnectionFactory * @see Connection * @see Table * @since 0.99.0 */ @InterfaceAudience.Public public interface Admin extends Abortable, Closeable { int getOperationTimeout(); @Override void abort(String why, Throwable e); @Override boolean isAborted(); /** * @return Connection used by this object. */ Connection getConnection(); /** * @param tableName Table to check. * @return true if table exists already. * @throws IOException */ boolean tableExists(TableName tableName) throws IOException; /** * List all the userspace tables. * * @return an array of read-only HTableDescriptors * @throws IOException if a remote or network exception occurs * @deprecated since 2.0 version and will be removed in 3.0 version. * Use {@link #listTableDescriptors()}. * @see #listTableDescriptors() */ @Deprecated HTableDescriptor[] listTables() throws IOException; /** * List all the userspace tables. * * @return a list of TableDescriptors * @throws IOException if a remote or network exception occurs */ List listTableDescriptors() throws IOException; /** * List all the userspace tables that match the given pattern. * * @param pattern The compiled regular expression to match against * @return an array of read-only HTableDescriptors * @throws IOException if a remote or network exception occurs * @see #listTables() * @deprecated since 2.0 version and will be removed in 3.0 version. * Use {@link #listTableDescriptors(java.util.regex.Pattern)}. * @see #listTableDescriptors(Pattern) */ @Deprecated HTableDescriptor[] listTables(Pattern pattern) throws IOException; /** * List all the userspace tables that match the given pattern. * * @param pattern The compiled regular expression to match against * @return a list of TableDescriptors * @throws IOException if a remote or network exception occurs * @see #listTables() */ List listTableDescriptors(Pattern pattern) throws IOException; /** * List all the userspace tables matching the given regular expression. * * @param regex The regular expression to match against * @return a list of read-only HTableDescriptors * @throws IOException if a remote or network exception occurs * @see #listTableDescriptors(Pattern) * @deprecated since 2.0 version and will be removed in 3.0 version. Use * {@link #listTableDescriptors(Pattern)} instead. */ @Deprecated HTableDescriptor[] listTables(String regex) throws IOException; /** * List all the tables matching the given pattern. * * @param pattern The compiled regular expression to match against * @param includeSysTables false to match only against userspace tables * @return an array of read-only HTableDescriptors * @throws IOException if a remote or network exception occurs * @see #listTables() * @deprecated since 2.0 version and will be removed in 3.0 version. * Use {@link #listTableDescriptors(java.util.regex.Pattern, boolean)}. * @see #listTableDescriptors(java.util.regex.Pattern, boolean) */ @Deprecated HTableDescriptor[] listTables(Pattern pattern, boolean includeSysTables) throws IOException; /** * List all the tables matching the given pattern. * * @param pattern The compiled regular expression to match against * @param includeSysTables false to match only against userspace tables * @return a list of TableDescriptors * @throws IOException if a remote or network exception occurs * @see #listTables() */ List listTableDescriptors(Pattern pattern, boolean includeSysTables) throws IOException; /** * List all the tables matching the given pattern. * * @param regex The regular expression to match against * @param includeSysTables false to match only against userspace tables * @return an array of read-only HTableDescriptors * @throws IOException if a remote or network exception occurs * @see #listTables(java.util.regex.Pattern, boolean) * @deprecated since 2.0 version and will be removed in 3.0 version. * Use {@link #listTableDescriptors(Pattern, boolean)}. */ @Deprecated HTableDescriptor[] listTables(String regex, boolean includeSysTables) throws IOException; /** * List all of the names of userspace tables. * * @return TableName[] table names * @throws IOException if a remote or network exception occurs */ TableName[] listTableNames() throws IOException; /** * List all of the names of userspace tables. * @param pattern The regular expression to match against * @return array of table names * @throws IOException if a remote or network exception occurs */ TableName[] listTableNames(Pattern pattern) throws IOException; /** * List all of the names of userspace tables. * @param regex The regular expression to match against * @return TableName[] table names * @throws IOException if a remote or network exception occurs * @deprecated since 2.0 version and will be removed in 3.0 version. Use * {@link #listTableNames(Pattern)} instead. */ @Deprecated TableName[] listTableNames(String regex) throws IOException; /** * List all of the names of userspace tables. * @param pattern The regular expression to match against * @param includeSysTables false to match only against userspace tables * @return TableName[] table names * @throws IOException if a remote or network exception occurs */ TableName[] listTableNames(Pattern pattern, boolean includeSysTables) throws IOException; /** * List all of the names of userspace tables. * @param regex The regular expression to match against * @param includeSysTables false to match only against userspace tables * @return TableName[] table names * @throws IOException if a remote or network exception occurs * @deprecated since 2.0 version and will be removed in 3.0 version. Use * {@link #listTableNames(Pattern, boolean)} instead. */ @Deprecated TableName[] listTableNames(String regex, boolean includeSysTables) throws IOException; /** * Get a table descriptor. * * @param tableName as a {@link TableName} * @return the read-only tableDescriptor * @throws org.apache.hadoop.hbase.TableNotFoundException * @throws IOException if a remote or network exception occurs * @deprecated since 2.0 version and will be removed in 3.0 version. * Use {@link #getDescriptor(TableName)}. */ @Deprecated HTableDescriptor getTableDescriptor(TableName tableName) throws TableNotFoundException, IOException; /** * Get a table descriptor. * * @param tableName as a {@link TableName} * @return the tableDescriptor * @throws org.apache.hadoop.hbase.TableNotFoundException * @throws IOException if a remote or network exception occurs */ TableDescriptor getDescriptor(TableName tableName) throws TableNotFoundException, IOException; /** * Creates a new table. Synchronous operation. * * @param desc table descriptor for table * @throws IllegalArgumentException if the table name is reserved * @throws org.apache.hadoop.hbase.MasterNotRunningException if master is not running * @throws org.apache.hadoop.hbase.TableExistsException if table already exists (If concurrent * threads, the table may have been created between test-for-existence and attempt-at-creation). * @throws IOException if a remote or network exception occurs */ void createTable(TableDescriptor desc) throws IOException; /** * Creates a new table with the specified number of regions. The start key specified will become * the end key of the first region of the table, and the end key specified will become the start * key of the last region of the table (the first region has a null start key and the last region * has a null end key). BigInteger math will be used to divide the key range specified into enough * segments to make the required number of total regions. Synchronous operation. * * @param desc table descriptor for table * @param startKey beginning of key range * @param endKey end of key range * @param numRegions the total number of regions to create * @throws IllegalArgumentException if the table name is reserved * @throws org.apache.hadoop.hbase.MasterNotRunningException if master is not running * @throws org.apache.hadoop.hbase.TableExistsException if table already exists (If concurrent * threads, the table may have been created between test-for-existence and attempt-at-creation). * @throws IOException */ void createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions) throws IOException; /** * Creates a new table with an initial set of empty regions defined by the specified split keys. * The total number of regions created will be the number of split keys plus one. Synchronous * operation. Note : Avoid passing empty split key. * * @param desc table descriptor for table * @param splitKeys array of split keys for the initial regions of the table * @throws IllegalArgumentException if the table name is reserved, if the split keys are repeated * and if the split key has empty byte array. * @throws org.apache.hadoop.hbase.MasterNotRunningException if master is not running * @throws org.apache.hadoop.hbase.TableExistsException if table already exists (If concurrent * threads, the table may have been created between test-for-existence and attempt-at-creation). * @throws IOException */ void createTable(TableDescriptor desc, byte[][] splitKeys) throws IOException; /** * Creates a new table but does not block and wait for it to come online. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * Throws IllegalArgumentException Bad table name, if the split keys * are repeated and if the split key has empty byte array. * * @param desc table descriptor for table * @param splitKeys keys to check if the table has been created with all split keys * @throws IOException if a remote or network exception occurs * @return the result of the async creation. You can use Future.get(long, TimeUnit) * to wait on the operation to complete. */ Future createTableAsync(TableDescriptor desc, byte[][] splitKeys) throws IOException; /** * Deletes a table. Synchronous operation. * * @param tableName name of table to delete * @throws IOException if a remote or network exception occurs */ void deleteTable(TableName tableName) throws IOException; /** * Deletes the table but does not block and wait for it to be completely removed. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of table to delete * @throws IOException if a remote or network exception occurs * @return the result of the async delete. You can use Future.get(long, TimeUnit) * to wait on the operation to complete. */ Future deleteTableAsync(TableName tableName) throws IOException; /** * Deletes tables matching the passed in pattern and wait on completion. Warning: Use this method * carefully, there is no prompting and the effect is immediate. Consider using {@link * #listTableDescriptors(Pattern)} * and {@link #deleteTable(org.apache.hadoop.hbase.TableName)} * * @param regex The regular expression to match table names against * @return Table descriptors for tables that couldn't be deleted. * The return htds are read-only * @throws IOException * @see #deleteTables(java.util.regex.Pattern) * @see #deleteTable(org.apache.hadoop.hbase.TableName) * @deprecated since 2.0 version and will be removed in 3.0 version * This is just a trivial helper method without any magic. * Consider using {@link #listTableDescriptors(Pattern)} * and {@link #deleteTable(TableName)} */ @Deprecated HTableDescriptor[] deleteTables(String regex) throws IOException; /** * Delete tables matching the passed in pattern and wait on completion. Warning: Use this method * carefully, there is no prompting and the effect is immediate. Consider using {@link * #listTableDescriptors(java.util.regex.Pattern)} and * {@link #deleteTable(org.apache.hadoop.hbase.TableName)} * * @param pattern The pattern to match table names against * @return Table descriptors for tables that couldn't be deleted * The return htds are read-only * @throws IOException * @deprecated since 2.0 version and will be removed in 3.0 version * This is just a trivial helper method without any magic. * Consider using {@link #listTableDescriptors(java.util.regex.Pattern)} * and {@link #deleteTable(TableName)} */ @Deprecated HTableDescriptor[] deleteTables(Pattern pattern) throws IOException; /** * Truncate a table. * Synchronous operation. * * @param tableName name of table to truncate * @param preserveSplits true if the splits should be preserved * @throws IOException if a remote or network exception occurs */ void truncateTable(TableName tableName, boolean preserveSplits) throws IOException; /** * Truncate the table but does not block and wait for it to be completely enabled. You can use * Future.get(long, TimeUnit) to wait on the operation to complete. It may throw * ExecutionException if there was an error while executing the operation or TimeoutException in * case the wait timeout was not long enough to allow the operation to complete. * @param tableName name of table to delete * @param preserveSplits true if the splits should be preserved * @throws IOException if a remote or network exception occurs * @return the result of the async truncate. You can use Future.get(long, TimeUnit) to wait on the * operation to complete. */ Future truncateTableAsync(TableName tableName, boolean preserveSplits) throws IOException; /** * Enable a table. May timeout. Use {@link #enableTableAsync(org.apache.hadoop.hbase.TableName)} * and {@link #isTableEnabled(org.apache.hadoop.hbase.TableName)} instead. The table has to be in * disabled state for it to be enabled. * * @param tableName name of the table * @throws IOException if a remote or network exception occurs There could be couple types of * IOException TableNotFoundException means the table doesn't exist. TableNotDisabledException * means the table isn't in disabled state. * @see #isTableEnabled(org.apache.hadoop.hbase.TableName) * @see #disableTable(org.apache.hadoop.hbase.TableName) * @see #enableTableAsync(org.apache.hadoop.hbase.TableName) */ void enableTable(TableName tableName) throws IOException; /** * Enable the table but does not block and wait for it to be completely enabled. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of table to delete * @throws IOException if a remote or network exception occurs * @return the result of the async enable. You can use Future.get(long, TimeUnit) * to wait on the operation to complete. */ Future enableTableAsync(TableName tableName) throws IOException; /** * Enable tables matching the passed in pattern and wait on completion. Warning: Use this method * carefully, there is no prompting and the effect is immediate. Consider using {@link * #listTableDescriptors(Pattern)} and {@link #enableTable(org.apache.hadoop.hbase.TableName)} * * @param regex The regular expression to match table names against * @throws IOException * @return Table descriptors for tables that couldn't be enabled. * The return HTDs are read-only. * @see #enableTables(java.util.regex.Pattern) * @see #enableTable(org.apache.hadoop.hbase.TableName) * @deprecated since 2.0 version and will be removed in 3.0 version * This is just a trivial helper method without any magic. * Consider using {@link #listTableDescriptors(Pattern)} * and {@link #enableTable(org.apache.hadoop.hbase.TableName)} */ @Deprecated HTableDescriptor[] enableTables(String regex) throws IOException; /** * Enable tables matching the passed in pattern and wait on completion. Warning: Use this method * carefully, there is no prompting and the effect is immediate. Consider using {@link * #listTableDescriptors(java.util.regex.Pattern)} and * {@link #enableTable(org.apache.hadoop.hbase.TableName)} * * @param pattern The pattern to match table names against * @throws IOException * @return Table descriptors for tables that couldn't be enabled. * The return HTDs are read-only. * @deprecated since 2.0 version and will be removed in 3.0 version * This is just a trivial helper method without any magic. * Consider using {@link #listTableDescriptors(java.util.regex.Pattern)} * and {@link #enableTable(org.apache.hadoop.hbase.TableName)} */ @Deprecated HTableDescriptor[] enableTables(Pattern pattern) throws IOException; /** * Disable the table but does not block and wait for it to be completely disabled. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of table to delete * @throws IOException if a remote or network exception occurs * @return the result of the async disable. You can use Future.get(long, TimeUnit) * to wait on the operation to complete. */ Future disableTableAsync(TableName tableName) throws IOException; /** * Disable table and wait on completion. May timeout eventually. Use {@link * #disableTableAsync(org.apache.hadoop.hbase.TableName)} and * {@link #isTableDisabled(org.apache.hadoop.hbase.TableName)} instead. The table has to be in * enabled state for it to be disabled. * * @param tableName * @throws IOException There could be couple types of IOException TableNotFoundException means the * table doesn't exist. TableNotEnabledException means the table isn't in enabled state. */ void disableTable(TableName tableName) throws IOException; /** * Disable tables matching the passed in pattern and wait on completion. Warning: Use this method * carefully, there is no prompting and the effect is immediate. Consider using {@link * #listTableDescriptors(Pattern)} and {@link #disableTable(org.apache.hadoop.hbase.TableName)} * * @param regex The regular expression to match table names against * @return Table descriptors for tables that couldn't be disabled * The return htds are read-only * @throws IOException * @see #disableTables(java.util.regex.Pattern) * @see #disableTable(org.apache.hadoop.hbase.TableName) * @deprecated since 2.0 version and will be removed in 3.0 version * This is just a trivial helper method without any magic. * Consider using {@link #listTableDescriptors(Pattern)} * and {@link #disableTable(org.apache.hadoop.hbase.TableName)} */ @Deprecated HTableDescriptor[] disableTables(String regex) throws IOException; /** * Disable tables matching the passed in pattern and wait on completion. Warning: Use this method * carefully, there is no prompting and the effect is immediate. Consider using {@link * #listTableDescriptors(java.util.regex.Pattern)} and * {@link #disableTable(org.apache.hadoop.hbase.TableName)} * * @param pattern The pattern to match table names against * @return Table descriptors for tables that couldn't be disabled * The return htds are read-only * @throws IOException * @deprecated since 2.0 version and will be removed in 3.0 version * This is just a trivial helper method without any magic. * Consider using {@link #listTableDescriptors(java.util.regex.Pattern)} * and {@link #disableTable(org.apache.hadoop.hbase.TableName)} */ @Deprecated HTableDescriptor[] disableTables(Pattern pattern) throws IOException; /** * @param tableName name of table to check * @return true if table is on-line * @throws IOException if a remote or network exception occurs */ boolean isTableEnabled(TableName tableName) throws IOException; /** * @param tableName name of table to check * @return true if table is off-line * @throws IOException if a remote or network exception occurs */ boolean isTableDisabled(TableName tableName) throws IOException; /** * @param tableName name of table to check * @return true if all regions of the table are available * @throws IOException if a remote or network exception occurs */ boolean isTableAvailable(TableName tableName) throws IOException; /** * Use this api to check if the table has been created with the specified number of splitkeys * which was used while creating the given table. Note : If this api is used after a table's * region gets splitted, the api may return false. * * @param tableName name of table to check * @param splitKeys keys to check if the table has been created with all split keys * @throws IOException if a remote or network excpetion occurs * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #isTableAvailable(TableName)} */ @Deprecated boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException; /** * Get the status of an alter (a.k.a modify) command - indicates how * many regions have received the updated schema Asynchronous operation. * * @param tableName TableName instance * @return Pair indicating the number of regions updated Pair.getFirst() is the regions that are * yet to be updated Pair.getSecond() is the total number of regions of the table * @throws IOException if a remote or network exception occurs * @deprecated Since 2.0.0. Will be removed in 3.0.0. No longer needed now you get a Future * on an operation. */ @Deprecated Pair getAlterStatus(TableName tableName) throws IOException; /** * Get the status of alter (a.k.a modify) command - indicates how many * regions have received the updated schema Asynchronous operation. * * @param tableName name of the table to get the status of * @return Pair indicating the number of regions updated Pair.getFirst() is the regions that are * yet to be updated Pair.getSecond() is the total number of regions of the table * @throws IOException if a remote or network exception occurs * @deprecated Since 2.0.0. Will be removed in 3.0.0. No longer needed now you get a Future * on an operation. */ @Deprecated Pair getAlterStatus(byte[] tableName) throws IOException; /** * Add a column family to an existing table. Synchronous operation. * Use {@link #addColumnFamilyAsync(TableName, ColumnFamilyDescriptor)} instead because it * returns a {@link Future} from which you can learn whether success or failure. * * @param tableName name of the table to add column family to * @param columnFamily column family descriptor of column family to be added * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0. * This will be removed in HBase 3.0.0. * Use {@link #addColumnFamily(TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void addColumn(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { addColumnFamily(tableName, columnFamily); } /** * Add a column family to an existing table. Synchronous operation. * Use {@link #addColumnFamilyAsync(TableName, ColumnFamilyDescriptor)} instead because it * returns a {@link Future} from which you can learn whether success or failure. * * @param tableName name of the table to add column family to * @param columnFamily column family descriptor of column family to be added * @throws IOException if a remote or network exception occurs */ void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException; /** * Add a column family to an existing table. Asynchronous operation. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of the table to add column family to * @param columnFamily column family descriptor of column family to be added * @throws IOException if a remote or network exception occurs * @return the result of the async add column family. You can use Future.get(long, TimeUnit) to * wait on the operation to complete. */ Future addColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException; /** * Delete a column family from a table. Synchronous operation. * Use {@link #deleteColumnFamily(TableName, byte[])} instead because it * returns a {@link Future} from which you can learn whether success or failure. * * @param tableName name of table * @param columnFamily name of column family to be deleted * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0. * This will be removed in HBase 3.0.0. * Use {@link #deleteColumnFamily(TableName, byte[])}}. */ @Deprecated void deleteColumn(TableName tableName, byte[] columnFamily) throws IOException; /** * Delete a column family from a table. Synchronous operation. * Use {@link #deleteColumnFamily(TableName, byte[])} instead because it * returns a {@link Future} from which you can learn whether success or failure. * @param tableName name of table * @param columnFamily name of column family to be deleted * @throws IOException if a remote or network exception occurs */ void deleteColumnFamily(TableName tableName, byte[] columnFamily) throws IOException; /** * Delete a column family from a table. Asynchronous operation. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of table * @param columnFamily name of column family to be deleted * @throws IOException if a remote or network exception occurs * @return the result of the async delete column family. You can use Future.get(long, TimeUnit) to * wait on the operation to complete. */ Future deleteColumnFamilyAsync(TableName tableName, byte[] columnFamily) throws IOException; /** * Modify an existing column family on a table. Synchronous operation. * Use {@link #modifyColumnFamilyAsync(TableName, ColumnFamilyDescriptor)} instead because it * returns a {@link Future} from which you can learn whether success or failure. * @param tableName name of table * @param columnFamily new column family descriptor to use * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0. * This will be removed in HBase 3.0.0. * Use {@link #modifyColumnFamily(TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void modifyColumn(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { modifyColumnFamily(tableName, columnFamily); } /** * Modify an existing column family on a table. Synchronous operation. * Use {@link #modifyColumnFamilyAsync(TableName, ColumnFamilyDescriptor)} instead because it * returns a {@link Future} from which you can learn whether success or failure. * @param tableName name of table * @param columnFamily new column family descriptor to use * @throws IOException if a remote or network exception occurs */ void modifyColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException; /** * Modify an existing column family on a table. Asynchronous operation. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of table * @param columnFamily new column family descriptor to use * @throws IOException if a remote or network exception occurs * @return the result of the async modify column family. You can use Future.get(long, TimeUnit) to * wait on the operation to complete. */ Future modifyColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException; /** * Uses {@link #unassign(byte[], boolean)} to unassign the region. For expert-admins. * * @param regionname region name to close * @param serverName Deprecated. Not used. * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #unassign(byte[], boolean)}. */ @Deprecated void closeRegion(String regionname, String serverName) throws IOException; /** * Uses {@link #unassign(byte[], boolean)} to unassign the region. For expert-admins. * * @param regionname region name to close * @param serverName Deprecated. Not used. * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #unassign(byte[], boolean)}. */ @Deprecated void closeRegion(byte[] regionname, String serverName) throws IOException; /** * Uses {@link #unassign(byte[], boolean)} to unassign the region. For expert-admins. * * @param encodedRegionName The encoded region name; i.e. the hash that makes up the region name * suffix: e.g. if regionname is * TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396., * then the encoded region name is: 527db22f95c8a9e0116f0cc13c680396. * @param serverName Deprecated. Not used. * @return Deprecated. Returns true always. * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #unassign(byte[], boolean)}. */ @Deprecated boolean closeRegionWithEncodedRegionName(String encodedRegionName, String serverName) throws IOException; /** * Used {@link #unassign(byte[], boolean)} to unassign the region. For expert-admins. * * @param sn Deprecated. Not used. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-18231). * Use {@link #unassign(byte[], boolean)}. */ @Deprecated void closeRegion(final ServerName sn, final HRegionInfo hri) throws IOException; /** * Get all the online regions on a region server. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-17980). * Use {@link #getRegions(ServerName sn)}. */ @Deprecated List getOnlineRegions(ServerName sn) throws IOException; /** * Get all the online regions on a region server. * * @return List of {@link RegionInfo} * @throws java.io.IOException */ List getRegions(ServerName serverName) throws IOException; /** * Flush a table. Synchronous operation. * * @param tableName table to flush * @throws IOException if a remote or network exception occurs */ void flush(TableName tableName) throws IOException; /** * Flush an individual region. Synchronous operation. * * @param regionName region to flush * @throws IOException if a remote or network exception occurs */ void flushRegion(byte[] regionName) throws IOException; /** * Flush all regions on the region server. Synchronous operation. * @param serverName the region server name to flush * @throws IOException if a remote or network exception occurs */ void flushRegionServer(ServerName serverName) throws IOException; /** * Compact a table. Asynchronous operation in that this method requests that a * Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param tableName table to compact * @throws IOException if a remote or network exception occurs */ void compact(TableName tableName) throws IOException; /** * Compact an individual region. Asynchronous operation in that this method requests that a * Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param regionName region to compact * @throws IOException if a remote or network exception occurs */ void compactRegion(byte[] regionName) throws IOException; /** * Compact a column family within a table. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param tableName table to compact * @param columnFamily column family within a table * @throws IOException if a remote or network exception occurs */ void compact(TableName tableName, byte[] columnFamily) throws IOException; /** * Compact a column family within a region. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param regionName region to compact * @param columnFamily column family within a region * @throws IOException if a remote or network exception occurs */ void compactRegion(byte[] regionName, byte[] columnFamily) throws IOException; /** * Compact a table. Asynchronous operation in that this method requests that a * Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param tableName table to compact * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} * @throws IOException if a remote or network exception occurs * @throws InterruptedException */ void compact(TableName tableName, CompactType compactType) throws IOException, InterruptedException; /** * Compact a column family within a table. Asynchronous operation in that this method * requests that a Compaction run and then it returns. It does not wait on the * completion of Compaction (it can take a while). * * @param tableName table to compact * @param columnFamily column family within a table * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} * @throws IOException if not a mob column family or if a remote or network exception occurs * @throws InterruptedException */ void compact(TableName tableName, byte[] columnFamily, CompactType compactType) throws IOException, InterruptedException; /** * Major compact a table. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param tableName table to major compact * @throws IOException if a remote or network exception occurs */ void majorCompact(TableName tableName) throws IOException; /** * Major compact a table or an individual region. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param regionName region to major compact * @throws IOException if a remote or network exception occurs */ void majorCompactRegion(byte[] regionName) throws IOException; /** * Major compact a column family within a table. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param tableName table to major compact * @param columnFamily column family within a table * @throws IOException if a remote or network exception occurs */ void majorCompact(TableName tableName, byte[] columnFamily) throws IOException; /** * Major compact a column family within region. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param regionName egion to major compact * @param columnFamily column family within a region * @throws IOException if a remote or network exception occurs */ void majorCompactRegion(byte[] regionName, byte[] columnFamily) throws IOException; /** * Major compact a table. Asynchronous operation in that this method requests that a * Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param tableName table to compact * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} * @throws IOException if a remote or network exception occurs * @throws InterruptedException */ void majorCompact(TableName tableName, CompactType compactType) throws IOException, InterruptedException; /** * Major compact a column family within a table. Asynchronous operation in that this method requests that a * Compaction run and then it returns. It does not wait on the completion of Compaction * (it can take a while). * * @param tableName table to compact * @param columnFamily column family within a table * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} * @throws IOException if not a mob column family or if a remote or network exception occurs * @throws InterruptedException */ void majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType) throws IOException, InterruptedException; /** * Compact all regions on the region server. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction (it * can take a while). * @param sn the region server name * @param major if it's major compaction * @throws IOException if a remote or network exception occurs * @throws InterruptedException * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. Use * {@link #compactRegionServer(ServerName)} or * {@link #majorCompactRegionServer(ServerName)}. */ @Deprecated default void compactRegionServer(ServerName sn, boolean major) throws IOException, InterruptedException { if (major) { majorCompactRegionServer(sn); } else { compactRegionServer(sn); } } /** * Compact all regions on the region server. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction (it * can take a while). * @param serverName the region server name * @throws IOException if a remote or network exception occurs */ void compactRegionServer(ServerName serverName) throws IOException; /** * Major compact all regions on the region server. Asynchronous operation in that this method * requests that a Compaction run and then it returns. It does not wait on the completion of * Compaction (it can take a while). * @param serverName the region server name * @throws IOException if a remote or network exception occurs */ void majorCompactRegionServer(ServerName serverName) throws IOException; /** * Move the region r to dest. * * @param encodedRegionName The encoded region name; i.e. the hash that makes up the region name * suffix: e.g. if regionname is * TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396., * then the encoded region name is: 527db22f95c8a9e0116f0cc13c680396. * @param destServerName The servername of the destination regionserver. If passed the empty byte * array we'll assign to a random server. A server name is made of host, port and startcode. * Here is an example: host187.example.com,60020,1289493121758 * @throws IOException if we can't find a region named * encodedRegionName */ void move(byte[] encodedRegionName, byte[] destServerName) throws IOException; /** * Assign a Region. * @param regionName Region name to assign. */ void assign(byte[] regionName) throws IOException; /** * Unassign a region from current hosting regionserver. Region will then be assigned to a * regionserver chosen at random. Region could be reassigned back to the same server. Use {@link * #move(byte[], byte[])} if you want to control the region movement. * * @param regionName Region to unassign. Will clear any existing RegionPlan if one found. * @param force If true, force unassign (Will remove region from regions-in-transition too if * present. If results in double assignment use hbck -fix to resolve. To be used by experts). */ void unassign(byte[] regionName, boolean force) throws IOException; /** * Offline specified region from master's in-memory state. It will not attempt to reassign the * region as in unassign. This API can be used when a region not served by any region server and * still online as per Master's in memory state. If this API is incorrectly used on active region * then master will loose track of that region. This is a special method that should be used by * experts or hbck. * * @param regionName Region to offline. * @throws IOException */ void offline(byte[] regionName) throws IOException; /** * Turn the load balancer on or off. * * @param synchronous If true, it waits until current balance() call, if * outstanding, to return. * @return Previous balancer value * @deprecated Since 2.0.0. Will be removed in 3.0.0. * Use {@link #balancerSwitch(boolean, boolean)} instead. */ @Deprecated default boolean setBalancerRunning(boolean on, boolean synchronous) throws IOException { return balancerSwitch(on, synchronous); } /** * Turn the load balancer on or off. * @param onOrOff Set to true to enable, false to disable. * @param synchronous If true, it waits until current balance() call, if * outstanding, to return. * @return Previous balancer value */ boolean balancerSwitch(boolean onOrOff, boolean synchronous) throws IOException; /** * Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the * reassignments. Can NOT run for various reasons. Check logs. * * @return true if balancer ran, false otherwise. * @deprecated Since 2.0.0. Will be removed in 3.0.0. * Use {@link #balance()} instead. */ @Deprecated default boolean balancer() throws IOException { return balance(); } /** * Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the * reassignments. Can NOT run for various reasons. Check logs. * * @return true if balancer ran, false otherwise. */ boolean balance() throws IOException; /** * Invoke the balancer. Will run the balancer and if regions to move, it will * go ahead and do the reassignments. If there is region in transition, force parameter of true * would still run balancer. Can *not* run for other reasons. Check * logs. * @param force whether we should force balance even if there is region in transition * @return true if balancer ran, false otherwise. * @deprecated Since 2.0.0. Will be removed in 3.0.0. * Use {@link #balance(boolean)} instead. */ @Deprecated default boolean balancer(boolean force) throws IOException { return balance(force); } /** * Invoke the balancer. Will run the balancer and if regions to move, it will * go ahead and do the reassignments. If there is region in transition, force parameter of true * would still run balancer. Can *not* run for other reasons. Check * logs. * @param force whether we should force balance even if there is region in transition * @return true if balancer ran, false otherwise. */ boolean balance(boolean force) throws IOException; /** * Query the current state of the balancer. * * @return true if the balancer is enabled, false otherwise. */ boolean isBalancerEnabled() throws IOException; /** * Clear all the blocks corresponding to this table from BlockCache. For expert-admins. * Calling this API will drop all the cached blocks specific to a table from BlockCache. * This can significantly impact the query performance as the subsequent queries will * have to retrieve the blocks from underlying filesystem. * * @param tableName table to clear block cache * @return CacheEvictionStats related to the eviction * @throws IOException if a remote or network exception occurs */ CacheEvictionStats clearBlockCache(final TableName tableName) throws IOException; /** * Invoke region normalizer. Can NOT run for various reasons. Check logs. * * @return true if region normalizer ran, false otherwise. */ boolean normalize() throws IOException; /** * Query the current state of the region normalizer. * * @return true if region normalizer is enabled, false otherwise. */ boolean isNormalizerEnabled() throws IOException; /** * Turn region normalizer on or off. * * @return Previous normalizer value * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #normalizerSwitch(boolean)}} * instead. */ @Deprecated default boolean setNormalizerRunning(boolean on) throws IOException { return normalizerSwitch(on); } /** * Turn region normalizer on or off. * * @return Previous normalizer value */ boolean normalizerSwitch (boolean on) throws IOException; /** * Enable/Disable the catalog janitor. * * @param enable if true enables the catalog janitor * @return the previous state * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #catalogJanitorSwitch(boolean)}} * instead. */ @Deprecated default boolean enableCatalogJanitor(boolean enable) throws IOException { return catalogJanitorSwitch(enable); } /** * Enable/Disable the catalog janitor/ * * @param onOrOff if true enables the catalog janitor * @return the previous state */ boolean catalogJanitorSwitch(boolean onOrOff) throws IOException; /** * Ask for a scan of the catalog table. * * @return the number of entries cleaned * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #runCatalogJanitor()}} * instead. */ @Deprecated default int runCatalogScan() throws IOException { return runCatalogJanitor(); } /** * Ask for a scan of the catalog table. * * @return the number of entries cleaned */ int runCatalogJanitor() throws IOException; /** * Query on the catalog janitor state (Enabled/Disabled?). * */ boolean isCatalogJanitorEnabled() throws IOException; /** * Enable/Disable the cleaner chore. * * @param on if true enables the cleaner chore * @return the previous state * @throws IOException * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #cleanerChoreSwitch(boolean)}} * instead. */ @Deprecated default boolean setCleanerChoreRunning(boolean on) throws IOException { return cleanerChoreSwitch(on); } /** * Enable/Disable the cleaner chore. * * @param onOrOff if true enables the cleaner chore * @return the previous state * @throws IOException */ boolean cleanerChoreSwitch(boolean onOrOff) throws IOException; /** * Ask for cleaner chore to run. * * @return true if cleaner chore ran, false otherwise * @throws IOException */ boolean runCleanerChore() throws IOException; /** * Query on the cleaner chore state (Enabled/Disabled?). * * @throws IOException */ boolean isCleanerChoreEnabled() throws IOException; /** * Merge two regions. Asynchronous operation. * * @param nameOfRegionA encoded or full name of region a * @param nameOfRegionB encoded or full name of region b * @param forcible true if do a compulsory merge, otherwise we will only merge two * adjacent regions * @throws IOException * @deprecated Since 2.0. Will be removed in 3.0. Use * {@link #mergeRegionsAsync(byte[], byte[], boolean)} instead. */ @Deprecated void mergeRegions(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible) throws IOException; /** * Merge two regions. Asynchronous operation. * * @param nameOfRegionA encoded or full name of region a * @param nameOfRegionB encoded or full name of region b * @param forcible true if do a compulsory merge, otherwise we will only merge * two adjacent regions * @throws IOException */ Future mergeRegionsAsync( byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible) throws IOException; /** * Merge regions. Asynchronous operation. * * @param nameofRegionsToMerge encoded or full name of daughter regions * @param forcible true if do a compulsory merge, otherwise we will only merge * adjacent regions * @throws IOException */ Future mergeRegionsAsync( byte[][] nameofRegionsToMerge, boolean forcible) throws IOException; /** + Split a table. The method will execute split action for each region in table. + Asynchronous operation. * @param tableName table to split * @throws IOException if a remote or network exception occurs */ void split(TableName tableName) throws IOException; /** * Split an individual region. Asynchronous operation. * * @param regionName region to split * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #splitRegionAsync(byte[], byte[])}. */ @Deprecated void splitRegion(byte[] regionName) throws IOException; /** * Split a table. Asynchronous operation. * * @param tableName table to split * @param splitPoint the explicit position to split on * @throws IOException if a remote or network exception occurs */ void split(TableName tableName, byte[] splitPoint) throws IOException; /** * Split an individual region. Asynchronous operation. * * @param regionName region to split * @param splitPoint the explicit position to split on * @throws IOException if a remote or network exception occurs * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #splitRegionAsync(byte[], byte[])}. */ @Deprecated void splitRegion(byte[] regionName, byte[] splitPoint) throws IOException; /** * Split an individual region. Asynchronous operation. * @param regionName region to split * @param splitPoint the explicit position to split on * @throws IOException if a remote or network exception occurs */ Future splitRegionAsync(byte[] regionName, byte[] splitPoint) throws IOException; /** * Modify an existing table, more IRB friendly version. * * @param tableName name of table. * @param td modified description of the table * @throws IOException if a remote or network exception occurs * @deprecated since 2.0 version and will be removed in 3.0 version. * use {@link #modifyTable(TableDescriptor)} */ @Deprecated void modifyTable(TableName tableName, TableDescriptor td) throws IOException; /** * Modify an existing table, more IRB friendly version. * @param td modified description of the table * @throws IOException if a remote or network exception occurs */ void modifyTable(TableDescriptor td) throws IOException; /** * Modify an existing table, more IRB friendly version. Asynchronous operation. This means that * it may be a while before your schema change is updated across all of the table. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of table. * @param td modified description of the table * @throws IOException if a remote or network exception occurs * @return the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the * operation to complete * @deprecated since 2.0 version and will be removed in 3.0 version. * use {@link #modifyTableAsync(TableDescriptor)} */ @Deprecated Future modifyTableAsync(TableName tableName, TableDescriptor td) throws IOException; /** * Modify an existing table, more IRB (ruby) friendly version. Asynchronous operation. This means that * it may be a while before your schema change is updated across all of the table. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param td description of the table * @throws IOException if a remote or network exception occurs * @return the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the * operation to complete */ Future modifyTableAsync(TableDescriptor td) throws IOException; /** *

* Shuts down the HBase cluster. *

*

* Notice that, a success shutdown call may ends with an error since the remote server has already * been shutdown. *

* @throws IOException if a remote or network exception occurs */ void shutdown() throws IOException; /** *

* Shuts down the current HBase master only. Does not shutdown the cluster. *

*

* Notice that, a success stopMaster call may ends with an error since the remote server has * already been shutdown. *

* @throws IOException if a remote or network exception occurs * @see #shutdown() */ void stopMaster() throws IOException; /** * Check whether Master is in maintenance mode. * * @throws IOException if a remote or network exception occurs */ boolean isMasterInMaintenanceMode() throws IOException; /** * Stop the designated regionserver. * * @param hostnamePort Hostname and port delimited by a : as in * example.org:1234 * @throws IOException if a remote or network exception occurs */ void stopRegionServer(String hostnamePort) throws IOException; /** * Get whole cluster status, containing status about: *
   * hbase version
   * cluster id
   * primary/backup master(s)
   * master's coprocessors
   * live/dead regionservers
   * balancer
   * regions in transition
   * 
* @return cluster status * @throws IOException if a remote or network exception occurs * @deprecated since 2.0 version and will be removed in 3.0 version. * use {@link #getClusterMetrics()} */ @Deprecated default ClusterStatus getClusterStatus() throws IOException { return new ClusterStatus(getClusterMetrics()); } /** * Get whole cluster metrics, containing status about: *
   * hbase version
   * cluster id
   * primary/backup master(s)
   * master's coprocessors
   * live/dead regionservers
   * balancer
   * regions in transition
   * 
* @return cluster metrics * @throws IOException if a remote or network exception occurs */ default ClusterMetrics getClusterMetrics() throws IOException { return getClusterMetrics(EnumSet.allOf(ClusterMetrics.Option.class)); } /** * Get cluster status with a set of {@link Option} to get desired status. * @return cluster status * @throws IOException if a remote or network exception occurs */ ClusterMetrics getClusterMetrics(EnumSet

* You can use Future.get(long, TimeUnit) to wait on the operation to complete. It may throw * ExecutionException if there was an error while executing the operation or TimeoutException in * case the wait timeout was not long enough to allow the operation to complete. * @param peerId a short name that identifies the peer * @param peerConfig new config for the replication peer * @return the result of the async operation * @throws IOException IOException if a remote or network exception occurs */ Future updateReplicationPeerConfigAsync(String peerId, ReplicationPeerConfig peerConfig) throws IOException; /** * Append the replicable table column family config from the specified peer. * @param id a short that identifies the cluster * @param tableCfs A map from tableName to column family names * @throws ReplicationException if tableCfs has conflict with existing config * @throws IOException if a remote or network exception occurs */ void appendReplicationPeerTableCFs(String id, Map> tableCfs) throws ReplicationException, IOException; /** * Remove some table-cfs from config of the specified peer. * @param id a short name that identifies the cluster * @param tableCfs A map from tableName to column family names * @throws ReplicationException if tableCfs has conflict with existing config * @throws IOException if a remote or network exception occurs */ void removeReplicationPeerTableCFs(String id, Map> tableCfs) throws ReplicationException, IOException; /** * Return a list of replication peers. * @return a list of replication peers description * @throws IOException if a remote or network exception occurs */ List listReplicationPeers() throws IOException; /** * Return a list of replication peers. * @param pattern The compiled regular expression to match peer id * @return a list of replication peers description * @throws IOException if a remote or network exception occurs */ List listReplicationPeers(Pattern pattern) throws IOException; /** * Mark region server(s) as decommissioned to prevent additional regions from getting * assigned to them. Optionally unload the regions on the servers. If there are multiple servers * to be decommissioned, decommissioning them at the same time can prevent wasteful region * movements. Region unloading is asynchronous. * @param servers The list of servers to decommission. * @param offload True to offload the regions from the decommissioned servers */ void decommissionRegionServers(List servers, boolean offload) throws IOException; /** * List region servers marked as decommissioned, which can not be assigned regions. * @return List of decommissioned region servers. */ List listDecommissionedRegionServers() throws IOException; /** * Remove decommission marker from a region server to allow regions assignments. * Load regions onto the server if a list of regions is given. Region loading is * asynchronous. * @param server The server to recommission. * @param encodedRegionNames Regions to load onto the server. */ void recommissionRegionServer(ServerName server, List encodedRegionNames) throws IOException; /** * Find all table and column families that are replicated from this cluster * @return the replicated table-cfs list of this cluster. */ List listReplicatedTableCFs() throws IOException; /** * Enable a table's replication switch. * @param tableName name of the table * @throws IOException if a remote or network exception occurs */ void enableTableReplication(TableName tableName) throws IOException; /** * Disable a table's replication switch. * @param tableName name of the table * @throws IOException if a remote or network exception occurs */ void disableTableReplication(TableName tableName) throws IOException; /** * Clear compacting queues on a regionserver. * @param serverName the region server name * @param queues the set of queue name * @throws IOException if a remote or network exception occurs * @throws InterruptedException */ void clearCompactionQueues(ServerName serverName, Set queues) throws IOException, InterruptedException; /** * List dead region servers. * @return List of dead region servers. */ default List listDeadServers() throws IOException { return getClusterMetrics(EnumSet.of(Option.DEAD_SERVERS)).getDeadServerNames(); } /** * Clear dead region servers from master. * @param servers list of dead region servers. * @throws IOException if a remote or network exception occurs * @return List of servers that are not cleared */ List clearDeadServers(final List servers) throws IOException; /** * Create a new table by cloning the existent table schema. * * @param tableName name of the table to be cloned * @param newTableName name of the new table where the table will be created * @param preserveSplits True if the splits should be preserved * @throws IOException if a remote or network exception occurs */ void cloneTableSchema(final TableName tableName, final TableName newTableName, final boolean preserveSplits) throws IOException; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy