Sha256: f2aebf6066060e65c2ff6e5e4f4e64f43eb9dc118d6bbda919f017de8769aa31

Contents?: true

Size: 607 Bytes

Versions: 7

Compression:

Stored size: 607 Bytes

Contents

require 'riak'

nodes = [{ :host => "127.0.0.1",
           :pb_port => 8087 }]


c = Riak::Client.new( :nodes => nodes, :protocol => "pbc" )
#c.list_buckets
b = c.bucket("fluentlog")

def put(bucket)
  o = Riak::RObject.new(bucket, "hoge")
  o.content_type = "text/plain"
  o.raw_data = "hogehoge"
  o.store
end

def get(bucket)
  o = bucket.get("hoge")
  p o.content_type
  p o.raw_data
end

def keys(bucket)
  bucket.keys { |ks|
    ks.each { |k|
      o = bucket.get(k)
      print "#{o.bucket.name}/#{o.key} (#{o.content_type})\n"
      print " =>  #{o.raw_data}\n"
    }
  }
end

#put b
#get b
keys b

Version data entries

7 entries across 7 versions & 4 rubygems

Version Path
fluent-plugin-riak2f-0.0.2 listkeys.rb
fluent-plugin-riak2f-0.0.1 listkeys.rb
fluent-plugin-riak2-0.0.5 listkeys.rb
fluent-plugin-riak2-0.0.4 listkeys.rb
fluent-plugin-chriak2-0.0.7 listkeys.rb
fluent-plugin-riak-0.0.3 listkeys.rb
fluent-plugin-riak-0.0.2 listkeys.rb