Hbase节俭CDH 5 [英] Hbase Thrift in CDH 5

查看:124
本文介绍了Hbase节俭CDH 5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Node.js Thrift API连接到Hbase。一切工作都很好,直到我将CDH 4.6升级到CDH 5。升级后,我用这个脚本重新生成了Node.js的Thrift API:

  thrift --gen js:node /opt/cloudera/parcels/CDH-5.0.0-1.cdh5.0.0.p0.47/lib/hbase/include/thrift/hbase2.thrift 

用新生成的脚本替换原始Node.js脚本后,所有内容都停止工作。

您可以查看演示中的新脚本和基本方法,我试图运行 https://github.com/lgrcyanny/Node-HBase-Thrift2



当我运行'get'方法,它返回Internal error processing get。



当我运行'put'方法时,它返回无效方法名称:'put' 。

好像新的Thrift API完全不兼容?我在这里丢失了什么?

解决方案

有两个Thrift IDL文件随HBase提供:





两者都有一个 get()方法,但其中只有一个方法具有 put()这正是你上面告诉我们的错误信息。



引自软件包摘要页面:




HBase中有2个节点服务器实现,即
包:


  • org.apache.hadoop.hbase.thrift:这可能有一天被
    标记为depreceated。


  • org.apache.hadoop.hbase.thrift2:即这个
    包。这是为了与HTable接口紧密匹配,并且
    有一天会取代较旧的节点(旧的节俭模拟API
    HBase不再有)。


另外,安装指南中有一个单独的部分:


HBase兼容


CDH 5 HBase不与
连线兼容CDH 4 [...]。因此,从CDH 4到CDH 5的
滚动升级是不可能的,因为现有的
CDH 4 HBase客户端无法向CDH 5服务器发出请求,而CDH 5
HBase客户端无法向CDH 4服务器发出请求。然而,
Thrift和REST代理服务器的客户端仍然保留CDH 4和CDH 5之间的线路兼容性
。[...] HBase用户API(Get,Put,Result,Scanner等;请参阅Apache HBase
API文档)已经发展并已尝试使
确保HBase客户端与源代码兼容,因此应该为
重新编译,无需修改任何源代码。这不能保证
,但是,由于转换到ProtoBufs,一些
相对晦涩的API已被删除。为了保持与高级API
(例如Filters和Coprocessors)的重新编译兼容性,还做了一些基本的努力。这些高级API仍在不断发展,我们对API兼容性的保证在这里变得更弱。



I'm using Node.js Thrift API to connect to Hbase. Everything was working great until I upgraded CDH 4.6 to CDH 5. After upgrading I regenerated the Thrift API for Node.js with this script:

thrift --gen js:node /opt/cloudera/parcels/CDH-5.0.0-1.cdh5.0.0.p0.47/lib/hbase/include/thrift/hbase2.thrift

After replacing the original Node.js script with the newly generated script, everything stopped working.

You can view the new script and the basic methods in the demo that I'm trying to run on https://github.com/lgrcyanny/Node-HBase-Thrift2

When I run the 'get' method, it returns "Internal error processing get".

When I run the 'put' method, it returns "Invalid method name: 'put'".

It seems like the new Thrift API is completely incompatible? Am I missing anything here?

解决方案

There are two Thrift IDL files that come with HBase:

Both have a get() method, but only one of them has a put() method, which is exactly what your error messages above are telling us.

Cited from the package summary page:

There are currently 2 thrift server implementations in HBase, the packages:

  • org.apache.hadoop.hbase.thrift: This may one day be marked as depreceated.

  • org.apache.hadoop.hbase.thrift2: i.e. this package. This is intended to closely match to the HTable interface and to one day supercede the older thrift (the old thrift mimics an API HBase no longer has).

Also the install guides have a separate section for that scenario:

CDH 5 HBase Compatibility

CDH 5 HBase is [...] not wire compatible with CDH 4 [...]. Consequently, rolling upgrades from CDH 4 to CDH 5 are not possible because existing CDH 4 HBase clients cannot make requests to CDH 5 servers and CDH 5 HBase clients cannot make requests to CDH 4 servers. Clients of the Thrift and REST proxy servers, however, retain wire compatibility between CDH 4 and CDH 5. [...]

The HBase User API (Get, Put, Result, Scanner etc; see Apache HBase API documentation) has evolved and attempts have been made to make sure the HBase Clients are source code compatible and thus should recompile without needing any source code modifications. This cannot be guaranteed however, since with the conversion to ProtoBufs, some relatively obscure APIs have been removed. Rudimentary efforts have also been made to preserve recompile compatibility with advanced APIs such as Filters and Coprocessors. These advanced APIs are still evolving and our guarantees for API compatibility are weaker here.

这篇关于Hbase节俭CDH 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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