You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by GitBox <gi...@apache.org> on 2022/06/02 09:05:12 UTC

[GitHub] [incubator-heron] thinker0 commented on a diff in pull request #3830: Fix Update of topology

thinker0 commented on code in PR #3830:
URL: https://github.com/apache/incubator-heron/pull/3830#discussion_r887735790


##########
heron/tools/tracker/src/python/topology.py:
##########
@@ -241,8 +244,16 @@ def __init__(self, name: str, state_manager_name: str, tracker_config: Config) -
     self.id: Optional[int] = None
     self.tracker_config: Config = tracker_config
     # this maps pb2 structs to structures returned via API endpoints
-    # it is repopulated every time one of the pb2 roperties is updated
+    # it is repopulated every time one of the pb2 properties is updated
     self.info: Optional[TopologyInfo] = None
+    self.lock = threading.RLock()
+
+  def __eq__(self, o):
+    return isinstance(o, Topology) \
+           and o.name == self.name \
+           and o.state_manager_name == self.state_manager_name \
+           and o.cluster == self.cluster \
+           and o.environ == self.environ

Review Comment:
   ```
   if name not in topologies:
   ```
   
   Since @dataclass compares all values and judges that only the exact same Object is the same, we want some values to be the same.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@heron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org