From 085e3b11597bd63317abfacd1c4660c43f2189ae Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 21 Apr 2026 18:19:27 +0900 Subject: [PATCH] HBASE-30100 Fix misleading Javadoc for Table.batch about null in results array The Javadoc claimed a null in the result array means the action failed even after retries. This has been wrong since HBASE-6295 (0.96.0): per-action failures now store the Throwable in the slot, not null. The only remaining case where null appears is when the batch is rejected before dispatch by synchronous input validation in RawAsyncTableImpl.batch (e.g., IllegalArgumentException from validateMutation), in which case all slots will be null and no retries are attempted. --- .../java/org/apache/hadoop/hbase/client/Table.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java index 907e3d1a7040..5616231fe5fc 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java @@ -114,9 +114,14 @@ default boolean[] exists(List gets) throws IOException { * Put had put. * @param actions list of Get, Put, Delete, Increment, Append, RowMutations. * @param results Empty Object[], same size as actions. Provides access to partial results, in - * case an exception is thrown. A null in the result array means that the call for - * that action failed, even after retries. The order of the objects in the results - * array corresponds to the order of actions in the request list. + * case an exception is thrown. On per-action failure after retries, the + * corresponding slot contains the Throwable (typically an IOException). On + * success, the slot contains a {@link Result} (possibly empty for a Get with no + * match, or empty for successful mutations). A null slot may appear if the entire + * batch was rejected before dispatch (for example, IllegalArgumentException from + * input validation), in which case all slots will be null. The order of the + * objects in the results array corresponds to the order of actions in the request + * list. * @since 0.90.0 */ default void batch(final List actions, final Object[] results)