Class: TestKafka::Zookeeper

Inherits:
Object
  • Object
show all
Defined in:
lib/test_kafka/zookeeper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kafka_path, tmp_dir, port) ⇒ Zookeeper

Returns a new instance of Zookeeper.



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

def initialize(kafka_path, tmp_dir, port)
  @port = port
  @jr = JavaRunner.new("zookeeper",
                       tmp_dir,
                       "org.apache.zookeeper.server.quorum.QuorumPeerMain",
                       port,
                       kafka_path,
                       "dataDir" => "#{tmp_dir}/zookeeper",
                       "clientPort" => port,
                       "maxClientCnxns" => 0)
end

Instance Attribute Details

#portObject (readonly)

Returns the value of attribute port.



17
18
19
# File 'lib/test_kafka/zookeeper.rb', line 17

def port
  @port
end

Instance Method Details

#pidObject



27
28
29
# File 'lib/test_kafka/zookeeper.rb', line 27

def pid
  @jr.pid
end

#startObject



19
20
21
# File 'lib/test_kafka/zookeeper.rb', line 19

def start
  @jr.start
end

#stopObject



23
24
25
# File 'lib/test_kafka/zookeeper.rb', line 23

def stop
  @jr.stop
end

#with_interruption(&block) ⇒ Object



31
32
33
# File 'lib/test_kafka/zookeeper.rb', line 31

def with_interruption(&block)
  @jr.with_interruption(&block)
end