def step_impl3(context): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: current_config = zk.get_topic_config(context.topic) current_config['config']['max.message.bytes'] = '1000' zk.set_topic_config(context.topic, value=current_config) time.sleep(2) # sleeping for 2 seconds to ensure config is actually picked up
def step_impl5(context): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: offsets = zk.get_group_offsets(context.group) new_offsets = zk.get_group_offsets(NEW_GROUP) assert context.topic in offsets assert new_offsets == offsets
def fetch_offsets(group, topics): # Setup the Kafka client config = get_cluster_config() client = KafkaToolClient(config.broker_list) offsets = get_current_consumer_offsets(client, group, topics, False) client.close() return offsets
def step_impl3(context): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: current_config = zk.get_topic_config(context.topic) current_config['config']['max.message.bytes'] = '1000' zk.set_topic_config(context.topic, value=current_config) time.sleep( 2) # sleeping for 2 seconds to ensure config is actually picked up
def step_impl5(context): config = get_cluster_config() context.client = KafkaToolClient(config.broker_list) offsets = get_current_consumer_offsets( context.client, context.group, [context.topic], ) assert offsets[context.topic][0] == 0
def step_impl3(context): config = get_cluster_config() context.client = KafkaToolClient(config.broker_list) offsets = get_current_consumer_offsets( context.client, context.group, [context.topic], ) assert offsets[context.topic][0] == SET_OFFSET_KAFKA
def commit_offsets(offsets, group): # Setup the Kafka client config = get_cluster_config() client = KafkaToolClient(config.broker_list) set_consumer_offsets( client, group, offsets, ) client.close()
def set_min_isr(topic, min_isr): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: config = zk.get_topic_config(topic) config['config'] = {ISR_CONF_NAME: str(min_isr)} zk.set_topic_config(topic, config)
def step_impl4(context): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: offsets = zk.get_group_offsets(context.group) assert offsets[context.topic]["0"] == RESTORED_OFFSET context.offsets_file.close()
def step_impl3(context): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: offsets = zk.get_group_offsets(context.group) assert offsets[context.topic]["0"] == SET_OFFSET
def step_impl4(context): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: offsets = zk.get_group_offsets(context.group) assert context.topic not in offsets
def step_impl4(context): cluster_config = get_cluster_config() with ZK(cluster_config) as zk: offsets = zk.get_group_offsets(context.group) assert offsets[context.topic]["0"] == context.msgs_produced