Class: TestKafka::Zookeeper
- Inherits:
-
Object
- Object
- TestKafka::Zookeeper
- Defined in:
- lib/test_kafka/zookeeper.rb
Instance Attribute Summary collapse
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(kafka_path, tmp_dir, port) ⇒ Zookeeper
constructor
A new instance of Zookeeper.
- #pid ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #with_interruption(&block) ⇒ Object
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
#port ⇒ Object (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
#pid ⇒ Object
27 28 29 |
# File 'lib/test_kafka/zookeeper.rb', line 27 def pid @jr.pid end |
#start ⇒ Object
19 20 21 |
# File 'lib/test_kafka/zookeeper.rb', line 19 def start @jr.start end |
#stop ⇒ Object
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 |