2012-06-08 41 views
0

hbase-0.94.0/src/examples/mapreduce/index-builder-setup.rb when i run the script,it reports error: [[email protected] mapreduce]$ ruby index-builder-setup.rb index-builder-setup.rb:18: undefined method `create' for main:Object (NoMethodError) index-builder-setup.rb:如何運行hbase示例數據腳本「index-builder-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", "[email protected]", "867-5309"], 
["2", "alice", "[email protected]", "555-1234"], 
["3", "kevin", "[email protected]", "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 
+0

我已經找到答案,請參考我的博客,但你可以使用谷歌翻譯:http://abloz.com/2012/07/03 /the-hbase-how-implementation-of-the-ruby-script.html – user1095131

+0

在這裏包含一個簡短的解決方案摘要將很好,以防止鏈接腐爛。 – razlebe

+0

@ user1095131,您指定的鏈接已死亡。 –

回答

3

我們不應該用紅寶石對於這一點,因爲它不知道什麼是HBase的。

對於你的情況下,試試這個:

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