Navigation Menu

Skip to content

Commit

Permalink
Add method to get dead nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jun 26, 2014
1 parent ad2342c commit 8a0a0e3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/droonga/engine_state.rb
Expand Up @@ -33,7 +33,7 @@ class EngineState
attr_reader :replier
attr_accessor :on_finish
attr_accessor :catalog
attr_accessor :live_nodes
attr_accessor :dead_nodes
def initialize(loop, name, internal_name)
@loop = loop
@name = name
Expand Down Expand Up @@ -110,6 +110,16 @@ def live_nodes
@live_nodes || @catalog.all_nodes
end

def live_nodes=(nodes)
@live_nodes = nodes
@dead_nodes = all_nodes - @live_nodes
@live_nodes
end

def dead_nodes
@dead_nodes || []
end

private
def log_tag
"engine_state"
Expand Down

0 comments on commit 8a0a0e3

Please sign in to comment.