Parent

Class/Module Index [+]

Quicksearch

OpenShift::Runtime::WatchmanPlugin

@abstract Subclass for Watchman plugins. Override {apply} to implement your plugin @api watchman plugin

There are two helper methods provided, for your use:

{#restart} to start/restart a gear, and
{#stop} to shutdown the gear's cartridge's daemons

@!attribute [r] logger

@return [NodeLogger] logger instance being used

@!attribute [r] config

@return [Config] elements from node.conf

@!attribute [r] gears

@return [CachedGears] collection of running gears on node

Attributes

config[R]
gears[R]
logger[R]

Public Class Methods

new(config, logger, gears, operation) click to toggle source

@param [CachedConfig] config Cached elements from node.conf @param [NodeLogger] logger Logger for items that are not required to be in Syslog @param [CachedGears] gears Cached list of running gears @param [lambda<Symbol, String>] operation lambda passed an operation and gear's uuid to be acted upon.

Supported operations: `:restart`, `:stop` or `:idle`
# File lib/openshift-origin-node/model/watchman/watchman_plugin.rb, line 65
def initialize(config, logger, gears, operation)
  @config, @logger, @gears, @operation = config, logger, gears, operation
end

Public Instance Methods

apply(iteration) click to toggle source

Execute plugin code @param [Iteration] iteration provides timestamps of events @return void

# File lib/openshift-origin-node/model/watchman/watchman_plugin.rb, line 72
def apply(iteration)
end
idle(uuid) click to toggle source

Execute idle on gear

@param [String] uuid of gear to idle @return void

# File lib/openshift-origin-node/model/watchman/watchman_plugin.rb, line 95
def idle(uuid)
  @operation.call(:idle, uuid)
end
restart(uuid) click to toggle source

Execute restart on gear @param [String] uuid of gear to restart @return void

# File lib/openshift-origin-node/model/watchman/watchman_plugin.rb, line 78
def restart(uuid)
  @operation.call(:restart, uuid)
end
stop(uuid) click to toggle source

Execute stop on gear

@note {stop} attempts to only kill cartridge daemons, not login shells, ssh sessions etc. @param [String] uuid of gear to stop @return void

# File lib/openshift-origin-node/model/watchman/watchman_plugin.rb, line 87
def stop(uuid)
  @operation.call(:stop, uuid)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.