Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2C172200C6B for ; Mon, 17 Apr 2017 16:59:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2ACC8160BB9; Mon, 17 Apr 2017 14:59:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B0FF6160BAB for ; Mon, 17 Apr 2017 16:59:31 +0200 (CEST) Received: (qmail 84321 invoked by uid 500); 17 Apr 2017 14:59:24 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 83150 invoked by uid 99); 17 Apr 2017 14:59:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2017 14:59:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 26B51EE68D; Mon, 17 Apr 2017 14:59:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: git-site-role@apache.org To: commits@hbase.apache.org Date: Mon, 17 Apr 2017 14:59:37 -0000 Message-Id: <2804cc0e74d4410891cf331c4f31ef0d@git.apache.org> In-Reply-To: <323c04e270764c50b7cb7c084715d056@git.apache.org> References: <323c04e270764c50b7cb7c084715d056@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [16/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd. archived-at: Mon, 17 Apr 2017 14:59:34 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e4348f53/devapidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html b/devapidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html index 4c688fb..e763538 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html @@ -25,455 +25,471 @@ 017 */ 018package org.apache.hadoop.hbase.client; 019 -020import java.util.concurrent.CompletableFuture; -021import java.util.regex.Pattern; -022 -023import org.apache.hadoop.hbase.HColumnDescriptor; -024import org.apache.hadoop.hbase.HRegionInfo; -025import org.apache.hadoop.hbase.HTableDescriptor; -026import org.apache.hadoop.hbase.ServerName; -027import org.apache.hadoop.hbase.NamespaceDescriptor; -028import org.apache.hadoop.hbase.TableName; -029import org.apache.hadoop.hbase.classification.InterfaceAudience; -030import org.apache.hadoop.hbase.util.Pair; -031 -032/** -033 * The asynchronous administrative API for HBase. -034 */ -035@InterfaceAudience.Public -036public interface AsyncAdmin { -037 -038 /** -039 * @return Async Connection used by this object. -040 */ -041 AsyncConnectionImpl getConnection(); -042 -043 /** -044 * @param tableName Table to check. -045 * @return True if table exists already. The return value will be wrapped by a -046 * {@link CompletableFuture}. -047 */ -048 CompletableFuture<Boolean> tableExists(final TableName tableName); -049 -050 /** -051 * List all the userspace tables. -052 * @return - returns an array of HTableDescriptors wrapped by a {@link CompletableFuture}. -053 * @see #listTables(Pattern, boolean) -054 */ -055 CompletableFuture<HTableDescriptor[]> listTables(); -056 -057 /** -058 * List all the tables matching the given pattern. -059 * @param regex The regular expression to match against -060 * @param includeSysTables False to match only against userspace tables -061 * @return - returns an array of HTableDescriptors wrapped by a {@link CompletableFuture}. -062 * @see #listTables(Pattern, boolean) -063 */ -064 CompletableFuture<HTableDescriptor[]> listTables(String regex, boolean includeSysTables); -065 -066 /** -067 * List all the tables matching the given pattern. -068 * @param pattern The compiled regular expression to match against -069 * @param includeSysTables False to match only against userspace tables -070 * @return - returns an array of HTableDescriptors wrapped by a {@link CompletableFuture}. -071 */ -072 CompletableFuture<HTableDescriptor[]> listTables(Pattern pattern, boolean includeSysTables); -073 -074 /** -075 * List all of the names of userspace tables. -076 * @return TableName[] an array of table names wrapped by a {@link CompletableFuture}. -077 * @see #listTableNames(Pattern, boolean) -078 */ -079 CompletableFuture<TableName[]> listTableNames(); -080 -081 /** -082 * List all of the names of userspace tables. -083 * @param regex The regular expression to match against -084 * @param includeSysTables False to match only against userspace tables -085 * @return TableName[] an array of table names wrapped by a {@link CompletableFuture}. -086 * @see #listTableNames(Pattern, boolean) -087 */ -088 CompletableFuture<TableName[]> listTableNames(final String regex, final boolean includeSysTables); -089 -090 /** -091 * List all of the names of userspace tables. -092 * @param pattern The regular expression to match against -093 * @param includeSysTables False to match only against userspace tables -094 * @return TableName[] an array of table names wrapped by a {@link CompletableFuture}. -095 */ -096 CompletableFuture<TableName[]> listTableNames(final Pattern pattern, -097 final boolean includeSysTables); -098 -099 /** -100 * Method for getting the tableDescriptor -101 * @param tableName as a {@link TableName} -102 * @return the tableDescriptor wrapped by a {@link CompletableFuture}. -103 */ -104 CompletableFuture<HTableDescriptor> getTableDescriptor(final TableName tableName); -105 -106 /** -107 * Creates a new table. -108 * @param desc table descriptor for table -109 */ -110 CompletableFuture<Void> createTable(HTableDescriptor desc); -111 -112 /** -113 * Creates a new table with the specified number of regions. The start key specified will become -114 * the end key of the first region of the table, and the end key specified will become the start -115 * key of the last region of the table (the first region has a null start key and the last region -116 * has a null end key). BigInteger math will be used to divide the key range specified into enough -117 * segments to make the required number of total regions. -118 * @param desc table descriptor for table -119 * @param startKey beginning of key range -120 * @param endKey end of key range -121 * @param numRegions the total number of regions to create -122 */ -123 CompletableFuture<Void> createTable(HTableDescriptor desc, byte[] startKey, byte[] endKey, -124 int numRegions); -125 -126 /** -127 * Creates a new table with an initial set of empty regions defined by the specified split keys. -128 * The total number of regions created will be the number of split keys plus one. -129 * Note : Avoid passing empty split key. -130 * @param desc table descriptor for table -131 * @param splitKeys array of split keys for the initial regions of the table -132 */ -133 CompletableFuture<Void> createTable(final HTableDescriptor desc, byte[][] splitKeys); -134 -135 /** -136 * Deletes a table. -137 * @param tableName name of table to delete -138 */ -139 CompletableFuture<Void> deleteTable(final TableName tableName); -140 -141 /** -142 * Deletes tables matching the passed in pattern and wait on completion. Warning: Use this method -143 * carefully, there is no prompting and the effect is immediate. Consider using -144 * {@link #listTables(String, boolean)} and -145 * {@link #deleteTable(org.apache.hadoop.hbase.TableName)} -146 * @param regex The regular expression to match table names against -147 * @return Table descriptors for tables that couldn't be deleted. The return value will be wrapped -148 * by a {@link CompletableFuture}. -149 */ -150 CompletableFuture<HTableDescriptor[]> deleteTables(String regex); -151 -152 /** -153 * Delete tables matching the passed in pattern and wait on completion. Warning: Use this method -154 * carefully, there is no prompting and the effect is immediate. Consider using -155 * {@link #listTables(Pattern, boolean) } and -156 * {@link #deleteTable(org.apache.hadoop.hbase.TableName)} -157 * @param pattern The pattern to match table names against -158 * @return Table descriptors for tables that couldn't be deleted. The return value will be wrapped -159 * by a {@link CompletableFuture}. -160 */ -161 CompletableFuture<HTableDescriptor[]> deleteTables(Pattern pattern); -162 -163 /** -164 * Truncate a table. -165 * @param tableName name of table to truncate -166 * @param preserveSplits True if the splits should be preserved -167 */ -168 CompletableFuture<Void> truncateTable(final TableName tableName, final boolean preserveSplits); -169 -170 /** -171 * Enable a table. The table has to be in disabled state for it to be enabled. -172 * @param tableName name of the table -173 */ -174 CompletableFuture<Void> enableTable(final TableName tableName); -175 -176 /** -177 * Enable tables matching the passed in pattern. Warning: Use this method carefully, there is no -178 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and -179 * {@link #enableTable(TableName)} -180 * @param regex The regular expression to match table names against -181 * @return Table descriptors for tables that couldn't be enabled. The return value will be wrapped -182 * by a {@link CompletableFuture}. -183 */ -184 CompletableFuture<HTableDescriptor[]> enableTables(String regex); -185 -186 /** -187 * Enable tables matching the passed in pattern. Warning: Use this method carefully, there is no -188 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and -189 * {@link #enableTable(TableName)} -190 * @param pattern The pattern to match table names against -191 * @return Table descriptors for tables that couldn't be enabled. The return value will be wrapped -192 * by a {@link CompletableFuture}. -193 */ -194 CompletableFuture<HTableDescriptor[]> enableTables(Pattern pattern); -195 -196 /** -197 * Disable a table. The table has to be in enabled state for it to be disabled. -198 * @param tableName -199 */ -200 CompletableFuture<Void> disableTable(final TableName tableName); -201 -202 /** -203 * Disable tables matching the passed in pattern. Warning: Use this method carefully, there is no -204 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and -205 * {@link #disableTable(TableName)} -206 * @param regex The regular expression to match table names against -207 * @return Table descriptors for tables that couldn't be disabled. The return value will be wrapped by a -208 * {@link CompletableFuture}. -209 */ -210 CompletableFuture<HTableDescriptor[]> disableTables(String regex); -211 -212 /** -213 * Disable tables matching the passed in pattern. Warning: Use this method carefully, there is no -214 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and -215 * {@link #disableTable(TableName)} -216 * @param pattern The pattern to match table names against -217 * @return Table descriptors for tables that couldn't be disabled. The return value will be wrapped by a -218 * {@link CompletableFuture}. -219 */ -220 CompletableFuture<HTableDescriptor[]> disableTables(Pattern pattern); -221 -222 /** -223 * @param tableName name of table to check -224 * @return true if table is off-line. The return value will be wrapped by a -225 * {@link CompletableFuture}. -226 */ -227 CompletableFuture<Boolean> isTableDisabled(TableName tableName); -228 -229 /** -230 * @param tableName name of table to check -231 * @return true if all regions of the table are available. The return value will be wrapped by a -232 * {@link CompletableFuture}. -233 */ -234 CompletableFuture<Boolean> isTableAvailable(TableName tableName); -235 -236 /** -237 * Use this api to check if the table has been created with the specified number of splitkeys -238 * which was used while creating the given table. Note : If this api is used after a table's -239 * region gets splitted, the api may return false. The return value will be wrapped by a -240 * {@link CompletableFuture}. -241 * @param tableName name of table to check -242 * @param splitKeys keys to check if the table has been created with all split keys -243 */ -244 CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys); -245 -246 /** -247 * Get the status of alter command - indicates how many regions have received the updated schema -248 * Asynchronous operation. -249 * @param tableName TableName instance -250 * @return Pair indicating the number of regions updated Pair.getFirst() is the regions that are -251 * yet to be updated Pair.getSecond() is the total number of regions of the table. The -252 * return value will be wrapped by a {@link CompletableFuture}. -253 */ -254 CompletableFuture<Pair<Integer, Integer>> getAlterStatus(final TableName tableName); -255 -256 /** -257 * Add a column family to an existing table. -258 * @param tableName name of the table to add column family to -259 * @param columnFamily column family descriptor of column family to be added -260 */ -261 CompletableFuture<Void> addColumnFamily(final TableName tableName, -262 final HColumnDescriptor columnFamily); -263 -264 /** -265 * Delete a column family from a table. -266 * @param tableName name of table -267 * @param columnFamily name of column family to be deleted -268 */ -269 CompletableFuture<Void> deleteColumnFamily(final TableName tableName, final byte[] columnFamily); -270 -271 /** -272 * Modify an existing column family on a table. -273 * @param tableName name of table -274 * @param columnFamily new column family descriptor to use -275 */ -276 CompletableFuture<Void> modifyColumnFamily(final TableName tableName, -277 final HColumnDescriptor columnFamily); -278 -279 /** -280 * Create a new namespace. -281 * @param descriptor descriptor which describes the new namespace -282 */ -283 CompletableFuture<Void> createNamespace(final NamespaceDescriptor descriptor); -284 -285 /** -286 * Modify an existing namespace. -287 * @param descriptor descriptor which describes the new namespace -288 */ -289 CompletableFuture<Void> modifyNamespace(final NamespaceDescriptor descriptor); -290 -291 /** -292 * Delete an existing namespace. Only empty namespaces (no tables) can be removed. -293 * @param name namespace name -294 */ -295 CompletableFuture<Void> deleteNamespace(final String name); -296 -297 /** -298 * Get a namespace descriptor by name -299 * @param name name of namespace descriptor -300 * @return A descriptor wrapped by a {@link CompletableFuture}. -301 */ -302 CompletableFuture<NamespaceDescriptor> getNamespaceDescriptor(final String name); -303 -304 /** -305 * List available namespace descriptors -306 * @return List of descriptors wrapped by a {@link CompletableFuture}. -307 */ -308 CompletableFuture<NamespaceDescriptor[]> listNamespaceDescriptors(); -309 -310 /** -311 * @param tableName name of table to check -312 * @return true if table is on-line. The return value will be wrapped by a -313 * {@link CompletableFuture}. -314 */ -315 CompletableFuture<Boolean> isTableEnabled(TableName tableName); -316 -317 /** -318 * Turn the load balancer on or off. -319 * @param on -320 * @return Previous balancer value wrapped by a {@link CompletableFuture}. -321 */ -322 CompletableFuture<Boolean> setBalancerRunning(final boolean on); -323 -324 /** -325 * Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the -326 * reassignments. Can NOT run for various reasons. Check logs. -327 * @return True if balancer ran, false otherwise. The return value will be wrapped by a -328 * {@link CompletableFuture}. -329 */ -330 CompletableFuture<Boolean> balancer(); -331 -332 /** -333 * Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the -334 * reassignments. If there is region in transition, force parameter of true would still run -335 * balancer. Can *not* run for other reasons. Check logs. -336 * @param force whether we should force balance even if there is region in transition. -337 * @return True if balancer ran, false otherwise. The return value will be wrapped by a -338 * {@link CompletableFuture}. -339 */ -340 CompletableFuture<Boolean> balancer(boolean force); -341 -342 /** -343 * Query the current state of the balancer. -344 * @return true if the balancer is enabled, false otherwise. -345 * The return value will be wrapped by a {@link CompletableFuture}. -346 */ -347 CompletableFuture<Boolean> isBalancerEnabled(); -348 -349 /** -350 * Close a region. For expert-admins. Runs close on the regionserver. The master will not be -351 * informed of the close. -352 * -353 * @param regionname region name to close -354 * @param serverName If supplied, we'll use this location rather than the one currently in -355 * <code>hbase:meta</code> -356 */ -357 CompletableFuture<Void> closeRegion(String regionname, String serverName); -358 -359 /** -360 * Close a region. For expert-admins Runs close on the regionserver. The master will not be -361 * informed of the close. -362 * -363 * @param regionname region name to close -364 * @param serverName The servername of the regionserver. If passed null we will use servername -365 * found in the hbase:meta table. A server name is made of host, port and startcode. Here is an -366 * example: <code> host187.example.com,60020,1289493121758</code> -367 */ -368 CompletableFuture<Void> closeRegion(byte[] regionname, String serverName); -369 -370 /** -371 * For expert-admins. Runs close on the regionserver. Closes a region based on the encoded region -372 * name. The region server name is mandatory. If the servername is provided then based on the -373 * online regions in the specified regionserver the specified region will be closed. The master -374 * will not be informed of the close. Note that the regionname is the encoded regionname. -375 * -376 * @param encodedRegionName The encoded region name; i.e. the hash that makes up the region name -377 * suffix: e.g. if regionname is -378 * <code>TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.</code>, -379 * then the encoded region name is: <code>527db22f95c8a9e0116f0cc13c680396</code>. -380 * @param serverName The servername of the regionserver. A server name is made of host, port and -381 * startcode. This is mandatory. Here is an example: -382 * <code> host187.example.com,60020,1289493121758</code> -383 * @return true if the region was closed, false if not. The return value will be wrapped by a -384 * {@link CompletableFuture}. -385 */ -386 CompletableFuture<Boolean> closeRegionWithEncodedRegionName(String encodedRegionName, String serverName); -387 -388 /** -389 * Close a region. For expert-admins Runs close on the regionserver. The master will not be -390 * informed of the close. -391 * -392 * @param sn -393 * @param hri -394 */ -395 CompletableFuture<Void> closeRegion(ServerName sn, HRegionInfo hri); -396 -397 /** -398 * Merge two regions. -399 * @param nameOfRegionA encoded or full name of region a -400 * @param nameOfRegionB encoded or full name of region b -401 * @param forcible true if do a compulsory merge, otherwise we will only merge two adjacent -402 * regions -403 */ -404 CompletableFuture<Void> mergeRegions(final byte[] nameOfRegionA, final byte[] nameOfRegionB, -405 final boolean forcible); -406 -407 /** -408 * Split a table. The method will execute split action for each region in table. -409 * @param tableName table to split -410 */ -411 CompletableFuture<Void> split(final TableName tableName); -412 -413 /** -414 * Split an individual region. -415 * @param regionName region to split -416 */ -417 CompletableFuture<Void> splitRegion(final byte[] regionName); -418 -419 /** -420 * Split a table. -421 * @param tableName table to split -422 * @param splitPoint the explicit position to split on -423 */ -424 CompletableFuture<Void> split(final TableName tableName, final byte[] splitPoint); -425 -426 /** -427 * Split an individual region. -428 * @param regionName region to split -429 * @param splitPoint the explicit position to split on -430 */ -431 CompletableFuture<Void> splitRegion(final byte[] regionName, final byte[] splitPoint); -432 -433 /** -434 * @param regionName Encoded or full name of region to assign. -435 */ -436 CompletableFuture<Void> assign(final byte[] regionName); -437 -438 /** -439 * Unassign a region from current hosting regionserver. Region will then be assigned to a -440 * regionserver chosen at random. Region could be reassigned back to the same server. Use -441 * {@link #move(byte[], byte[])} if you want to control the region movement. -442 * @param regionName Encoded or full name of region to unassign. Will clear any existing -443 * RegionPlan if one found. -444 * @param force If true, force unassign (Will remove region from regions-in-transition too if -445 * present. If results in double assignment use hbck -fix to resolve. To be used by -446 * experts). -447 */ -448 CompletableFuture<Void> unassign(final byte[] regionName, final boolean force); -449 -450 /** -451 * Offline specified region from master's in-memory state. It will not attempt to reassign the -452 * region as in unassign. This API can be used when a region not served by any region server and -453 * still online as per Master's in memory state. If this API is incorrectly used on active region -454 * then master will loose track of that region. This is a special method that should be used by -455 * experts or hbck. -456 * @param regionName Encoded or full name of region to offline -457 */ -458 CompletableFuture<Void> offline(final byte[] regionName); -459 -460 /** -461 * Move the region <code>r</code> to <code>dest</code>. -462 * @param regionName Encoded or full name of region to move. -463 * @param destServerName The servername of the destination regionserver. If passed the empty byte -464 * array we'll assign to a random server. A server name is made of host, port and -465 * startcode. Here is an example: <code> host187.example.com,60020,1289493121758</code> -466 */ -467 CompletableFuture<Void> move(final byte[] regionName, final byte[] destServerName); -468} +020import java.util.List; +021import java.util.concurrent.CompletableFuture; +022import java.util.regex.Pattern; +023 +024import org.apache.hadoop.hbase.HColumnDescriptor; +025import org.apache.hadoop.hbase.HRegionInfo; +026import org.apache.hadoop.hbase.HTableDescriptor; +027import org.apache.hadoop.hbase.ServerName; +028import org.apache.hadoop.hbase.NamespaceDescriptor; +029import org.apache.hadoop.hbase.TableName; +030import org.apache.hadoop.hbase.classification.InterfaceAudience; +031import org.apache.hadoop.hbase.quotas.QuotaFilter; +032import org.apache.hadoop.hbase.quotas.QuotaSettings; +033import org.apache.hadoop.hbase.util.Pair; +034 +035/** +036 * The asynchronous administrative API for HBase. +037 */ +038@InterfaceAudience.Public +039public interface AsyncAdmin { +040 +041 /** +042 * @return Async Connection used by this object. +043 */ +044 AsyncConnectionImpl getConnection(); +045 +046 /** +047 * @param tableName Table to check. +048 * @return True if table exists already. The return value will be wrapped by a +049 * {@link CompletableFuture}. +050 */ +051 CompletableFuture<Boolean> tableExists(final TableName tableName); +052 +053 /** +054 * List all the userspace tables. +055 * @return - returns an array of HTableDescriptors wrapped by a {@link CompletableFuture}. +056 * @see #listTables(Pattern, boolean) +057 */ +058 CompletableFuture<HTableDescriptor[]> listTables(); +059 +060 /** +061 * List all the tables matching the given pattern. +062 * @param regex The regular expression to match against +063 * @param includeSysTables False to match only against userspace tables +064 * @return - returns an array of HTableDescriptors wrapped by a {@link CompletableFuture}. +065 * @see #listTables(Pattern, boolean) +066 */ +067 CompletableFuture<HTableDescriptor[]> listTables(String regex, boolean includeSysTables); +068 +069 /** +070 * List all the tables matching the given pattern. +071 * @param pattern The compiled regular expression to match against +072 * @param includeSysTables False to match only against userspace tables +073 * @return - returns an array of HTableDescriptors wrapped by a {@link CompletableFuture}. +074 */ +075 CompletableFuture<HTableDescriptor[]> listTables(Pattern pattern, boolean includeSysTables); +076 +077 /** +078 * List all of the names of userspace tables. +079 * @return TableName[] an array of table names wrapped by a {@link CompletableFuture}. +080 * @see #listTableNames(Pattern, boolean) +081 */ +082 CompletableFuture<TableName[]> listTableNames(); +083 +084 /** +085 * List all of the names of userspace tables. +086 * @param regex The regular expression to match against +087 * @param includeSysTables False to match only against userspace tables +088 * @return TableName[] an array of table names wrapped by a {@link CompletableFuture}. +089 * @see #listTableNames(Pattern, boolean) +090 */ +091 CompletableFuture<TableName[]> listTableNames(final String regex, final boolean includeSysTables); +092 +093 /** +094 * List all of the names of userspace tables. +095 * @param pattern The regular expression to match against +096 * @param includeSysTables False to match only against userspace tables +097 * @return TableName[] an array of table names wrapped by a {@link CompletableFuture}. +098 */ +099 CompletableFuture<TableName[]> listTableNames(final Pattern pattern, +100 final boolean includeSysTables); +101 +102 /** +103 * Method for getting the tableDescriptor +104 * @param tableName as a {@link TableName} +105 * @return the tableDescriptor wrapped by a {@link CompletableFuture}. +106 */ +107 CompletableFuture<HTableDescriptor> getTableDescriptor(final TableName tableName); +108 +109 /** +110 * Creates a new table. +111 * @param desc table descriptor for table +112 */ +113 CompletableFuture<Void> createTable(HTableDescriptor desc); +114 +115 /** +116 * Creates a new table with the specified number of regions. The start key specified will become +117 * the end key of the first region of the table, and the end key specified will become the start +118 * key of the last region of the table (the first region has a null start key and the last region +119 * has a null end key). BigInteger math will be used to divide the key range specified into enough +120 * segments to make the required number of total regions. +121 * @param desc table descriptor for table +122 * @param startKey beginning of key range +123 * @param endKey end of key range +124 * @param numRegions the total number of regions to create +125 */ +126 CompletableFuture<Void> createTable(HTableDescriptor desc, byte[] startKey, byte[] endKey, +127 int numRegions); +128 +129 /** +130 * Creates a new table with an initial set of empty regions defined by the specified split keys. +131 * The total number of regions created will be the number of split keys plus one. +132 * Note : Avoid passing empty split key. +133 * @param desc table descriptor for table +134 * @param splitKeys array of split keys for the initial regions of the table +135 */ +136 CompletableFuture<Void> createTable(final HTableDescriptor desc, byte[][] splitKeys); +137 +138 /** +139 * Deletes a table. +140 * @param tableName name of table to delete +141 */ +142 CompletableFuture<Void> deleteTable(final TableName tableName); +143 +144 /** +145 * Deletes tables matching the passed in pattern and wait on completion. Warning: Use this method +146 * carefully, there is no prompting and the effect is immediate. Consider using +147 * {@link #listTables(String, boolean)} and +148 * {@link #deleteTable(org.apache.hadoop.hbase.TableName)} +149 * @param regex The regular expression to match table names against +150 * @return Table descriptors for tables that couldn't be deleted. The return value will be wrapped +151 * by a {@link CompletableFuture}. +152 */ +153 CompletableFuture<HTableDescriptor[]> deleteTables(String regex); +154 +155 /** +156 * Delete tables matching the passed in pattern and wait on completion. Warning: Use this method +157 * carefully, there is no prompting and the effect is immediate. Consider using +158 * {@link #listTables(Pattern, boolean) } and +159 * {@link #deleteTable(org.apache.hadoop.hbase.TableName)} +160 * @param pattern The pattern to match table names against +161 * @return Table descriptors for tables that couldn't be deleted. The return value will be wrapped +162 * by a {@link CompletableFuture}. +163 */ +164 CompletableFuture<HTableDescriptor[]> deleteTables(Pattern pattern); +165 +166 /** +167 * Truncate a table. +168 * @param tableName name of table to truncate +169 * @param preserveSplits True if the splits should be preserved +170 */ +171 CompletableFuture<Void> truncateTable(final TableName tableName, final boolean preserveSplits); +172 +173 /** +174 * Enable a table. The table has to be in disabled state for it to be enabled. +175 * @param tableName name of the table +176 */ +177 CompletableFuture<Void> enableTable(final TableName tableName); +178 +179 /** +180 * Enable tables matching the passed in pattern. Warning: Use this method carefully, there is no +181 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and +182 * {@link #enableTable(TableName)} +183 * @param regex The regular expression to match table names against +184 * @return Table descriptors for tables that couldn't be enabled. The return value will be wrapped +185 * by a {@link CompletableFuture}. +186 */ +187 CompletableFuture<HTableDescriptor[]> enableTables(String regex); +188 +189 /** +190 * Enable tables matching the passed in pattern. Warning: Use this method carefully, there is no +191 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and +192 * {@link #enableTable(TableName)} +193 * @param pattern The pattern to match table names against +194 * @return Table descriptors for tables that couldn't be enabled. The return value will be wrapped +195 * by a {@link CompletableFuture}. +196 */ +197 CompletableFuture<HTableDescriptor[]> enableTables(Pattern pattern); +198 +199 /** +200 * Disable a table. The table has to be in enabled state for it to be disabled. +201 * @param tableName +202 */ +203 CompletableFuture<Void> disableTable(final TableName tableName); +204 +205 /** +206 * Disable tables matching the passed in pattern. Warning: Use this method carefully, there is no +207 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and +208 * {@link #disableTable(TableName)} +209 * @param regex The regular expression to match table names against +210 * @return Table descriptors for tables that couldn't be disabled. The return value will be wrapped by a +211 * {@link CompletableFuture}. +212 */ +213 CompletableFuture<HTableDescriptor[]> disableTables(String regex); +214 +215 /** +216 * Disable tables matching the passed in pattern. Warning: Use this method carefully, there is no +217 * prompting and the effect is immediate. Consider using {@link #listTables(Pattern, boolean)} and +218 * {@link #disableTable(TableName)} +219 * @param pattern The pattern to match table names against +220 * @return Table descriptors for tables that couldn't be disabled. The return value will be wrapped by a +221 * {@link CompletableFuture}. +222 */ +223 CompletableFuture<HTableDescriptor[]> disableTables(Pattern pattern); +224 +225 /** +226 * @param tableName name of table to check +227 * @return true if table is off-line. The return value will be wrapped by a +228 * {@link CompletableFuture}. +229 */ +230 CompletableFuture<Boolean> isTableDisabled(TableName tableName); +231 +232 /** +233 * @param tableName name of table to check +234 * @return true if all regions of the table are available. The return value will be wrapped by a +235 * {@link CompletableFuture}. +236 */ +237 CompletableFuture<Boolean> isTableAvailable(TableName tableName); +238 +239 /** +240 * Use this api to check if the table has been created with the specified number of splitkeys +241 * which was used while creating the given table. Note : If this api is used after a table's +242 * region gets splitted, the api may return false. The return value will be wrapped by a +243 * {@link CompletableFuture}. +244 * @param tableName name of table to check +245 * @param splitKeys keys to check if the table has been created with all split keys +246 */ +247 CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys); +248 +249 /** +250 * Get the status of alter command - indicates how many regions have received the updated schema +251 * Asynchronous operation. +252 * @param tableName TableName instance +253 * @return Pair indicating the number of regions updated Pair.getFirst() is the regions that are +254 * yet to be updated Pair.getSecond() is the total number of regions of the table. The +255 * return value will be wrapped by a {@link CompletableFuture}. +256 */ +257 CompletableFuture<Pair<Integer, Integer>> getAlterStatus(final TableName tableName); +258 +259 /** +260 * Add a column family to an existing table. +261 * @param tableName name of the table to add column family to +262 * @param columnFamily column family descriptor of column family to be added +263 */ +264 CompletableFuture<Void> addColumnFamily(final TableName tableName, +265 final HColumnDescriptor columnFamily); +266 +267 /** +268 * Delete a column family from a table. +269 * @param tableName name of table +270 * @param columnFamily name of column family to be deleted +271 */ +272 CompletableFuture<Void> deleteColumnFamily(final TableName tableName, final byte[] columnFamily); +273 +274 /** +275 * Modify an existing column family on a table. +276 * @param tableName name of table +277 * @param columnFamily new column family descriptor to use +278 */ +279 CompletableFuture<Void> modifyColumnFamily(final TableName tableName, +280 final HColumnDescriptor columnFamily); +281 +282 /** +283 * Create a new namespace. +284 * @param descriptor descriptor which describes the new namespace +285 */ +286 CompletableFuture<Void> createNamespace(final NamespaceDescriptor descriptor); +287 +288 /** +289 * Modify an existing namespace. +290 * @param descriptor descriptor which describes the new namespace +291 */ +292 CompletableFuture<Void> modifyNamespace(final NamespaceDescriptor descriptor); +293 +294 /** +295 * Delete an existing namespace. Only empty namespaces (no tables) can be removed. +296 * @param name namespace name +297 */ +298 CompletableFuture<Void> deleteNamespace(final String name); +299 +300 /** +301 * Get a namespace descriptor by name +302 * @param name name of namespace descriptor +303 * @return A descriptor wrapped by a {@link CompletableFuture}. +304 */ +305 CompletableFuture<NamespaceDescriptor> getNamespaceDescriptor(final String name); +306 +307 /** +308 * List available namespace descriptors +309 * @return List of descriptors wrapped by a {@link CompletableFuture}. +310 */ +311 CompletableFuture<NamespaceDescriptor[]> listNamespaceDescriptors(); +312 +313 /** +314 * @param tableName name of table to check +315 * @return true if table is on-line. The return value will be wrapped by a +316 * {@link CompletableFuture}. +317 */ +318 CompletableFuture<Boolean> isTableEnabled(TableName tableName); +319 +320 /** +321 * Turn the load balancer on or off. +322 * @param on +323 * @return Previous balancer value wrapped by a {@link CompletableFuture}. +324 */ +325 CompletableFuture<Boolean> setBalancerRunning(final boolean on); +326 +327 /** +328 * Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the +329 * reassignments. Can NOT run for various reasons. Check logs. +330 * @return True if balancer ran, false otherwise. The return value will be wrapped by a +331 * {@link CompletableFuture}. +332 */ +333 CompletableFuture<Boolean> balancer(); +334 +335 /** +336 * Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the +337 * reassignments. If there is region in transition, force parameter of true would still run +338 * balancer. Can *not* run for other reasons. Check logs. +339 * @param force whether we should force balance even if there is region in transition. +340 * @return True if balancer ran, false otherwise. The return value will be wrapped by a +341 * {@link CompletableFuture}. +342 */ +343 CompletableFuture<Boolean> balancer(boolean force); +344 +345 /** +346 * Query the current state of the balancer. +347 * @return true if the balancer is enabled, false otherwise. +348 * The return value will be wrapped by a {@link CompletableFuture}. +349 */ +350 CompletableFuture<Boolean> isBalancerEnabled(); +351 +352 /** +353 * Close a region. For expert-admins. Runs close on the regionserver. The master will not be +354 * informed of the close. +355 * +356 * @param regionname region name to close +357 * @param serverName If supplied, we'll use this location rather than the one currently in +358 * <code>hbase:meta</code> +359 */ +360 CompletableFuture<Void> closeRegion(String regionname, String serverName); +361 +362 /** +363 * Close a region. For expert-admins Runs close on the regionserver. The master will not be +364 * informed of the close. +365 * +366 * @param regionname region name to close +367 * @param serverName The servername of the regionserver. If passed null we will use servername +368 * found in the hbase:meta table. A server name is made of host, port and startcode. Here is an +369 * example: <code> host187.example.com,60020,1289493121758</code> +370 */ +371 CompletableFuture<Void> closeRegion(byte[] regionname, String serverName); +372 +373 /** +374 * For expert-admins. Runs close on the regionserver. Closes a region based on the encoded region +375 * name. The region server name is mandatory. If the servername is provided then based on the +376 * online regions in the specified regionserver the specified region will be closed. The master +377 * will not be informed of the close. Note that the regionname is the encoded regionname. +378 * +379 * @param encodedRegionName The encoded region name; i.e. the hash that makes up the region name +380 * suffix: e.g. if regionname is +381 * <code>TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.</code>, +382 * then the encoded region name is: <code>527db22f95c8a9e0116f0cc13c680396</code>. +383 * @param serverName The servername of the regionserver. A server name is made of host, port and +384 * startcode. This is mandatory. Here is an example: +385 * <code> host187.example.com,60020,1289493121758</code> +386 * @return true if the region was closed, false if not. The return value will be wrapped by a +387 * {@link CompletableFuture}. +388 */ +389 CompletableFuture<Boolean> closeRegionWithEncodedRegionName(String encodedRegionName, String serverName); +390 +391 /** +392 * Close a region. For expert-admins Runs close on the regionserver. The master will not be +393 * informed of the close. +394 * +395 * @param sn +396 * @param hri +397 */ +398 CompletableFuture<Void> closeRegion(ServerName sn, HRegionInfo hri); +399 +400 /** +401 * Merge two regions. +402 * @param nameOfRegionA encoded or full name of region a +403 * @param nameOfRegionB encoded or full name of region b +404 * @param forcible true if do a compulsory merge, otherwise we will only merge two adjacent +405 * regions +406 */ +407 CompletableFuture<Void> mergeRegions(final byte[] nameOfRegionA, final byte[] nameOfRegionB, +408 final boolean forcible); +409 +410 /** +411 * Split a table. The method will execute split action for each region in table. +412 * @param tableName table to split +413 */ +414 CompletableFuture<Void> split(final TableName tableName); +415 +416 /** +417 * Split an individual region. +418 * @param regionName region to split +419 */ +420 CompletableFuture<Void> splitRegion(final byte[] regionName); +421<