行锁定HBase单行事务支持 [英] Row Locking in HBase single row transaction support

查看:379
本文介绍了行锁定HBase单行事务支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HBase中,为了提供单行事务支持,它使用Row Locking Concept。假设,例如

Put p = new Put(/ * Row Key * /); 将锁定该行。



这样,直到我们完成


表。 (p)

锁定不会被释放。



所以,如果我开始一个新的放置,即


放置p1 = new Put(/ Row Key );

p1 put不应该工作,因为该行已经被锁定,但在HBase 0.94中,当我尝试它的工作。

关于行锁链接我曾经见过关于行锁的问题在我的理解中是否有任何错误。如果不是单行事务支持如何与外部行锁定一起工作的话。HBase的工作方式是锁定在region应用程序(不在客户端),当应用Puts以确保行被写入原子块但它不提供快照隔离(如果需要,您需要使用 omid )。假设你的两个put不是从同一个客户端发送的(在这种情况下,它们可能是同一事务的一部分),除非HBase会崩溃或发生超时(比如说因为压缩)在投入之间的某处。您将两个投入将在HBase中连续应用,具体取决于他们到达的顺序。

In HBase, For providing single row transaction support it uses Row Locking Concept. Suppose, for example

Put p=new Put("/*Row Key*/"); This statement will lock the row.

so, until we complete the

table.put(p)

the lock won't gets released.

So, in between if i start a new put i.e

Put p1=new Put("/Row Key");

the p1 put should not work since the row has already been locked but in HBase 0.94 when i tried it's working.

Regarding Row Lock Link Where i had seen about Row Lock Is there any thing wrong in my understanding. If not how single row transaction support is working with out row locking.

解决方案

The way HBase works is that locks are held in the regionserver (not in the client) when the Puts are applied to make sure that rows are written in an atomic block but it does not provide snapshot isolation (you need to use something like omid if you want that).

Assuming your two puts are not sent from the same client (in which case they may be part of the same transaction) and unless HBase will crash or a timeout occur (say because of compaction) somewhere between the the puts. You're two puts will just be applied serially in the HBase depending on the order they arrived.

这篇关于行锁定HBase单行事务支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆