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

Commit

Permalink
Unvendor pyobj + fix py2->py3 compatability fixes. (#3574)
Browse files Browse the repository at this point in the history
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 authored Jul 22, 2020
1 parent 42b87fe commit 82ee354
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 679 deletions.
12 changes: 6 additions & 6 deletions heron/statemgrs/src/python/zkstatemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions heron/tools/tracker/src/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 82ee354

Please sign in to comment.