You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by sh...@apache.org on 2019/11/27 01:15:50 UTC
[samza] branch master updated: SAMZA-2403: fix standalone
integration failure (#1225)
This is an automated email from the ASF dual-hosted git repository.
shanthoosh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza.git
The following commit(s) were added to refs/heads/master by this push:
new bad38b8 SAMZA-2403: fix standalone integration failure (#1225)
bad38b8 is described below
commit bad38b8f54d673bfa27dd784b43942c25545764b
Author: Hai Lu <ha...@linkedin.com>
AuthorDate: Tue Nov 26 17:15:44 2019 -0800
SAMZA-2403: fix standalone integration failure (#1225)
---
samza-test/src/main/python/tests/zk_client.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/samza-test/src/main/python/tests/zk_client.py b/samza-test/src/main/python/tests/zk_client.py
index f5716e4..a1cf525 100644
--- a/samza-test/src/main/python/tests/zk_client.py
+++ b/samza-test/src/main/python/tests/zk_client.py
@@ -31,7 +31,7 @@ class ZkClient:
Instantiates a kazoo client to connect to zookeeper server at :param zookeeper_host::param zookeeper_port.
"""
def __init__(self, zookeeper_host, zookeeper_port, app_name, app_id):
- self.protocol_version = "1.0"
+ self.protocol_version = "2.0"
self.kazoo_client = KazooClient(hosts='{0}:{1}'.format(zookeeper_host, zookeeper_port))
self.zk_base_node = 'app-{0}-{1}/{2}-{3}-{4}-coordinationData'.format(app_name, app_id, app_name, app_id, self.protocol_version)
@@ -62,7 +62,7 @@ class ZkClient:
childZkNodes.sort()
childZkNodes.reverse()
- job_model_generation_path = '{0}/jobModelGeneration/jobModels/{1}/'.format(self.zk_base_node, childZkNodes[0])
+ job_model_generation_path = '{0}/jobModelGeneration/jobModels/{1}/0'.format(self.zk_base_node, childZkNodes[0])
job_model, _ = self.kazoo_client.get(job_model_generation_path)
"""
@@ -75,7 +75,8 @@ class ZkClient:
"""
first_curly_brace_index = job_model.find('{')
- job_model = job_model[first_curly_brace_index: ]
+ last_curly_brace_index = job_model.rindex('}')
+ job_model = job_model[first_curly_brace_index: last_curly_brace_index + 1]
job_model_dict = json.loads(job_model)
logger.info("Recent JobModel in zookeeper: {0}".format(job_model_dict))
except: