Com o cliente HBase do Cloud Bigtable para Java, esses dois métodos podem gerar um RetriesExhaustedWithDetailsException. Essa exceção é lançada quando uma ou mais das operações em lote falham por qualquer motivo (por exemplo, por causa de uma falha na conexão). Ela contém uma lista das solicitações com falha, além de detalhes sobre a exceção que causou a falha em cada solicitação.
Por si só, um RetriesExhaustedWithDetailsException não informa por que uma solicitação falhou. Você precisa chamar RetriesExhaustedWithDetailsException#getCauses() para recuperar as exceções detalhadas de cada solicitação com falha. Em seguida, você pode registrar informações sobre cada uma das exceções detalhadas, o que ajudará a diagnosticar a falha:
try {
mutator.mutate(mutationList);
} catch (RetriesExhaustedWithDetailsException e) {
for (Throwable cause : e.getCauses()) {
cause.printStackTrace();
}
throw e;
}
Uma exceção também pode ser gerada quando você chama
flush
ou close.
O mesmo tratamento de erros se aplica.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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."]]