本文整理汇总了Python中test.fixtures.ZookeeperFixture类的典型用法代码示例。如果您正苦于以下问题:Python ZookeeperFixture类的具体用法?Python ZookeeperFixture怎么用?Python ZookeeperFixture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ZookeeperFixture类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: zookeeper
def zookeeper(version, request):
assert version
zk = ZookeeperFixture.instance()
def fin():
zk.close()
request.addfinalizer(fin)
return zk
开发者ID:Abhishek-Dutta,项目名称:kafka-python,代码行数:7,代码来源:conftest.py
示例2: setUpClass
def setUpClass(cls):
if not os.environ.get('KAFKA_VERSION'):
return
cls.zk = ZookeeperFixture.instance()
cls.server1 = KafkaFixture.instance(0, cls.zk.host, cls.zk.port)
cls.server2 = KafkaFixture.instance(1, cls.zk.host, cls.zk.port)
cls.server = cls.server1 # Bootstrapping server
开发者ID:CrowdStrike,项目名称:kafka-python,代码行数:9,代码来源:test_consumer_integration.py
示例3: setUpClass
def setUpClass(cls):
if not os.environ.get('KAFKA_VERSION'):
return
cls.zk = ZookeeperFixture.instance()
chroot = random_string(10)
cls.server1 = KafkaFixture.instance(0, cls.zk,
zk_chroot=chroot)
cls.server2 = KafkaFixture.instance(1, cls.zk,
zk_chroot=chroot)
cls.server = cls.server1 # Bootstrapping server
开发者ID:dpkp,项目名称:kafka-python,代码行数:12,代码来源:test_consumer_integration.py
示例4: setUpClass
def setUpClass(cls): # noqa
if not os.environ.get('KAFKA_VERSION'):
return
zk_chroot = random_string(10)
replicas = 2
partitions = 2
# mini zookeeper, 2 kafka brokers
cls.zk = ZookeeperFixture.instance()
kk_args = [cls.zk.host, cls.zk.port, zk_chroot, replicas, partitions]
cls.brokers = [KafkaFixture.instance(i, *kk_args) for i in range(replicas)]
hosts = ['%s:%d' % (b.host, b.port) for b in cls.brokers]
cls.client = KafkaClient(hosts)
开发者ID:CrowdStrike,项目名称:kafka-python,代码行数:15,代码来源:test_failover_integration.py
示例5: setUp
def setUp(self):
if not os.environ.get('KAFKA_VERSION'):
self.skipTest('integration test requires KAFKA_VERSION')
zk_chroot = random_string(10)
replicas = 3
partitions = 3
# mini zookeeper, 3 kafka brokers
self.zk = ZookeeperFixture.instance()
kk_args = [self.zk.host, self.zk.port, zk_chroot, replicas, partitions]
self.brokers = [KafkaFixture.instance(i, *kk_args) for i in range(replicas)]
hosts = ['%s:%d' % (b.host, b.port) for b in self.brokers]
self.client = SimpleClient(hosts, timeout=2)
super(TestFailover, self).setUp()
开发者ID:sounos,项目名称:kafka-python,代码行数:16,代码来源:test_failover_integration.py
示例6: setUp
def setUp(self):
if not os.environ.get('KAFKA_VERSION'):
return
zk_chroot = random_string(10)
replicas = 2
partitions = 2
# mini zookeeper, 2 kafka brokers
self.zk = ZookeeperFixture.instance()
kk_args = [self.zk.host, self.zk.port, zk_chroot, replicas, partitions]
self.brokers = [KafkaFixture.instance(i, *kk_args) for i in range(replicas)]
hosts = ['%s:%d' % (b.host, b.port) for b in self.brokers]
self.client = KafkaClient(hosts)
super(TestFailover, self).setUp()
开发者ID:EricLau2018,项目名称:kafka-python,代码行数:16,代码来源:test_failover_integration.py
示例7: start_brokers
def start_brokers(n):
print('Starting {0} {1}-node cluster...'.format(KafkaFixture.kafka_version, n))
print('-> 1 Zookeeper')
zk = ZookeeperFixture.instance()
print('---> {0}:{1}'.format(zk.host, zk.port))
print()
partitions = min(n, 3)
replicas = min(n, 3)
print('-> {0} Brokers [{1} partitions / {2} replicas]'.format(n, partitions, replicas))
brokers = [
KafkaFixture.instance(i, zk.host, zk.port, zk_chroot='',
partitions=partitions, replicas=replicas)
for i in range(n)
]
for broker in brokers:
print('---> {0}:{1}'.format(broker.host, broker.port))
print()
return brokers
开发者ID:0ste00,项目名称:kafka-python,代码行数:19,代码来源:consumer_performance.py
示例8: setUpClass
def setUpClass(cls): # noqa
if not os.environ.get('KAFKA_VERSION'):
return
cls.zk = ZookeeperFixture.instance()
cls.server = KafkaFixture.instance(0, cls.zk.host, cls.zk.port)
开发者ID:Emor93,项目名称:kafka-python,代码行数:6,代码来源:test_client_integration.py
示例9: zookeeper
def zookeeper():
"""Return a Zookeeper fixture"""
zk_instance = ZookeeperFixture.instance()
yield zk_instance
zk_instance.close()
开发者ID:kngenie,项目名称:kafka-python,代码行数:5,代码来源:conftest.py
注:本文中的test.fixtures.ZookeeperFixture类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论