Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 82ee354

Browse files
authored
Unvendor pyobj + fix py2->py3 compatability fixes. (#3574)
This also uses the longer DataWatcher handler signature to avoid a TypeError, which it relies on to indicate it should retry with the shorter signature. Without this change, exceptions can be reported messily due to a raise in the except path being reasonably expected.
1 parent 42b87fe commit 82ee354

File tree

6 files changed

+12
-679
lines changed

6 files changed

+12
-679
lines changed

heron/statemgrs/src/python/zkstatemanager.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _get_topology_with_watch(self, topologyName, callback, isWatching):
188188

189189
# pylint: disable=unused-variable, unused-argument
190190
@self.client.DataWatch(path)
191-
def watch_topology(data, stats):
191+
def watch_topology(data, stats, event):
192192
""" watch topology """
193193
if data:
194194
topology = Topology()
@@ -258,7 +258,7 @@ def _get_packing_plan_with_watch(self, topologyName, callback, isWatching):
258258

259259
# pylint: disable=unused-argument,unused-variable
260260
@self.client.DataWatch(path)
261-
def watch_packing_plan(data, stats):
261+
def watch_packing_plan(data, stats, event):
262262
""" watch the packing plan for updates """
263263
if data:
264264
packing_plan = PackingPlan()
@@ -307,7 +307,7 @@ def _get_pplan_with_watch(self, topologyName, callback, isWatching):
307307

308308
# pylint: disable=unused-variable, unused-argument
309309
@self.client.DataWatch(path)
310-
def watch_pplan(data, stats):
310+
def watch_pplan(data, stats, event):
311311
""" invoke callback to watch physical plan """
312312
if data:
313313
pplan = PhysicalPlan()
@@ -379,7 +379,7 @@ def _get_execution_state_with_watch(self, topologyName, callback, isWatching):
379379

380380
# pylint: disable=unused-variable, unused-argument
381381
@self.client.DataWatch(path)
382-
def watch_execution_state(data, stats):
382+
def watch_execution_state(data, stats, event):
383383
""" invoke callback to watch execute state """
384384
if data:
385385
executionState = ExecutionState()
@@ -451,7 +451,7 @@ def _get_tmaster_with_watch(self, topologyName, callback, isWatching):
451451

452452
# pylint: disable=unused-variable, unused-argument
453453
@self.client.DataWatch(path)
454-
def watch_tmaster(data, stats):
454+
def watch_tmaster(data, stats, event):
455455
""" invoke callback to watch tmaster """
456456
if data:
457457
tmaster = TMasterLocation()
@@ -499,7 +499,7 @@ def _get_scheduler_location_with_watch(self, topologyName, callback, isWatching)
499499

500500
# pylint: disable=unused-variable, unused-argument
501501
@self.client.DataWatch(path)
502-
def watch_scheduler_location(data, stats):
502+
def watch_scheduler_location(data, stats, event):
503503
""" invoke callback to watch scheduler location """
504504
if data:
505505
scheduler_location = SchedulerLocation()

heron/tools/tracker/src/python/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pex_library(
99
reqs = [
1010
"protobuf==3.8.0",
1111
"tornado==4.0.2",
12+
"javaobj-py3==0.4.1",
1213
],
1314
deps = [
1415
"//heron/common/src/python:common-py",

0 commit comments

Comments
 (0)