Class: Droonga::Catalog::Slice
- Inherits:
-
Object
- Object
- Droonga::Catalog::Slice
- Defined in:
- lib/droonga/catalog/slice.rb
Instance Method Summary collapse
- #all_nodes ⇒ Object
- #boundary ⇒ Object
- #compute_routes(message, active_nodes) ⇒ Object
-
#initialize(dataset, raw) ⇒ Slice
constructor
A new instance of Slice.
- #label ⇒ Object
- #volume ⇒ Object
- #weight ⇒ Object
Constructor Details
#initialize(dataset, raw) ⇒ Slice
Returns a new instance of Slice.
19 20 21 22 |
# File 'lib/droonga/catalog/slice.rb', line 19 def initialize(dataset, raw) @dataset = dataset @raw = raw end |
Instance Method Details
#all_nodes ⇒ Object
40 41 42 |
# File 'lib/droonga/catalog/slice.rb', line 40 def all_nodes @all_nodes ||= volume.all_nodes end |
#boundary ⇒ Object
32 33 34 |
# File 'lib/droonga/catalog/slice.rb', line 32 def boundary @raw["boundary"] end |
#compute_routes(message, active_nodes) ⇒ Object
44 45 46 |
# File 'lib/droonga/catalog/slice.rb', line 44 def compute_routes(, active_nodes) volume.compute_routes(, active_nodes) end |
#label ⇒ Object
28 29 30 |
# File 'lib/droonga/catalog/slice.rb', line 28 def label @raw["label"] end |
#volume ⇒ Object
36 37 38 |
# File 'lib/droonga/catalog/slice.rb', line 36 def volume @volume ||= Catalog::Volume.create(@dataset, @raw["volume"]) end |
#weight ⇒ Object
24 25 26 |
# File 'lib/droonga/catalog/slice.rb', line 24 def weight @raw["weight"] || 1 end |