You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Fernando Machado <fm...@fmachado.com> on 2016/09/03 20:02:54 UTC

org.apache.hadoop.hbase.client Table#batch Javadoc clarification

Hi devs,

The current Javadoc definition for Table#batch does not mention the
possible objects that could be sent back as elements of the Object[]
parameter.

https://git-wip-us.apache.org/repos/asf?p=hbase.git;a=blob;f=hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java;h=4d93442ea6f3f97ea293ff507ae2b256cebd3a3c;hb=refs/heads/master#l106

I would like to submit a patch to improve the documentation but I want
to confirm with you guys the possible elements that I can have as
result:
1) null;
2) an instance of Throwable;
3) an instance of
org.apache.hadoop.hbase.client.AsyncProcess.ReplicaResultState.

Am I missing something?

The current Javadoc for the batch method says "A null in the result
array means that the call for that action failed, even after retries"
but I found also "Null if results are not needed":

https://git-wip-us.apache.org/repos/asf?p=hbase.git;a=blob;f=hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java;h=5bb0f5839871fb1fe22d316aa9923f35f4197904;hb=refs/heads/master#l836

I could not confirm the later behaviour mentioned before. Should I
open a ticket to clarify this issue?

Thanks!

Fernando Machado

Re: org.apache.hadoop.hbase.client Table#batch Javadoc clarification

Posted by Ted Yu <yu...@gmail.com>.
For the last point, please take a look at
AsyncProcess#createAsyncRequestFuture()

  protected <CResult> AsyncRequestFutureImpl<CResult>
createAsyncRequestFuture(

      TableName tableName, List<Action<Row>> actions, long nonceGroup,
ExecutorService pool,

      Batch.Callback<CResult> callback, Object[] results, boolean
needResults,

      CancellableRegionServerCallable callable, int curTimeout) {

The 3rd last parameter.

Improvement to javadoc is welcome.

On Sat, Sep 3, 2016 at 1:02 PM, Fernando Machado <fm...@fmachado.com> wrote:

> Hi devs,
>
> The current Javadoc definition for Table#batch does not mention the
> possible objects that could be sent back as elements of the Object[]
> parameter.
>
> https://git-wip-us.apache.org/repos/asf?p=hbase.git;a=blob;
> f=hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java;h=
> 4d93442ea6f3f97ea293ff507ae2b256cebd3a3c;hb=refs/heads/master#l106
>
> I would like to submit a patch to improve the documentation but I want
> to confirm with you guys the possible elements that I can have as
> result:
> 1) null;
> 2) an instance of Throwable;
> 3) an instance of
> org.apache.hadoop.hbase.client.AsyncProcess.ReplicaResultState.
>
> Am I missing something?
>
> The current Javadoc for the batch method says "A null in the result
> array means that the call for that action failed, even after retries"
> but I found also "Null if results are not needed":
>
> https://git-wip-us.apache.org/repos/asf?p=hbase.git;a=blob;
> f=hbase-client/src/main/java/org/apache/hadoop/hbase/
> client/AsyncProcess.java;h=5bb0f5839871fb1fe22d316aa9923f
> 35f4197904;hb=refs/heads/master#l836
>
> I could not confirm the later behaviour mentioned before. Should I
> open a ticket to clarify this issue?
>
> Thanks!
>
> Fernando Machado
>