class Seaweed::Master

Public Class Methods

connect(host: "localhost", port: 9333) click to toggle source
# File lib/seaweed/master.rb, line 4
def connect(host: "localhost", port: 9333)
  @base_url = "http://#{host}:#{port}"
end
dir_assign!() click to toggle source
# File lib/seaweed/master.rb, line 13
def dir_assign!
  res = Seaweed::HTTP.post "#{@base_url}/dir/assign", {}
  Seaweed::HTTP.parse res
end
dir_lookup(volume_id) click to toggle source
# File lib/seaweed/master.rb, line 18
def dir_lookup(volume_id)
  res = Seaweed::HTTP.get "#{@base_url}/dir/lookup?volumeId=#{volume_id}"
  Seaweed::HTTP.parse(res)[:locations][0]
end
status() click to toggle source
# File lib/seaweed/master.rb, line 8
def status
  res = Seaweed::HTTP.get "#{@base_url}/cluster/status?pretty=y"
  Seaweed::HTTP.parse res
end
vaccum!(threshold: 0.3) click to toggle source
# File lib/seaweed/master.rb, line 23
def vaccum!(threshold: 0.3)
  res = Seaweed::HTTP.get "#{@base_url}/vol/vaccum?garbageThreshold=#{threshold}"
  Seaweed::HTTP.parse res
end