hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JinChao Wen <wenjinchao0...@gmail.com>
Subject Re: How the batch operations are implemented in HBase?
Date Tue, 01 Feb 2011 00:48:06 GMT
as far as i know, there is no concept of transaction in hbase.

you can do this.

try{
htable1.put( putList1);
htable2.put( putList2)
}
catch(IOException ioe )
{
   //rollback by yourself
}
catch(Exception e)
{
    // do something
}
finally{
   // return resource
}




2011/1/31 Jim X <jim.pxie@gmail.com>

> For one table, I can implement it like:
>   HTable htable = ...;
>   List<Put> list = getPuts();
>   htable.setAutoFlush(true);
>   htable.put(list);
>   htable.flushCommits();
>
> If my batch comes across multiple tables, how do I implement it in one
> transaction?
>
> Jim
>
> On Sun, Jan 30, 2011 at 11:33 PM, Jim X <jim.pxie@gmail.com> wrote:
> > Thanks. Yes. This is what I want to know.
> >
> > On Sun, Jan 30, 2011 at 11:10 PM, JinChao Wen <wenjinchao0418@gmail.com>
> wrote:
> >> see htable.put(List<Put> put)
> >>
> >> if you set autoFlush=true, or number of puts you add to htable is exceed
> the
> >> writeBufferSize of htable.
> >> The puts will be flushed.
> >>
> >>
> >>
> >> 2011/1/31 Jim X <jim.pxie@gmail.com>
> >>
> >>> Hi, HBase users,
> >>>
> >>>     JDBC provides batch operation API. I am assigned to convert a
> >>> JDBC batch implementation into HBase. Does HBase provide some APIs
> >>> like PreparedStatement.addBatch() in JDBC? How do I implement HBase
> >>> batch process in one transaction?
> >>>
> >>>
> >>> Jim
> >>>
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message