You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Lars Hofhansl (JIRA)" <ji...@apache.org> on 2013/03/14 23:40:13 UTC

[jira] [Commented] (HBASE-8112) Deprecate HTable#batch(final List)

    [ https://issues.apache.org/jira/browse/HBASE-8112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13602851#comment-13602851 ] 

Lars Hofhansl commented on HBASE-8112:
--------------------------------------

Why not fix it instead? We can catch exceptions in {{HTable#batch(final List<? extends Row>\)}} and return the results so far.

(sorry didn't mean to change the description)
                
> Deprecate HTable#batch(final List<? extends Row>)
> -------------------------------------------------
>
>                 Key: HBASE-8112
>                 URL: https://issues.apache.org/jira/browse/HBASE-8112
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> This was brought up by Amit's inquiry on mailing list, entitled 'Batch returned value and exception handling'
> Here is his sample code:
> {code}
> Object[] res = null;
> try {
>   res = table.batch(batch);
> } catch (RetriesExhaustedWithDetailsException retriesExhaustedWithDetailsException) {
>   retriesExhaustedWithDetailsException.printStackTrace();
> }
> if (res == null) {
>   System.out.println("No results - returned null.");
> }
> {code}
> When RetriesExhaustedWithDetailsException was thrown from batch() call, variable res carried value of null.
> Meaning user wouldn't get partial result along with the exception.
> We should deprecate {{HTable#batch(final List<? extends Row>)}} and refer to the following method:
> void batch(final List<?extends Row> actions, final Object[] results) throws IOException, InterruptedException;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira