You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Shagun Agarwal <sh...@yahoo-inc.com> on 2012/08/23 11:19:54 UTC

HTable batch execution order

Hi,

I have a question about HTable.batch(List<? extends Row> actions,Object[] results) API, according to java doc -The ordering of execution of the actions is not defined. Meaning if you do a Put and a Get in the same batch call, you will not necessarily be guaranteed that the Get returns what the Put had put.
however my question is if I don't mix up the actions & only provide Get action, do I get the result in same order in which Get was provided.
e.g if I provide 3 Get with row keys [r1, r2, r3], will I get [result1, result2, result3]?

Thanks
Shagun Agarwal

Re: HTable batch execution order

Posted by Harsh J <ha...@cloudera.com>.
Hi Shagun,

The original ordering index is still maintained.

Yes you will have them back in order. Don't be confused by that
javadoc statement. The result list is ordered in the same way as the
actions list, but the "order" of which they are executed depends on
variable things, and hence the statement "The Get may not return what
the Put, in the same batch, had put".

On Thu, Aug 23, 2012 at 2:49 PM, Shagun Agarwal <sh...@yahoo-inc.com> wrote:
> Hi,
>
> I have a question about HTable.batch(List<? extends Row> actions,Object[] results) API, according to java doc -The ordering of execution of the actions is not defined. Meaning if you do a Put and a Get in the same batch call, you will not necessarily be guaranteed that the Get returns what the Put had put.
> however my question is if I don't mix up the actions & only provide Get action, do I get the result in same order in which Get was provided.
> e.g if I provide 3 Get with row keys [r1, r2, r3], will I get [result1, result2, result3]?
>
> Thanks
> Shagun Agarwal



-- 
Harsh J