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 54DA3200D39 for ; Fri, 27 Oct 2017 17:16:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 53A5E1609E9; Fri, 27 Oct 2017 15:16:37 +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 84420160BF7 for ; Fri, 27 Oct 2017 17:16:35 +0200 (CEST) Received: (qmail 60275 invoked by uid 500); 27 Oct 2017 15:16:28 -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 58735 invoked by uid 99); 27 Oct 2017 15:16:27 -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; Fri, 27 Oct 2017 15:16:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CB40EE04DD; Fri, 27 Oct 2017 15:16: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: Fri, 27 Oct 2017 15:16:56 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [35/51] [partial] hbase-site git commit: Published site at . archived-at: Fri, 27 Oct 2017 15:16:37 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/00c22388/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncTableBase.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncTableBase.html b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncTableBase.html index f5f24c5..40ba9ea 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncTableBase.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncTableBase.html @@ -71,345 +71,355 @@ 063 * specific rpc timeout config such as readRpcTimeout or writeRpcTimeout. 064 * @see #getReadRpcTimeout(TimeUnit) 065 * @see #getWriteRpcTimeout(TimeUnit) -066 */ -067 long getRpcTimeout(TimeUnit unit); -068 -069 /** -070 * Get timeout of each rpc read request in this Table instance. -071 */ -072 long getReadRpcTimeout(TimeUnit unit); -073 -074 /** -075 * Get timeout of each rpc write request in this Table instance. -076 */ -077 long getWriteRpcTimeout(TimeUnit unit); -078 -079 /** -080 * Get timeout of each operation in Table instance. -081 */ -082 long getOperationTimeout(TimeUnit unit); -083 -084 /** -085 * Get the timeout of a single operation in a scan. It works like operation timeout for other -086 * operations. -087 */ -088 long getScanTimeout(TimeUnit unit); -089 -090 /** -091 * Test for the existence of columns in the table, as specified by the Get. -092 * <p> -093 * This will return true if the Get matches one or more keys, false if not. -094 * <p> -095 * This is a server-side call so it prevents any data from being transfered to the client. -096 * @return true if the specified Get matches one or more keys, false if not. The return value will -097 * be wrapped by a {@link CompletableFuture}. -098 */ -099 default CompletableFuture<Boolean> exists(Get get) { -100 return get(toCheckExistenceOnly(get)).thenApply(r -> r.getExists()); -101 } -102 -103 /** -104 * Extracts certain cells from a given row. -105 * @param get The object that specifies what data to fetch and from which row. -106 * @return The data coming from the specified row, if it exists. If the row specified doesn't -107 * exist, the {@link Result} instance returned won't contain any -108 * {@link org.apache.hadoop.hbase.KeyValue}, as indicated by {@link Result#isEmpty()}. The -109 * return value will be wrapped by a {@link CompletableFuture}. -110 */ -111 CompletableFuture<Result> get(Get get); +066 * @param unit the unit of time the timeout to be represented in +067 * @return rpc timeout in the specified time unit +068 */ +069 long getRpcTimeout(TimeUnit unit); +070 +071 /** +072 * Get timeout of each rpc read request in this Table instance. +073 * @param unit the unit of time the timeout to be represented in +074 * @return read rpc timeout in the specified time unit +075 */ +076 long getReadRpcTimeout(TimeUnit unit); +077 +078 /** +079 * Get timeout of each rpc write request in this Table instance. +080 * @param unit the unit of time the timeout to be represented in +081 * @return write rpc timeout in the specified time unit +082 */ +083 long getWriteRpcTimeout(TimeUnit unit); +084 +085 /** +086 * Get timeout of each operation in Table instance. +087 * @param unit the unit of time the timeout to be represented in +088 * @return operation rpc timeout in the specified time unit +089 */ +090 long getOperationTimeout(TimeUnit unit); +091 +092 /** +093 * Get the timeout of a single operation in a scan. It works like operation timeout for other +094 * operations. +095 * @param unit the unit of time the timeout to be represented in +096 * @return scan rpc timeout in the specified time unit +097 */ +098 long getScanTimeout(TimeUnit unit); +099 +100 /** +101 * Test for the existence of columns in the table, as specified by the Get. +102 * <p> +103 * This will return true if the Get matches one or more keys, false if not. +104 * <p> +105 * This is a server-side call so it prevents any data from being transfered to the client. +106 * @return true if the specified Get matches one or more keys, false if not. The return value will +107 * be wrapped by a {@link CompletableFuture}. +108 */ +109 default CompletableFuture<Boolean> exists(Get get) { +110 return get(toCheckExistenceOnly(get)).thenApply(r -> r.getExists()); +111 } 112 113 /** -114 * Puts some data to the table. -115 * @param put The data to put. -116 * @return A {@link CompletableFuture} that always returns null when complete normally. -117 */ -118 CompletableFuture<Void> put(Put put); -119 -120 /** -121 * Deletes the specified cells/row. -122 * @param delete The object that specifies what to delete. -123 * @return A {@link CompletableFuture} that always returns null when complete normally. -124 */ -125 CompletableFuture<Void> delete(Delete delete); -126 -127 /** -128 * Appends values to one or more columns within a single row. -129 * <p> -130 * This operation does not appear atomic to readers. Appends are done under a single row lock, so -131 * write operations to a row are synchronized, but readers do not take row locks so get and scan -132 * operations can see this operation partially completed. -133 * @param append object that specifies the columns and amounts to be used for the increment -134 * operations -135 * @return values of columns after the append operation (maybe null). The return value will be -136 * wrapped by a {@link CompletableFuture}. -137 */ -138 CompletableFuture<Result> append(Append append); -139 -140 /** -141 * Increments one or more columns within a single row. -142 * <p> -143 * This operation does not appear atomic to readers. Increments are done under a single row lock, -144 * so write operations to a row are synchronized, but readers do not take row locks so get and -145 * scan operations can see this operation partially completed. -146 * @param increment object that specifies the columns and amounts to be used for the increment -147 * operations -148 * @return values of columns after the increment. The return value will be wrapped by a -149 * {@link CompletableFuture}. -150 */ -151 CompletableFuture<Result> increment(Increment increment); -152 -153 /** -154 * See {@link #incrementColumnValue(byte[], byte[], byte[], long, Durability)} -155 * <p> -156 * The {@link Durability} is defaulted to {@link Durability#SYNC_WAL}. -157 * @param row The row that contains the cell to increment. -158 * @param family The column family of the cell to increment. -159 * @param qualifier The column qualifier of the cell to increment. -160 * @param amount The amount to increment the cell with (or decrement, if the amount is negative). -161 * @return The new value, post increment. The return value will be wrapped by a -162 * {@link CompletableFuture}. -163 */ -164 default CompletableFuture<Long> incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, -165 long amount) { -166 return incrementColumnValue(row, family, qualifier, amount, Durability.SYNC_WAL); -167 } -168 -169 /** -170 * Atomically increments a column value. If the column value already exists and is not a -171 * big-endian long, this could throw an exception. If the column value does not yet exist it is -172 * initialized to <code>amount</code> and written to the specified column. -173 * <p> -174 * Setting durability to {@link Durability#SKIP_WAL} means that in a fail scenario you will lose -175 * any increments that have not been flushed. -176 * @param row The row that contains the cell to increment. -177 * @param family The column family of the cell to increment. -178 * @param qualifier The column qualifier of the cell to increment. -179 * @param amount The amount to increment the cell with (or decrement, if the amount is negative). -180 * @param durability The persistence guarantee for this increment. -181 * @return The new value, post increment. The return value will be wrapped by a -182 * {@link CompletableFuture}. -183 */ -184 default CompletableFuture<Long> incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, -185 long amount, Durability durability) { -186 Preconditions.checkNotNull(row, "row is null"); -187 Preconditions.checkNotNull(family, "family is null"); -188 return increment( -189 new Increment(row).addColumn(family, qualifier, amount).setDurability(durability)) -190 .thenApply(r -> Bytes.toLong(r.getValue(family, qualifier))); -191 } -192 -193 /** -194 * Atomically checks if a row/family/qualifier value matches the expected value. If it does, it -195 * adds the Put/Delete/RowMutations. -196 * <p> -197 * Use the returned {@link CheckAndMutateBuilder} to construct your request and then execute it. -198 * This is a fluent style API, the code is like: -199 * -200 * <pre> -201 * <code> -202 * table.checkAndMutate(row, family).qualifier(qualifier).ifNotExists().thenPut(put) -203 * .thenAccept(succ -> { -204 * if (succ) { -205 * System.out.println("Check and put succeeded"); -206 * } else { -207 * System.out.println("Check and put failed"); -208 * } -209 * }); -210 * </code> -211 * </pre> -212 */ -213 CheckAndMutateBuilder checkAndMutate(byte[] row, byte[] family); -214 -215 /** -216 * A helper class for sending checkAndMutate request. -217 */ -218 interface CheckAndMutateBuilder { -219 -220 /** -221 * @param qualifier column qualifier to check. -222 */ -223 CheckAndMutateBuilder qualifier(byte[] qualifier); +114 * Extracts certain cells from a given row. +115 * @param get The object that specifies what data to fetch and from which row. +116 * @return The data coming from the specified row, if it exists. If the row specified doesn't +117 * exist, the {@link Result} instance returned won't contain any +118 * {@link org.apache.hadoop.hbase.KeyValue}, as indicated by {@link Result#isEmpty()}. The +119 * return value will be wrapped by a {@link CompletableFuture}. +120 */ +121 CompletableFuture<Result> get(Get get); +122 +123 /** +124 * Puts some data to the table. +125 * @param put The data to put. +126 * @return A {@link CompletableFuture} that always returns null when complete normally. +127 */ +128 CompletableFuture<Void> put(Put put); +129 +130 /** +131 * Deletes the specified cells/row. +132 * @param delete The object that specifies what to delete. +133 * @return A {@link CompletableFuture} that always returns null when complete normally. +134 */ +135 CompletableFuture<Void> delete(Delete delete); +136 +137 /** +138 * Appends values to one or more columns within a single row. +139 * <p> +140 * This operation does not appear atomic to readers. Appends are done under a single row lock, so +141 * write operations to a row are synchronized, but readers do not take row locks so get and scan +142 * operations can see this operation partially completed. +143 * @param append object that specifies the columns and amounts to be used for the increment +144 * operations +145 * @return values of columns after the append operation (maybe null). The return value will be +146 * wrapped by a {@link CompletableFuture}. +147 */ +148 CompletableFuture<Result> append(Append append); +149 +150 /** +151 * Increments one or more columns within a single row. +152 * <p> +153 * This operation does not appear atomic to readers. Increments are done under a single row lock, +154 * so write operations to a row are synchronized, but readers do not take row locks so get and +155 * scan operations can see this operation partially completed. +156 * @param increment object that specifies the columns and amounts to be used for the increment +157 * operations +158 * @return values of columns after the increment. The return value will be wrapped by a +159 * {@link CompletableFuture}. +160 */ +161 CompletableFuture<Result> increment(Increment increment); +162 +163 /** +164 * See {@link #incrementColumnValue(byte[], byte[], byte[], long, Durability)} +165 * <p> +166 * The {@link Durability} is defaulted to {@link Durability#SYNC_WAL}. +167 * @param row The row that contains the cell to increment. +168 * @param family The column family of the cell to increment. +169 * @param qualifier The column qualifier of the cell to increment. +170 * @param amount The amount to increment the cell with (or decrement, if the amount is negative). +171 * @return The new value, post increment. The return value will be wrapped by a +172 * {@link CompletableFuture}. +173 */ +174 default CompletableFuture<Long> incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, +175 long amount) { +176 return incrementColumnValue(row, family, qualifier, amount, Durability.SYNC_WAL); +177 } +178 +179 /** +180 * Atomically increments a column value. If the column value already exists and is not a +181 * big-endian long, this could throw an exception. If the column value does not yet exist it is +182 * initialized to <code>amount</code> and written to the specified column. +183 * <p> +184 * Setting durability to {@link Durability#SKIP_WAL} means that in a fail scenario you will lose +185 * any increments that have not been flushed. +186 * @param row The row that contains the cell to increment. +187 * @param family The column family of the cell to increment. +188 * @param qualifier The column qualifier of the cell to increment. +189 * @param amount The amount to increment the cell with (or decrement, if the amount is negative). +190 * @param durability The persistence guarantee for this increment. +191 * @return The new value, post increment. The return value will be wrapped by a +192 * {@link CompletableFuture}. +193 */ +194 default CompletableFuture<Long> incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, +195 long amount, Durability durability) { +196 Preconditions.checkNotNull(row, "row is null"); +197 Preconditions.checkNotNull(family, "family is null"); +198 return increment( +199 new Increment(row).addColumn(family, qualifier, amount).setDurability(durability)) +200 .thenApply(r -> Bytes.toLong(r.getValue(family, qualifier))); +201 } +202 +203 /** +204 * Atomically checks if a row/family/qualifier value matches the expected value. If it does, it +205 * adds the Put/Delete/RowMutations. +206 * <p> +207 * Use the returned {@link CheckAndMutateBuilder} to construct your request and then execute it. +208 * This is a fluent style API, the code is like: +209 * +210 * <pre> +211 * <code> +212 * table.checkAndMutate(row, family).qualifier(qualifier).ifNotExists().thenPut(put) +213 * .thenAccept(succ -> { +214 * if (succ) { +215 * System.out.println("Check and put succeeded"); +216 * } else { +217 * System.out.println("Check and put failed"); +218 * } +219 * }); +220 * </code> +221 * </pre> +222 */ +223 CheckAndMutateBuilder checkAndMutate(byte[] row, byte[] family); 224 -225 /** -226 * Check for lack of column. -227 */ -228 CheckAndMutateBuilder ifNotExists(); +225 /** +226 * A helper class for sending checkAndMutate request. +227 */ +228 interface CheckAndMutateBuilder { 229 -230 default CheckAndMutateBuilder ifEquals(byte[] value) { -231 return ifMatches(CompareOperator.EQUAL, value); -232 } -233 -234 /** -235 * @param compareOp comparison operator to use -236 * @param value the expected value +230 /** +231 * @param qualifier column qualifier to check. +232 */ +233 CheckAndMutateBuilder qualifier(byte[] qualifier); +234 +235 /** +236 * Check for lack of column. 237 */ -238 CheckAndMutateBuilder ifMatches(CompareOperator compareOp, byte[] value); +238 CheckAndMutateBuilder ifNotExists(); 239 -240 /** -241 * @param put data to put if check succeeds -242 * @return {@code true} if the new put was executed, {@code false} otherwise. The return value -243 * will be wrapped by a {@link CompletableFuture}. -244 */ -245 CompletableFuture<Boolean> thenPut(Put put); -246 -247 /** -248 * @param delete data to delete if check succeeds -249 * @return {@code true} if the new delete was executed, {@code false} otherwise. The return -250 * value will be wrapped by a {@link CompletableFuture}. -251 */ -252 CompletableFuture<Boolean> thenDelete(Delete delete); -253 -254 /** -255 * @param mutation mutations to perform if check succeeds -256 * @return true if the new mutation was executed, false otherwise. The return value will be -257 * wrapped by a {@link CompletableFuture}. -258 */ -259 CompletableFuture<Boolean> thenMutate(RowMutations mutation); -260 } -261 -262 /** -263 * Performs multiple mutations atomically on a single row. Currently {@link Put} and -264 * {@link Delete} are supported. -265 * @param mutation object that specifies the set of mutations to perform atomically -266 * @return A {@link CompletableFuture} that always returns null when complete normally. -267 */ -268 CompletableFuture<Void> mutateRow(RowMutations mutation); -269 -270 /** -271 * Return all the results that match the given scan object. -272 * <p> -273 * Notice that usually you should use this method with a {@link Scan} object that has limit set. -274 * For example, if you want to get the closest row after a given row, you could do this: -275 * <p> -276 * -277 * <pre> -278 * <code> -279 * table.scanAll(new Scan().withStartRow(row, false).setLimit(1)).thenAccept(results -> { -280 * if (results.isEmpty()) { -281 * System.out.println("No row after " + Bytes.toStringBinary(row)); -282 * } else { -283 * System.out.println("The closest row after " + Bytes.toStringBinary(row) + " is " -284 * + Bytes.toStringBinary(results.stream().findFirst().get().getRow())); -285 * } -286 * }); -287 * </code> -288 * </pre> -289 * <p> -290 * If your result set is very large, you should use other scan method to get a scanner or use -291 * callback to process the results. They will do chunking to prevent OOM. The scanAll method will -292 * fetch all the results and store them in a List and then return the list to you. -293 * <p> -294 * The scan metrics will be collected background if you enable it but you have no way to get it. -295 * Usually you can get scan metrics from {@code ResultScanner}, or through -296 * {@code ScanResultConsumer.onScanMetricsCreated} but this method only returns a list of results. -297 * So if you really care about scan metrics then you'd better use other scan methods which return -298 * a {@code ResultScanner} or let you pass in a {@code ScanResultConsumer}. There is no -299 * performance difference between these scan methods so do not worry. -300 * @param scan A configured {@link Scan} object. So if you use this method to fetch a really large -301 * result set, it is likely to cause OOM. -302 * @return The results of this small scan operation. The return value will be wrapped by a -303 * {@link CompletableFuture}. -304 */ -305 CompletableFuture<List<Result>> scanAll(Scan scan); -306 -307 /** -308 * Test for the existence of columns in the table, as specified by the Gets. -309 * <p> -310 * This will return a list of booleans. Each value will be true if the related Get matches one or -311 * more keys, false if not. -312 * <p> -313 * This is a server-side call so it prevents any data from being transferred to the client. -314 * @param gets the Gets -315 * @return A list of {@link CompletableFuture}s that represent the existence for each get. -316 */ -317 default List<CompletableFuture<Boolean>> exists(List<Get> gets) { -318 return get(toCheckExistenceOnly(gets)).stream() -319 .<CompletableFuture<Boolean>> map(f -> f.thenApply(r -> r.getExists())).collect(toList()); -320 } -321 -322 /** -323 * A simple version for batch exists. It will fail if there are any failures and you will get the -324 * whole result boolean list at once if the operation is succeeded. -325 * @param gets the Gets -326 * @return A {@link CompletableFuture} that wrapper the result boolean list. -327 */ -328 default CompletableFuture<List<Boolean>> existsAll(List<Get> gets) { -329 return allOf(exists(gets)); +240 default CheckAndMutateBuilder ifEquals(byte[] value) { +241 return ifMatches(CompareOperator.EQUAL, value); +242 } +243 +244 /** +245 * @param compareOp comparison operator to use +246 * @param value the expected value +247 */ +248 CheckAndMutateBuilder ifMatches(CompareOperator compareOp, byte[] value); +249 +250 /** +251 * @param put data to put if check succeeds +252 * @return {@code true} if the new put was executed, {@code false} otherwise. The return value +253 * will be wrapped by a {@link CompletableFuture}. +254 */ +255 CompletableFuture<Boolean> thenPut(Put put); +256 +257 /** +258 * @param delete data to delete if check succeeds +259 * @return {@code true} if the new delete was executed, {@code false} otherwise. The return +260 * value will be wrapped by a {@link CompletableFuture}. +261 */ +262 CompletableFuture<Boolean> thenDelete(Delete delete); +263 +264 /** +265 * @param mutation mutations to perform if check succeeds +266 * @return true if the new mutation was executed, false otherwise. The return value will be +267 * wrapped by a {@link CompletableFuture}. +268 */ +269 CompletableFuture<Boolean> thenMutate(RowMutations mutation); +270 } +271 +272 /** +273 * Performs multiple mutations atomically on a single row. Currently {@link Put} and +274 * {@link Delete} are supported. +275 * @param mutation object that specifies the set of mutations to perform atomically +276 * @return A {@link CompletableFuture} that always returns null when complete normally. +277 */ +278 CompletableFuture<Void> mutateRow(RowMutations mutation); +279 +280 /** +281 * Return all the results that match the given scan object. +282 * <p> +283 * Notice that usually you should use this method with a {@link Scan} object that has limit set. +284 * For example, if you want to get the closest row after a given row, you could do this: +285 * <p> +286 * +287 * <pre> +288 * <code> +289 * table.scanAll(new Scan().withStartRow(row, false).setLimit(1)).thenAccept(results -> { +290 * if (results.isEmpty()) { +291 * System.out.println("No row after " + Bytes.toStringBinary(row)); +292 * } else { +293 * System.out.println("The closest row after " + Bytes.toStringBinary(row) + " is " +294 * + Bytes.toStringBinary(results.stream().findFirst().get().getRow())); +295 * } +296 * }); +297 * </code> +298 * </pre> +299 * <p> +300 * If your result set is very large, you should use other scan method to get a scanner or use +301 * callback to process the results. They will do chunking to prevent OOM. The scanAll method will +302 * fetch all the results and store them in a List and then return the list to you. +303 * <p> +304 * The scan metrics will be collected background if you enable it but you have no way to get it. +305 * Usually you can get scan metrics from {@code ResultScanner}, or through +306 * {@code ScanResultConsumer.onScanMetricsCreated} but this method only returns a list of results. +307 * So if you really care about scan metrics then you'd better use other scan methods which return +308 * a {@code ResultScanner} or let you pass in a {@code ScanResultConsumer}. There is no +309 * performance difference between these scan methods so do not worry. +310 * @param scan A configured {@link Scan} object. So if you use this method to fetch a really large +311 * result set, it is likely to cause OOM. +312 * @return The results of this small scan operation. The return value will be wrapped by a +313 * {@link CompletableFuture}. +314 */ +315 CompletableFuture<List<Result>> scanAll(Scan scan); +316 +317 /** +318 * Test for the existence of columns in the table, as specified by the Gets. +319 * <p> +320 * This will return a list of booleans. Each value will be true if the related Get matches one or +321 * more keys, false if not. +322 * <p> +323 * This is a server-side call so it prevents any data from being transferred to the client. +324 * @param gets the Gets +325 * @return A list of {@link CompletableFuture}s that represent the existence for each get. +326 */ +327 default List<CompletableFuture<Boolean>> exists(List<Get> gets) { +328 return get(toCheckExistenceOnly(gets)).stream() +329 .<CompletableFuture<Boolean>> map(f -> f.thenApply(r -> r.getExists())).collect(toList()); 330 } 331 332 /** -333 * Extracts certain cells from the given rows, in batch. -334 * <p> -335 * Notice that you may not get all the results with this function, which means some of the -336 * returned {@link CompletableFuture}s may succeed while some of the other returned -337 * {@link CompletableFuture}s may fail. -338 * @param gets The objects that specify what data to fetch and from which rows. -339 * @return A list of {@link CompletableFuture}s that represent the result for each get. -340 */ -341 List<CompletableFuture<Result>> get(List<Get> gets); -342 -343 /** -344 * A simple version for batch get. It will fail if there are any failures and you will get the -345 * whole result list at once if the operation is succeeded. -346 * @param gets The objects that specify what data to fetch and from which rows. -347 * @return A {@link CompletableFuture} that wrapper the result list. -348 */ -349 default CompletableFuture<List<Result>> getAll(List<Get> gets) { -350 return allOf(get(gets)); -351 } +333 * A simple version for batch exists. It will fail if there are any failures and you will get the +334 * whole result boolean list at once if the operation is succeeded. +335 * @param gets the Gets +336 * @return A {@link CompletableFuture} that wrapper the result boolean list. +337 */ +338 default CompletableFuture<List<Boolean>> existsAll(List<Get> gets) { +339 return allOf(exists(gets)); +340 } +341 +342 /** +343 * Extracts certain cells from the given rows, in batch. +344 * <p> +345 * Notice that you may not get all the results with this function, which means some of the +346 * returned {@link CompletableFuture}s may succeed while some of the other returned +347 * {@link CompletableFuture}s may fail. +348 * @param gets The objects that specify what data to fetch and from which rows. +349 * @return A list of {@link CompletableFuture}s that represent the result for each get. +350 */ +351 List<CompletableFuture<Result>> get(List<Get> gets); 352 353 /** -354 * Puts some data in the table, in batch. -355 * @param puts The list of mutations to apply. -356 * @return A list of {@link CompletableFuture}s that represent the result for each put. -357 */ -358 List<CompletableFuture<Void>> put(List<Put> puts); -359 -360 /** -361 * A simple version of batch put. It will fail if there are any failures. -362 * @param puts The list of mutations to apply. -363 * @return A {@link CompletableFuture} that always returns null when complete normally. -364 */ -365 default CompletableFuture<Void> putAll(List<Put> puts) { -366 return allOf(put(puts)).thenApply(r -> null); -367 } -368 -369 /** -370 * Deletes the specified cells/rows in bulk. -371 * @param deletes list of things to delete. -372 * @return A list of {@link CompletableFuture}s that represent the result for each delete. -373 */ -374 List<CompletableFuture<Void>> delete(List<Delete> deletes); -375 -376 /** -377 * A simple version of batch delete. It will fail if there are any failures. -378 * @param deletes list of things to delete. -379 * @return A {@link CompletableFuture} that always returns null when complete normally. -380 */ -381 default CompletableFuture<Void> deleteAll(List<Delete> deletes) { -382 return allOf(delete(deletes)).thenApply(r -> null); -383 } -384 -385 /** -386 * Method that does a batch call on Deletes, Gets, Puts, Increments and Appends. The ordering of -387 * execution of the actions is not defined. Meaning if you do a Put and a Get in the same -388 * {@link #batch} call, you will not necessarily be guaranteed that the Get returns what the Put -389 * had put. -390 * @param actions list of Get, Put, Delete, Increment, Append objects -391 * @return A list of {@link CompletableFuture}s that represent the result for each action. -392 */ -393 <T> List<CompletableFuture<T>> batch(List<? extends Row> actions); +354 * A simple version for batch get. It will fail if there are any failures and you will get the +355 * whole result list at once if the operation is succeeded. +356 * @param gets The objects that specify what data to fetch and from which rows. +357 * @return A {@link CompletableFuture} that wrapper the result list. +358 */ +359 default CompletableFuture<List<Result>> getAll(List<Get> gets) { +360 return allOf(get(gets)); +361 } +362 +363 /** +364 * Puts some data in the table, in batch. +365 * @param puts The list of mutations to apply. +366 * @return A list of {@link CompletableFuture}s that represent the result for each put. +367 */ +368 List<CompletableFuture<Void>> put(List<Put> puts); +369 +370 /** +371 * A simple version of batch put. It will fail if there are any failures. +372 * @param puts The list of mutations to apply. +373 * @return A {@link CompletableFuture} that always returns null when complete normally. +374 */ +375 default CompletableFuture<Void> putAll(List<Put> puts) { +376 return allOf(put(puts)).thenApply(r -> null); +377 } +378 +379 /** +380 * Deletes the specified cells/rows in bulk. +381 * @param deletes list of things to delete. +382 * @return A list of {@link CompletableFuture}s that represent the result for each delete. +383 */ +384 List<CompletableFuture<Void>> delete(List<Delete> deletes); +385 +386 /** +387 * A simple version of batch delete. It will fail if there are any failures. +388 * @param deletes list of things to delete. +389 * @return A {@link CompletableFuture} that always returns null when complete normally. +390 */ +391 default CompletableFuture<Void> deleteAll(List<Delete> deletes) { +392 return allOf(delete(deletes)).thenApply(r -> null); +393 } 394 395 /** -396 * A simple version of batch. It will fail if there are any failures and you will get the whole -397 * result list at once if the operation is succeeded. -398 * @param actions list of Get, Put, Delete, Increment, Append objects -399 * @return A list of the result for the actions. Wrapped by a {@link CompletableFuture}. -400 */ -401 default <T> CompletableFuture<List<T>> batchAll(List<? extends Row> actions) { -402 return allOf(batch(actions)); -403 } -404} +396 * Method that does a batch call on Deletes, Gets, Puts, Increments and Appends. The ordering of +397 * execution of the actions is not defined. Meaning if you do a Put and a Get in the same +398 * {@link #batch} call, you will not necessarily be guaranteed that the Get returns what the Put +399 * had put. +400 * @param actions list of Get, Put, Delete, Increment, Append objects +401 * @return A list of {@link CompletableFuture}s that represent the result for each action. +402 */ +403 <T> List<CompletableFuture<T>> batch(List<? extends Row> actions); +404 +405 /** +406 * A simple version of batch. It will fail if there are any failures and you will get the whole +407 * result list at once if the operation is succeeded. +408 * @param actions list of Get, Put, Delete, Increment, Append objects +409 * @return A list of the result for the actions. Wrapped by a {@link CompletableFuture}. +410 */ +411 default <T> CompletableFuture<List<T>> batchAll(List<? extends Row> actions) { +412 return allOf(batch(actions)); +413 } +414} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/00c22388/apidocs/src-html/org/apache/hadoop/hbase/client/Query.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/Query.html b/apidocs/src-html/org/apache/hadoop/hbase/client/Query.html index f03bdda..6228f20 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/client/Query.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/client/Query.html @@ -63,7 +63,7 @@ 055 056 /** 057 * Apply the specified server-side filter when performing the Query. Only -058 * {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)} is called AFTER all tests for ttl, +058 * {@link Filter#filterCell(org.apache.hadoop.hbase.Cell)} is called AFTER all tests for ttl, 059 * column match, deletes and column family's max versions have been run. 060 * @param filter filter to run on the server 061 * @return this for invocation chaining