Class: Fluent::RootAgent::SourceOnlyMode

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/root_agent.rb

Constant Summary collapse

DISABLED =
0
NORMAL =
1
ONLY_ZERO_DOWNTIME_RESTART_READY =
2

Instance Method Summary collapse

Constructor Details

#initialize(with_source_only, start_in_parallel) ⇒ SourceOnlyMode

Returns a new instance of SourceOnlyMode.



56
57
58
59
60
61
62
63
64
# File 'lib/fluent/root_agent.rb', line 56

def initialize(with_source_only, start_in_parallel)
  if start_in_parallel
    @mode = ONLY_ZERO_DOWNTIME_RESTART_READY
  elsif with_source_only
    @mode = NORMAL
  else
    @mode = DISABLED
  end
end

Instance Method Details

#disable!Object



74
75
76
# File 'lib/fluent/root_agent.rb', line 74

def disable!
  @mode = DISABLED
end

#enabled?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/fluent/root_agent.rb', line 66

def enabled?
  @mode != DISABLED
end

#only_zero_downtime_restart_ready?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/fluent/root_agent.rb', line 70

def only_zero_downtime_restart_ready?
  @mode == ONLY_ZERO_DOWNTIME_RESTART_READY
end