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 1A2F8200D21 for ; Mon, 16 Oct 2017 17:16:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 18924160BF7; Mon, 16 Oct 2017 15:16:31 +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 DE7A5160BF0 for ; Mon, 16 Oct 2017 17:16:27 +0200 (CEST) Received: (qmail 46992 invoked by uid 500); 16 Oct 2017 15:16:22 -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 46587 invoked by uid 99); 16 Oct 2017 15:16:22 -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, 16 Oct 2017 15:16:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DEE40DFFB5; Mon, 16 Oct 2017 15:16:21 +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, 16 Oct 2017 15:17:05 -0000 Message-Id: <0f43e35fb19d4ec3b8a2873541a8871a@git.apache.org> In-Reply-To: <645193abe9df4d0a95d3df532bee202f@git.apache.org> References: <645193abe9df4d0a95d3df532bee202f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [46/51] [partial] hbase-site git commit: Published site at . archived-at: Mon, 16 Oct 2017 15:16:31 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/47abd8e6/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html index ad90124..319e418 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncAdmin.html @@ -151,992 +151,938 @@ 143 CompletableFuture<Void> deleteTable(TableName tableName); 144 145 /** -146 * Delete tables matching the passed in pattern and wait on completion. Warning: Use this method -147 * carefully, there is no prompting and the effect is immediate. Consider using -148 * {@link #listTableNames(Optional, boolean) } and -149 * {@link #deleteTable(org.apache.hadoop.hbase.TableName)} -150 * @param pattern The pattern to match table names against -151 * @return Table descriptors for tables that couldn't be deleted. The return value will be wrapped -152 * by a {@link CompletableFuture}. The return HTDs are read-only. -153 */ -154 CompletableFuture<List<TableDescriptor>> deleteTables(Pattern pattern); -155 -156 /** -157 * Truncate a table. -158 * @param tableName name of table to truncate -159 * @param preserveSplits True if the splits should be preserved -160 */ -161 CompletableFuture<Void> truncateTable(TableName tableName, boolean preserveSplits); -162 -163 /** -164 * Enable a table. The table has to be in disabled state for it to be enabled. -165 * @param tableName name of the table -166 */ -167 CompletableFuture<Void> enableTable(TableName tableName); -168 -169 /** -170 * Enable tables matching the passed in pattern. Warning: Use this method carefully, there is no -171 * prompting and the effect is immediate. Consider using {@link #listTables(Optional, boolean)} and -172 * {@link #enableTable(TableName)} -173 * @param pattern The pattern to match table names against -174 * @return Table descriptors for tables that couldn't be enabled. The return value will be wrapped -175 * by a {@link CompletableFuture}. The return HTDs are read-only. -176 */ -177 CompletableFuture<List<TableDescriptor>> enableTables(Pattern pattern); -178 -179 /** -180 * Disable a table. The table has to be in enabled state for it to be disabled. -181 * @param tableName +146 * Truncate a table. +147 * @param tableName name of table to truncate +148 * @param preserveSplits True if the splits should be preserved +149 */ +150 CompletableFuture<Void> truncateTable(TableName tableName, boolean preserveSplits); +151 +152 /** +153 * Enable a table. The table has to be in disabled state for it to be enabled. +154 * @param tableName name of the table +155 */ +156 CompletableFuture<Void> enableTable(TableName tableName); +157 +158 /** +159 * Disable a table. The table has to be in enabled state for it to be disabled. +160 * @param tableName +161 */ +162 CompletableFuture<Void> disableTable(TableName tableName); +163 +164 /** +165 * @param tableName name of table to check +166 * @return true if table is on-line. The return value will be wrapped by a +167 * {@link CompletableFuture}. +168 */ +169 CompletableFuture<Boolean> isTableEnabled(TableName tableName); +170 +171 /** +172 * @param tableName name of table to check +173 * @return true if table is off-line. The return value will be wrapped by a +174 * {@link CompletableFuture}. +175 */ +176 CompletableFuture<Boolean> isTableDisabled(TableName tableName); +177 +178 /** +179 * @param tableName name of table to check +180 * @return true if all regions of the table are available. The return value will be wrapped by a +181 * {@link CompletableFuture}. 182 */ -183 CompletableFuture<Void> disableTable(TableName tableName); -184 -185 /** -186 * Disable tables matching the passed in pattern. Warning: Use this method carefully, there is no -187 * prompting and the effect is immediate. Consider using {@link #listTables(Optional, boolean)} and -188 * {@link #disableTable(TableName)} -189 * @param pattern The pattern to match table names against -190 * @return Table descriptors for tables that couldn't be disabled. The return value will be wrapped by a -191 * {@link CompletableFuture}. The return HTDs are read-only. -192 */ -193 CompletableFuture<List<TableDescriptor>> disableTables(Pattern pattern); -194 -195 /** -196 * @param tableName name of table to check -197 * @return true if table is on-line. The return value will be wrapped by a -198 * {@link CompletableFuture}. -199 */ -200 CompletableFuture<Boolean> isTableEnabled(TableName tableName); -201 -202 /** -203 * @param tableName name of table to check -204 * @return true if table is off-line. The return value will be wrapped by a -205 * {@link CompletableFuture}. -206 */ -207 CompletableFuture<Boolean> isTableDisabled(TableName tableName); -208 -209 /** -210 * @param tableName name of table to check -211 * @return true if all regions of the table are available. The return value will be wrapped by a -212 * {@link CompletableFuture}. -213 */ -214 default CompletableFuture<Boolean> isTableAvailable(TableName tableName) { -215 return isTableAvailable(tableName, null); -216 } -217 -218 /** -219 * Use this api to check if the table has been created with the specified number of splitkeys -220 * which was used while creating the given table. Note : If this api is used after a table's -221 * region gets splitted, the api may return false. The return value will be wrapped by a -222 * {@link CompletableFuture}. -223 * @param tableName name of table to check -224 * @param splitKeys keys to check if the table has been created with all split keys -225 */ -226 CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys); -227 -228 /** -229 * Get the status of alter command - indicates how many regions have received the updated schema -230 * Asynchronous operation. -231 * @param tableName TableName instance -232 * @return Pair indicating the number of regions updated Pair.getFirst() is the regions that are -233 * yet to be updated Pair.getSecond() is the total number of regions of the table. The -234 * return value will be wrapped by a {@link CompletableFuture}. +183 default CompletableFuture<Boolean> isTableAvailable(TableName tableName) { +184 return isTableAvailable(tableName, null); +185 } +186 +187 /** +188 * Use this api to check if the table has been created with the specified number of splitkeys +189 * which was used while creating the given table. Note : If this api is used after a table's +190 * region gets splitted, the api may return false. The return value will be wrapped by a +191 * {@link CompletableFuture}. +192 * @param tableName name of table to check +193 * @param splitKeys keys to check if the table has been created with all split keys +194 */ +195 CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys); +196 +197 /** +198 * Add a column family to an existing table. +199 * @param tableName name of the table to add column family to +200 * @param columnFamily column family descriptor of column family to be added +201 */ +202 CompletableFuture<Void> addColumnFamily(TableName tableName, +203 ColumnFamilyDescriptor columnFamily); +204 +205 /** +206 * Delete a column family from a table. +207 * @param tableName name of table +208 * @param columnFamily name of column family to be deleted +209 */ +210 CompletableFuture<Void> deleteColumnFamily(TableName tableName, byte[] columnFamily); +211 +212 /** +213 * Modify an existing column family on a table. +214 * @param tableName name of table +215 * @param columnFamily new column family descriptor to use +216 */ +217 CompletableFuture<Void> modifyColumnFamily(TableName tableName, +218 ColumnFamilyDescriptor columnFamily); +219 +220 /** +221 * Create a new namespace. +222 * @param descriptor descriptor which describes the new namespace +223 */ +224 CompletableFuture<Void> createNamespace(NamespaceDescriptor descriptor); +225 +226 /** +227 * Modify an existing namespace. +228 * @param descriptor descriptor which describes the new namespace +229 */ +230 CompletableFuture<Void> modifyNamespace(NamespaceDescriptor descriptor); +231 +232 /** +233 * Delete an existing namespace. Only empty namespaces (no tables) can be removed. +234 * @param name namespace name 235 */ -236 CompletableFuture<Pair<Integer, Integer>> getAlterStatus(TableName tableName); +236 CompletableFuture<Void> deleteNamespace(String name); 237 238 /** -239 * Add a column family to an existing table. -240 * @param tableName name of the table to add column family to -241 * @param columnFamily column family descriptor of column family to be added +239 * Get a namespace descriptor by name +240 * @param name name of namespace descriptor +241 * @return A descriptor wrapped by a {@link CompletableFuture}. 242 */ -243 CompletableFuture<Void> addColumnFamily(TableName tableName, -244 ColumnFamilyDescriptor columnFamily); -245 -246 /** -247 * Delete a column family from a table. -248 * @param tableName name of table -249 * @param columnFamily name of column family to be deleted -250 */ -251 CompletableFuture<Void> deleteColumnFamily(TableName tableName, byte[] columnFamily); -252 -253 /** -254 * Modify an existing column family on a table. -255 * @param tableName name of table -256 * @param columnFamily new column family descriptor to use -257 */ -258 CompletableFuture<Void> modifyColumnFamily(TableName tableName, -259 ColumnFamilyDescriptor columnFamily); +243 CompletableFuture<NamespaceDescriptor> getNamespaceDescriptor(String name); +244 +245 /** +246 * List available namespace descriptors +247 * @return List of descriptors wrapped by a {@link CompletableFuture}. +248 */ +249 CompletableFuture<List<NamespaceDescriptor>> listNamespaceDescriptors(); +250 +251 /** +252 * Get all the online regions on a region server. +253 */ +254 CompletableFuture<List<RegionInfo>> getOnlineRegions(ServerName serverName); +255 +256 /** +257 * Get the regions of a given table. +258 */ +259 CompletableFuture<List<RegionInfo>> getTableRegions(TableName tableName); 260 261 /** -262 * Create a new namespace. -263 * @param descriptor descriptor which describes the new namespace +262 * Flush a table. +263 * @param tableName table to flush 264 */ -265 CompletableFuture<Void> createNamespace(NamespaceDescriptor descriptor); +265 CompletableFuture<Void> flush(TableName tableName); 266 267 /** -268 * Modify an existing namespace. -269 * @param descriptor descriptor which describes the new namespace +268 * Flush an individual region. +269 * @param regionName region to flush 270 */ -271 CompletableFuture<Void> modifyNamespace(NamespaceDescriptor descriptor); +271 CompletableFuture<Void> flushRegion(byte[] regionName); 272 273 /** -274 * Delete an existing namespace. Only empty namespaces (no tables) can be removed. -275 * @param name namespace name -276 */ -277 CompletableFuture<Void> deleteNamespace(String name); -278 -279 /** -280 * Get a namespace descriptor by name -281 * @param name name of namespace descriptor -282 * @return A descriptor wrapped by a {@link CompletableFuture}. -283 */ -284 CompletableFuture<NamespaceDescriptor> getNamespaceDescriptor(String name); -285 -286 /** -287 * List available namespace descriptors -288 * @return List of descriptors wrapped by a {@link CompletableFuture}. +274 * Compact a table. When the returned CompletableFuture is done, it only means the compact request +275 * was sent to HBase and may need some time to finish the compact operation. +276 * @param tableName table to compact +277 */ +278 default CompletableFuture<Void> compact(TableName tableName) { +279 return compact(tableName, Optional.empty()); +280 } +281 +282 /** +283 * Compact a column family within a table. When the returned CompletableFuture is done, it only +284 * means the compact request was sent to HBase and may need some time to finish the compact +285 * operation. +286 * @param tableName table to compact +287 * @param columnFamily column family within a table. If not present, compact the table's all +288 * column families. 289 */ -290 CompletableFuture<List<NamespaceDescriptor>> listNamespaceDescriptors(); +290 CompletableFuture<Void> compact(TableName tableName, Optional<byte[]> columnFamily); 291 292 /** -293 * Close a region. For expert-admins Runs close on the regionserver. The master will not be -294 * informed of the close. -295 * @param regionName region name to close -296 * @param serverName Deprecated. Not used anymore after deprecation. -297 * @return Deprecated. Always returns true now. -298 * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 -299 * (<a href="https://issues.apache.org/jira/browse/HBASE-18231">HBASE-18231</a>). -300 * Use {@link #unassign(byte[], boolean)}. -301 */ -302 @Deprecated -303 CompletableFuture<Boolean> closeRegion(byte[] regionName, Optional<ServerName> serverName); -304 -305 /** -306 * Get all the online regions on a region server. -307 */ -308 CompletableFuture<List<RegionInfo>> getOnlineRegions(ServerName serverName); -309 -310 /** -311 * Get the regions of a given table. -312 */ -313 CompletableFuture<List<RegionInfo>> getTableRegions(TableName tableName); -314 -315 /** -316 * Flush a table. -317 * @param tableName table to flush -318 */ -319 CompletableFuture<Void> flush(TableName tableName); -320 -321 /** -322 * Flush an individual region. -323 * @param regionName region to flush -324 */ -325 CompletableFuture<Void> flushRegion(byte[] regionName); -326 -327 /** -328 * Compact a table. When the returned CompletableFuture is done, it only means the compact request -329 * was sent to HBase and may need some time to finish the compact operation. -330 * @param tableName table to compact -331 */ -332 default CompletableFuture<Void> compact(TableName tableName) { -333 return compact(tableName, Optional.empty()); -334 } -335 -336 /** -337 * Compact a column family within a table. When the returned CompletableFuture is done, it only -338 * means the compact request was sent to HBase and may need some time to finish the compact -339 * operation. -340 * @param tableName table to compact -341 * @param columnFamily column family within a table. If not present, compact the table's all -342 * column families. -343 */ -344 CompletableFuture<Void> compact(TableName tableName, Optional<byte[]> columnFamily); -345 -346 /** -347 * Compact an individual region. When the returned CompletableFuture is done, it only means the -348 * compact request was sent to HBase and may need some time to finish the compact operation. -349 * @param regionName region to compact -350 */ -351 default CompletableFuture<Void> compactRegion(byte[] regionName) { -352 return compactRegion(regionName, Optional.empty()); -353 } +293 * Compact an individual region. When the returned CompletableFuture is done, it only means the +294 * compact request was sent to HBase and may need some time to finish the compact operation. +295 * @param regionName region to compact +296 */ +297 default CompletableFuture<Void> compactRegion(byte[] regionName) { +298 return compactRegion(regionName, Optional.empty()); +299 } +300 +301 /** +302 * Compact a column family within a region. When the returned CompletableFuture is done, it only +303 * means the compact request was sent to HBase and may need some time to finish the compact +304 * operation. +305 * @param regionName region to compact +306 * @param columnFamily column family within a region. If not present, compact the region's all +307 * column families. +308 */ +309 CompletableFuture<Void> compactRegion(byte[] regionName, Optional<byte[]> columnFamily); +310 +311 /** +312 * Major compact a table. When the returned CompletableFuture is done, it only means the compact +313 * request was sent to HBase and may need some time to finish the compact operation. +314 * @param tableName table to major compact +315 */ +316 default CompletableFuture<Void> majorCompact(TableName tableName) { +317 return majorCompact(tableName, Optional.empty()); +318 } +319 +320 /** +321 * Major compact a column family within a table. When the returned CompletableFuture is done, it +322 * only means the compact request was sent to HBase and may need some time to finish the compact +323 * operation. +324 * @param tableName table to major compact +325 * @param columnFamily column family within a table. If not present, major compact the table's all +326 * column families. +327 */ +328 CompletableFuture<Void> majorCompact(TableName tableName, Optional<byte[]> columnFamily); +329 +330 /** +331 * Major compact a region. When the returned CompletableFuture is done, it only means the compact +332 * request was sent to HBase and may need some time to finish the compact operation. +333 * @param regionName region to major compact +334 */ +335 default CompletableFuture<Void> majorCompactRegion(byte[] regionName) { +336 return majorCompactRegion(regionName, Optional.empty()); +337 } +338 +339 /** +340 * Major compact a column family within region. When the returned CompletableFuture is done, it +341 * only means the compact request was sent to HBase and may need some time to finish the compact +342 * operation. +343 * @param regionName region to major compact +344 * @param columnFamily column family within a region. If not present, major compact the region's +345 * all column families. +346 */ +347 CompletableFuture<Void> majorCompactRegion(byte[] regionName, Optional<byte[]> columnFamily); +348 +349 /** +350 * Compact all regions on the region server. +351 * @param serverName the region server name +352 */ +353 CompletableFuture<Void> compactRegionServer(ServerName serverName); 354 355 /** -356 * Compact a column family within a region. When the returned CompletableFuture is done, it only -357 * means the compact request was sent to HBase and may need some time to finish the compact -358 * operation. -359 * @param regionName region to compact -360 * @param columnFamily column family within a region. If not present, compact the region's all -361 * column families. -362 */ -363 CompletableFuture<Void> compactRegion(byte[] regionName, Optional<byte[]> columnFamily); -364 -365 /** -366 * Major compact a table. When the returned CompletableFuture is done, it only means the compact -367 * request was sent to HBase and may need some time to finish the compact operation. -368 * @param tableName table to major compact -369 */ -370 default CompletableFuture<Void> majorCompact(TableName tableName) { -371 return majorCompact(tableName, Optional.empty()); -372 } -373 -374 /** -375 * Major compact a column family within a table. When the returned CompletableFuture is done, it -376 * only means the compact request was sent to HBase and may need some time to finish the compact -377 * operation. -378 * @param tableName table to major compact -379 * @param columnFamily column family within a table. If not present, major compact the table's all -380 * column families. -381 */ -382 CompletableFuture<Void> majorCompact(TableName tableName, Optional<byte[]> columnFamily); -383 -384 /** -385 * Major compact a region. When the returned CompletableFuture is done, it only means the compact -386 * request was sent to HBase and may need some time to finish the compact operation. -387 * @param regionName region to major compact -388 */ -389 default CompletableFuture<Void> majorCompactRegion(byte[] regionName) { -390 return majorCompactRegion(regionName, Optional.empty()); -391 } -392 -393 /** -394 * Major compact a column family within region. When the returned CompletableFuture is done, it -395 * only means the compact request was sent to HBase and may need some time to finish the compact -396 * operation. -397 * @param regionName region to major compact -398 * @param columnFamily column family within a region. If not present, major compact the region's -399 * all column families. -400 */ -401 CompletableFuture<Void> majorCompactRegion(byte[] regionName, Optional<byte[]> columnFamily); -402 -403 /** -404 * Compact all regions on the region server. -405 * @param serverName the region server name -406 */ -407 CompletableFuture<Void> compactRegionServer(ServerName serverName); -408 -409 /** -410 * Compact all regions on the region server. -411 * @param serverName the region server name -412 */ -413 CompletableFuture<Void> majorCompactRegionServer(ServerName serverName); -414 -415 /** -416 * Turn the Merge switch on or off. -417 * @param on -418 * @return Previous switch value wrapped by a {@link CompletableFuture} -419 */ -420 CompletableFuture<Boolean> setMergeOn(boolean on); -421 -422 /** -423 * Query the current state of the Merge switch. -424 * @return true if the switch is on, false otherwise. The return value will be wrapped by a -425 * {@link CompletableFuture} -426 */ -427 CompletableFuture<Boolean> isMergeOn(); -428 -429 /** -430 * Turn the Split switch on or off. -431 * @param on -432 * @return Previous switch value wrapped by a {@link CompletableFuture} -433 */ -434 CompletableFuture<Boolean> setSplitOn(boolean on); -435 -436 /** -437 * Query the current state of the Split switch. -438 * @return true if the switch is on, false otherwise. The return value will be wrapped by a -439 * {@link CompletableFuture} -440 */ -441 CompletableFuture<Boolean> isSplitOn(); -442 -443 /** -444 * Merge two regions. -445 * @param nameOfRegionA encoded or full name of region a -446 * @param nameOfRegionB encoded or full name of region b -447 * @param forcible true if do a compulsory merge, otherwise we will only merge two adjacent -448 * regions -449 */ -450 CompletableFuture<Void> mergeRegions(byte[] nameOfRegionA, byte[] nameOfRegionB, -451 boolean forcible); -452 -453 /** -454 * Split a table. The method will execute split action for each region in table. -455 * @param tableName table to split -456 */ -457 CompletableFuture<Void> split(TableName tableName); -458 -459 /** -460 * Split an individual region. -461 * @param regionName region to split -462 */ -463 default CompletableFuture<Void> splitRegion(byte[] regionName) { -464 return splitRegion(regionName, Optional.empty()); -465 } -466 -467 /** -468 * Split a table. -469 * @param tableName table to split -470 * @param splitPoint the explicit position to split on -471 */ -472 CompletableFuture<Void> split(TableName tableName, byte[] splitPoint); -473 -474 /** -475 * Split an individual region. -476 * @param regionName region to split -477 * @param splitPoint the explicit position to split on. If not present, it will decide by region -478 * server. -479 */ -480 CompletableFuture<Void> splitRegion(byte[] regionName, Optional<byte[]> splitPoint); -481 -482 /** -483 * @param regionName Encoded or full name of region to assign. -484 */ -485 CompletableFuture<Void> assign(byte[] regionName); -486 -487 /** -488 * Unassign a region from current hosting regionserver. Region will then be assigned to a -489 * regionserver chosen at random. Region could be reassigned back to the same server. Use -490 * {@link #move(byte[], Optional)} if you want to control the region movement. -491 * @param regionName Encoded or full name of region to unassign. Will clear any existing -492 * RegionPlan if one found. -493 * @param forcible If true, force unassign (Will remove region from regions-in-transition too if -494 * present. If results in double assignment use hbck -fix to resolve. To be used by -495 * experts). -496 */ -497 CompletableFuture<Void> unassign(byte[] regionName, boolean forcible); -498 -499 /** -500 * Offline specified region from master's in-memory state. It will not attempt to reassign the -501 * region as in unassign. This API can be used when a region not served by any region server and -502 * still online as per Master's in memory state. If this API is incorrectly used on active region -503 * then master will loose track of that region. This is a special method that should be used by -504 * experts or hbck. -505 * @param regionName Encoded or full name of region to offline -506 */ -507 CompletableFuture<Void> offline(byte[] regionName); -508 -509 /** -510 * Move the region <code>r</code> to <code>dest</code>. -511 * @param regionName Encoded or full name of region to move. -512 * @param destServerName The servername of the destination regionserver. If not present, we'll -513 * assign to a random server. A server name is made of host, port and startcode. Here is -514 * an example: <code> host187.example.com,60020,1289493121758</code> -515 */ -516 CompletableFuture<Void> move(byte[] regionName, Optional<ServerName> destServerName); +356 * Compact all regions on the region server. +357 * @param serverName the region server name +358 */ +359 CompletableFuture<Void> majorCompactRegionServer(ServerName serverName); +360 +361 /** +362 * Turn the Merge switch on or off. +363 * @param on +364 * @return Previous switch value wrapped by a {@link CompletableFuture} +365 */ +366 CompletableFuture<Boolean> setMergeOn(boolean on); +367 +368 /** +369 * Query the current state of the Merge switch. +370 * @return true if the switch is on, false otherwise. The return value will be wrapped by a +371 * {@link CompletableFuture} +372 */ +373 CompletableFuture<Boolean> isMergeOn(); +374 +375 /** +376 * Turn the Split switch on or off. +377 * @param on +378 * @return Previous switch value wrapped by a {@link CompletableFuture} +379 */ +380 CompletableFuture<Boolean> setSplitOn(boolean on); +381 +382 /** +383 * Query the current state of the Split switch. +384 * @return true if the switch is on, false otherwise. The return value will be wrapped by a +385 * {@link CompletableFuture} +386 */ +387 CompletableFuture<Boolean> isSplitOn(); +388 +389 /** +390 * Merge two regions. +391 * @param nameOfRegionA encoded or full name of region a +392 * @param nameOfRegionB encoded or full name of region b +393 * @param forcible true if do a compulsory merge, otherwise we will only merge two adjacent +394 * regions +395 */ +396 CompletableFuture<Void> mergeRegions(byte[] nameOfRegionA, byte[] nameOfRegionB, +397 boolean forcible); +398 +399 /** +400 * Split a table. The method will execute split action for each region in table. +401 * @param tableName table to split +402 */ +403 CompletableFuture<Void> split(TableName tableName); +404 +405 /** +406 * Split an individual region. +407 * @param regionName region to split +408 */ +409 default CompletableFuture<Void> splitRegion(byte[] regionName) { +410 return splitRegion(regionName, Optional.empty()); +411 } +412 +413 /** +414 * Split a table. +415 * @param tableName table to split +416 * @param splitPoint the explicit position to split on +417 */ +418 CompletableFuture<Void> split(TableName tableName, byte[] splitPoint); +419 +420 /** +421 * Split an individual region. +422 * @param regionName region to split +423 * @param splitPoint the explicit position to split on. If not present, it will decide by region +424 * server. +425 */ +426 CompletableFuture<Void> splitRegion(byte[] regionName, Optional<byte[]> splitPoint); +427 +428 /** +429 * @param regionName Encoded or full name of region to assign. +430 */ +431 CompletableFuture<Void> assign(byte[] regionName); +432 +433 /** +434 * Unassign a region from current hosting regionserver. Region will then be assigned to a +435 * regionserver chosen at random. Region could be reassigned back to the same server. Use +436 * {@link #move(byte[], Optional)} if you want to control the region movement. +437 * @param regionName Encoded or full name of region to unassign. Will clear any existing +438 * RegionPlan if one found. +439 * @param forcible If true, force unassign (Will remove region from regions-in-transition too if +440 * present. If results in double assignment use hbck -fix to resolve. To be used by +441 * experts). +442 */ +443 CompletableFuture<Void> unassign(byte[] regionName, boolean forcible); +444 +445 /** +446 * Offline specified region from master's in-memory state. It will not attempt to reassign the +447 * region as in unassign. This API can be used when a region not served by any region server and +448 * still online as per Master's in memory state. If this API is incorrectly used on active region +449 * then master will loose track of that region. This is a special method that should be used by +450 * experts or hbck. +451 * @param regionName Encoded or full name of region to offline +452 */ +453 CompletableFuture<Void> offline(byte[] regionName); +454 +455 /** +456 * Move the region <code>r</code> to <code>dest</code>. +457 * @param regionName Encoded or full name of region to move. +458 * @param destServerName The servername of the destination regionserver. If not present, we'll +459 * assign to a random server. A server name is made of host, port and startcode. Here is +460 * an example: <code> host187.example.com,60020,1289493121758</code> +461 */ +462 CompletableFuture<Void> move(byte[] regionName, Optional<ServerName> destServerName); +463 +464 /** +465 * Apply the new quota settings. +466 * @param quota the quota settings +467 */ +468 CompletableFuture<Void> setQuota(QuotaSettings quota); +469 +470 /** +471 * List the quotas based on the filter. +472 * @param filter the quota settings filter +473 * @return the QuotaSetting list, which wrapped by a CompletableFuture. +474 */ +475 CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter); +476 +477 /** +478 * Add a new replication peer for replicating data to slave cluster +479 * @param peerId a short name that identifies the peer +480 * @param peerConfig configuration for the replication slave cluster +481 */ +482 CompletableFuture<Void> addReplicationPeer(String peerId, +483 ReplicationPeerConfig peerConfig); +484 +485 /** +486 * Remove a peer and stop the replication +487 * @param peerId a short name that identifies the peer +488 */ +489 CompletableFuture<Void> removeReplicationPeer(String peerId); +490 +491 /** +492 * Restart the replication stream to the specified peer +493 * @param peerId a short name that identifies the peer +494 */ +495 CompletableFuture<Void> enableReplicationPeer(String peerId); +496 +497 /** +498 * Stop the replication stream to the specified peer +499 * @param peerId a short name that identifies the peer +500 */ +501 CompletableFuture<Void> disableReplicationPeer(String peerId); +502 +503 /** +504 * Returns the configured ReplicationPeerConfig for the specified peer +505 * @param peerId a short name that identifies the peer +506 * @return ReplicationPeerConfig for the peer wrapped by a {@link CompletableFuture}. +507 */ +508 CompletableFuture<ReplicationPeerConfig> getReplicationPeerConfig(String peerId); +509 +510 /** +511 * Update the peerConfig for the specified peer +512 * @param peerId a short name that identifies the peer +513 * @param peerConfig new config for the peer +514 */ +515 CompletableFuture<Void> updateReplicationPeerConfig(String peerId, +516 ReplicationPeerConfig peerConfig); 517 518 /** -519 * Apply the new quota settings. -520 * @param quota the quota settings -521 */ -522 CompletableFuture<Void> setQuota(QuotaSettings quota); -523 -524 /** -525 * List the quotas based on the filter. -526 * @param filter the quota settings filter -527 * @return the QuotaSetting list, which wrapped by a CompletableFuture. -528 */ -529 CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter); -530 -531 /** -532 * Add a new replication peer for replicating data to slave cluster -533 * @param peerId a short name that identifies the peer -534 * @param peerConfig configuration for the replication slave cluster -535 */ -536 CompletableFuture<Void> addReplicationPeer(String peerId, -537 ReplicationPeerConfig peerConfig); -538 -539 /** -540 * Remove a peer and stop the replication -541 * @param peerId a short name that identifies the peer -542 */ -543 CompletableFuture<Void> removeReplicationPeer(String peerId); -544 -545 /** -546 * Restart the replication stream to the specified peer -547 * @param peerId a short name that identifies the peer +519 * Append the replicable table-cf config of the specified peer +520 * @param peerId a short that identifies the cluster +521 * @param tableCfs A map from tableName to column family names +522 */ +523 CompletableFuture<Void> appendReplicationPeerTableCFs(String peerId, +524 Map<TableName, ? extends Collection<String>> tableCfs); +525 +526 /** +527 * Remove some table-cfs from config of the specified peer +528 * @param peerId a short name that identifies the cluster +529 * @param tableCfs A map from tableName to column family names +530 */ +531 CompletableFuture<Void> removeReplicationPeerTableCFs(String peerId, +532 Map<TableName, ? extends Collection<String>> tableCfs); +533 +534 /** +535 * Return a list of replication peers. +536 * @return a list of replication peers description. The return value will be wrapped by a +537 * {@link CompletableFuture}. +538 */ +539 default CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers() { +540 return listReplicationPeers(Optional.empty()); +541 } +542 +543 /** +544 * Return a list of replication peers. +545 * @param pattern The compiled regular expression to match peer id +546 * @return a list of replication peers description. The return value will be wrapped by a +547 * {@link CompletableFuture}. 548 */ -549 CompletableFuture<Void> enableReplicationPeer(String peerId); -550 -551 /** -552 * Stop the replication stream to the specified peer -553 * @param peerId a short name that identifies the peer -554 */ -555 CompletableFuture<Void> disableReplicationPeer(String peerId); -556 -557 /** -558 * Returns the configured ReplicationPeerConfig for the specified peer -559 * @param peerId a short name that identifies the peer -560 * @return ReplicationPeerConfig for the peer wrapped by a {@link CompletableFuture}. -561 */ -562 CompletableFuture<ReplicationPeerConfig> getReplicationPeerConfig(String peerId); -563 -564 /** -565 * Update the peerConfig for the specified peer -566 * @param peerId a short name that identifies the peer -567 * @param peerConfig new config for the peer -568 */ -569 CompletableFuture<Void> updateReplicationPeerConfig(String peerId, -570 ReplicationPeerConfig peerConfig); -571 -572 /** -573 * Append the replicable table-cf config of the specified peer -574 * @param peerId a short that identifies the cluster -575 * @param tableCfs A map from tableName to column family names -576 */ -577 CompletableFuture<Void> appendReplicationPeerTableCFs(String peerId, -578 Map<TableName, ? extends Collection<String>> tableCfs); -579 -580 /** -581 * Remove some table-cfs from config of the specified peer -582 * @param peerId a short name that identifies the cluster -583 * @param tableCfs A map from tableName to column family names -584 */ -585 CompletableFuture<Void> removeReplicationPeerTableCFs(String peerId, -586 Map<TableName, ? extends Collection<String>> tableCfs); -587 -588 /** -589 * Return a list of replication peers. -590 * @return a list of replication peers description. The return value will be wrapped by a -591 * {@link CompletableFuture}. -592 */ -593 default CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers() { -594 return listReplicationPeers(Optional.empty()); -595 } -596 -597 /** -598 * Return a list of replication peers. -599 * @param pattern The compiled regular expression to match peer id -600 * @return a list of replication peers description. The return value will be wrapped by a -601 * {@link CompletableFuture}. -602 */ -603 CompletableFuture<List<ReplicationPeerDescription>> -604 listReplicationPeers(Optional<Pattern> pattern); +549 CompletableFuture<List<ReplicationPeerDescription>> +550 listReplicationPeers(Optional<Pattern> pattern); +551 +552 /** +553 * Find all table and column families that are replicated from this cluster +554 * @return the replicated table-cfs list of this cluster. The return value will be wrapped by a +555 * {@link CompletableFuture}. +556 */ +557 CompletableFuture<List<TableCFs>> listReplicatedTableCFs(); +558 +559 /** +560 * Take a snapshot for the given table. If the table is enabled, a FLUSH-type snapshot will be +561 * taken. If the table is disabled, an offline snapshot is taken. Snapshots are considered unique +562 * based on <b>the name of the snapshot</b>. Attempts to take a snapshot with the same name (even +563 * a different type or with different parameters) will fail with a +564 * {@link org.apache.hadoop.hbase.snapshot.SnapshotCreationException} indicating the duplicate +565 * naming. Snapshot names follow the same naming constraints as tables in HBase. See +566 * {@link org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}. +567 * @param snapshotName name of the snapshot to be created +568 * @param tableName name of the table for which snapshot is created +569 */ +570 default CompletableFuture<Void> snapshot(String snapshotName, TableName tableName) { +571 return snapshot(snapshotName, tableName, SnapshotType.FLUSH); +572 } +573 +574 /** +575 * Create typed sna