Class: TestKafka::Cluster
- Inherits:
-
Object
- Object
- TestKafka::Cluster
- Defined in:
- lib/test_kafka/cluster.rb
Instance Attribute Summary collapse
-
#broker ⇒ Object
readonly
Returns the value of attribute broker.
-
#zookeeper ⇒ Object
readonly
Returns the value of attribute zookeeper.
Instance Method Summary collapse
-
#initialize(kafka_path, tmp_dir, kafka_port, zk_port) ⇒ Cluster
constructor
A new instance of Cluster.
- #start ⇒ Object
- #stop ⇒ Object
- #with_interruption(&block) ⇒ Object
Constructor Details
#initialize(kafka_path, tmp_dir, kafka_port, zk_port) ⇒ Cluster
Returns a new instance of Cluster.
6 7 8 9 |
# File 'lib/test_kafka/cluster.rb', line 6 def initialize(kafka_path, tmp_dir, kafka_port, zk_port) @zookeeper = Zookeeper.new(kafka_path, tmp_dir, zk_port) @broker = Broker.new(kafka_path, tmp_dir, kafka_port, zk_port) end |
Instance Attribute Details
#broker ⇒ Object (readonly)
Returns the value of attribute broker.
11 12 13 |
# File 'lib/test_kafka/cluster.rb', line 11 def broker @broker end |
#zookeeper ⇒ Object (readonly)
Returns the value of attribute zookeeper.
11 12 13 |
# File 'lib/test_kafka/cluster.rb', line 11 def zookeeper @zookeeper end |
Instance Method Details
#start ⇒ Object
13 14 15 16 17 18 |
# File 'lib/test_kafka/cluster.rb', line 13 def start @zookeeper.start @broker.start self end |
#stop ⇒ Object
20 21 22 23 24 25 |
# File 'lib/test_kafka/cluster.rb', line 20 def stop @zookeeper.stop @broker.stop self end |
#with_interruption(&block) ⇒ Object
27 28 29 |
# File 'lib/test_kafka/cluster.rb', line 27 def with_interruption(&block) @broker.with_interruption(&block) end |