Skip to content
Permalink
Browse files
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.
  • Loading branch information
Code0x58 committed Jul 22, 2020
1 parent 42b87fe commit 82ee354e1b3c6bb161e8f6835df22f47ab78a877
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 679 deletions.
@@ -188,7 +188,7 @@ def _get_topology_with_watch(self, topologyName, callback, isWatching):

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

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

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

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

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

# pylint: disable=unused-variable, unused-argument
@self.client.DataWatch(path)
def watch_scheduler_location(data, stats):
def watch_scheduler_location(data, stats, event):
""" invoke callback to watch scheduler location """
if data:
scheduler_location = SchedulerLocation()
@@ -9,6 +9,7 @@ pex_library(
reqs = [
"protobuf==3.8.0",
"tornado==4.0.2",
"javaobj-py3==0.4.1",
],
deps = [
"//heron/common/src/python:common-py",

0 comments on commit 82ee354

Please sign in to comment.