Class: Seaweed::Master
- Inherits:
-
Object
- Object
- Seaweed::Master
- Defined in:
- lib/seaweed/master.rb
Class Method Summary collapse
- .connect(host: "localhost", port: 9333) ⇒ Object
- .dir_assign! ⇒ Object
- .dir_lookup(volume_id) ⇒ Object
- .status ⇒ Object
- .vaccum!(threshold: 0.3) ⇒ Object
Class Method Details
.connect(host: "localhost", port: 9333) ⇒ Object
4 5 6 |
# File 'lib/seaweed/master.rb', line 4 def connect(host: "localhost", port: 9333) @base_url = "http://#{host}:#{port}" end |
.dir_assign! ⇒ Object
13 14 15 16 |
# 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) ⇒ Object
18 19 20 21 |
# 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 |