Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'cassandra'
- include Cassandra::Constants
- client = Cassandra.new('Keyspace1', '127.0.0.1:9160')
- client.batch do
- client.insert(:Standard1, '001', { 'first' => 'shin', 'last' => 'akiyama', 'age' => '31' })
- client.insert(:Standard1, '002', { 'first' => 'foo', 'last' => 'bar', 'age' => '20' })
- client.insert(:Standard1, '003', { 'first' => 'hoge', 'last' => 'fuga', 'age' => '15' })
- end
- # 追加したデータを取得してみる
- client.get_range(:Standard1).each { |obj|
- p "Key : #{obj.key}"
- obj.columns.each { |col|
- p col
- }
- }
Add Comment
Please, Sign In to add comment