Class: Droonga::Catalog::Slice

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/catalog/slice.rb

Instance Method Summary collapse

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_nodesObject



40
41
42
# File 'lib/droonga/catalog/slice.rb', line 40

def all_nodes
  @all_nodes ||= volume.all_nodes
end

#boundaryObject



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(message, active_nodes)
  volume.compute_routes(message, active_nodes)
end

#labelObject



28
29
30
# File 'lib/droonga/catalog/slice.rb', line 28

def label
  @raw["label"]
end

#volumeObject



36
37
38
# File 'lib/droonga/catalog/slice.rb', line 36

def volume
  @volume ||= Catalog::Volume.create(@dataset, @raw["volume"])
end

#weightObject



24
25
26
# File 'lib/droonga/catalog/slice.rb', line 24

def weight
  @raw["weight"] || 1
end