With the Cloud Bigtable HBase client for Java, both of these methods can throw
aRetriesExhaustedWithDetailsException. This exception is thrown
when one or more of the batch operations fail for any reason (for example,
because the connection failed). It contains a list of failed requests, along
with details about the exception that caused each request to fail.
By itself, aRetriesExhaustedWithDetailsExceptiondoes not tell you why a
request failed. You must callRetriesExhaustedWithDetailsException#getCauses()to retrieve the
detailed exceptions for each failed request. You can then log information about
each of the detailed exceptions, which will help you diagnose the failure:
try {
mutator.mutate(mutationList);
} catch (RetriesExhaustedWithDetailsException e) {
for (Throwable cause : e.getCauses()) {
cause.printStackTrace();
}
throw e;
}
An exception can also be thrown when you callflushorclose.
The same error handling applies.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe HBase API allows batch operations through \u003ccode\u003eTable#batch\u003c/code\u003e and \u003ccode\u003eBufferedMutator#mutate\u003c/code\u003e, both of which can throw a \u003ccode\u003eRetriesExhaustedWithDetailsException\u003c/code\u003e if one or more operations fail.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eRetriesExhaustedWithDetailsException\u003c/code\u003e alone doesn't specify the cause of failure; \u003ccode\u003eRetriesExhaustedWithDetailsException#getCauses()\u003c/code\u003e must be called to retrieve detailed exceptions for each failed request.\u003c/p\u003e\n"],["\u003cp\u003eExceptions during batch operations can be handled by iterating through the detailed exceptions provided by \u003ccode\u003egetCauses()\u003c/code\u003e to diagnose the failure.\u003c/p\u003e\n"],["\u003cp\u003eThe same exception handling process applies to errors that occur when calling \u003ccode\u003eflush\u003c/code\u003e or \u003ccode\u003eclose\u003c/code\u003e methods in batch operations.\u003c/p\u003e\n"]]],[],null,["Handle batch exceptions\n\nThe HBase API provides two ways to send multiple operations as a batch:\n\n- [`Table#batch(List, Object[])`](https://hbase.apache.org/2.5/apidocs/org/apache/hadoop/hbase/client/Table.html#batch-java.util.List-java.lang.Object:A-) combines multiple gets and mutations into a single batch.\n- [`BufferedMutator#mutate(List\u003c? extends Mutation\u003e mutations)`](https://hbase.apache.org/2.5/apidocs/org/apache/hadoop/hbase/client/BufferedMutator.html#mutate-java.util.List-) combines multiple mutations into a batch or series of batches.\n\nWith the Cloud Bigtable HBase client for Java, both of these methods can throw\na [`RetriesExhaustedWithDetailsException`](https://hbase.apache.org/2.5/apidocs/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.html). This exception is thrown\nwhen one or more of the batch operations fail for any reason (for example,\nbecause the connection failed). It contains a list of failed requests, along\nwith details about the exception that caused each request to fail.\n\nBy itself, a `RetriesExhaustedWithDetailsException` does not tell you why a\nrequest failed. You must call\n[`RetriesExhaustedWithDetailsException#getCauses()`](https://hbase.apache.org/2.5/apidocs/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.html#getCauses--) to retrieve the\ndetailed exceptions for each failed request. You can then log information about\neach of the detailed exceptions, which will help you diagnose the failure: \n\n try {\n mutator.mutate(mutationList);\n } catch (RetriesExhaustedWithDetailsException e) {\n for (Throwable cause : e.getCauses()) {\n cause.printStackTrace();\n }\n throw e;\n }\n\nAn exception can also be thrown when you call\n[`flush`](https://hbase.apache.org/2.5/devapidocs/org/apache/hadoop/hbase/procedure/flush/package-summary.html)\nor [`close`](https://hbase.apache.org/2.5/apidocs/org/apache/hadoop/hbase/client/Connection.html#close--).\nThe same error handling applies."]]