如何运行hbase示例数据脚本“index-builder-setup.rb”?

时间:2012-06-08 10:09:24

标签: ruby mapreduce hbase

  

HBase的-0.94.0 / SRC /示例/映射精简/索引助洗剂-的setup.rb   当我运行脚本时,它报告错误:   [zhouhh @ Hadoop48 mapreduce] $ ruby​​ index-builder-setup.rb   index-builder-setup.rb:18:未定义的方法`create'for main:Object(NoMethodError)   索引生成器-的setup.rb:

# Set up sample data for IndexBuilder example
create "people", "attributes"
create "people-email", "INDEX"
create "people-phone", "INDEX"
create "people-name", "INDEX"

[["1", "jenny", "jenny@example.com", "867-5309"],
 ["2", "alice", "alice@example.com", "555-1234"],
 ["3", "kevin", "kevinpet@example.com", "555-1212"]].each do |fields|
  (id, name, email, phone) = *fields
  put "people", id, "attributes:name", name
  put "people", id, "attributes:email", email
  put "people", id, "attributes:phone", phone
end

1 个答案:

答案 0 :(得分:3)

我们不应该使用ruby,因为它不知道什么是hbase。

对于你的情况,试试这个:

./bin/hbase shell /path-to-your-hbase-dir/src/examples/mapreduce/index-builder-setup.rb