Class: BigRecordDriver::DriverManager

Inherits:
Object
  • Object
show all
Defined in:
lib/big_record_driver/driver_manager.rb

Class Method Summary collapse

Class Method Details

.restart(port = 40005) ⇒ Object



14
15
16
# File 'lib/big_record_driver/driver_manager.rb', line 14

def restart(port = 40005)
  `ruby #{@@CMD} restart -p #{port.to_s}`
end

.running?(port = 40005) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
# File 'lib/big_record_driver/driver_manager.rb', line 22

def running?(port = 40005)
  status = `ruby #{@@CMD} status -p #{port.to_s}`
  status == "Running.\n"
end

.set_cmd(db = 'hbase') ⇒ Object



6
7
8
# File 'lib/big_record_driver/driver_manager.rb', line 6

def set_cmd(db = 'hbase')
  @@CMD = File.dirname(__FILE__) + "/../../bin/#{db}-driver"
end

.silent_start(port = 40005) ⇒ Object



27
28
29
# File 'lib/big_record_driver/driver_manager.rb', line 27

def silent_start(port = 40005)
  start(port) unless running?(port)
end

.start(port = 40005) ⇒ Object



10
11
12
# File 'lib/big_record_driver/driver_manager.rb', line 10

def start(port = 40005)
  `ruby #{@@CMD} start -p #{port.to_s}`
end

.stop(port = 40005) ⇒ Object



18
19
20
# File 'lib/big_record_driver/driver_manager.rb', line 18

def stop(port = 40005)
  `ruby #{@@CMD} stop -p #{port.to_s}`
end