Method: Sip::Sipper#initialize

Defined in:
lib/sip/sipper.rb

#initialize(config) ⇒ Sipper

Returns a new instance of Sipper.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/sip/sipper.rb', line 5

def initialize(config)
  @config = config
  slavefile = File.join(ENV['HADOOP_HOME'], 'conf', 'slaves')
  log "Reading slaves from file #{slavefile}..."
  begin
    open(slavefile, 'r') { |f| @slaves = f.read.split("\n") }
  rescue
    raise HadoopException, "Could not read \"#{slavefile}\".  Is your HADOOP_HOME environment variable correct?"
  end
  Utils::sanity_check(@config)
end