beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (BEAM-4028) Step / Operation naming should rely on a NameContext class
Date Thu, 12 Apr 2018 01:41:05 GMT

     [ https://issues.apache.org/jira/browse/BEAM-4028?focusedWorklogId=90260&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-90260
]

ASF GitHub Bot logged work on BEAM-4028:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Apr/18 01:41
            Start Date: 12/Apr/18 01:41
    Worklog Time Spent: 10m 
      Work Description: charlesccychen commented on a change in pull request #5043: [BEAM-4028]
Adding NameContext to Python SDK.
URL: https://github.com/apache/beam/pull/5043#discussion_r180944559
 
 

 ##########
 File path: sdks/python/apache_beam/runners/common.py
 ##########
 @@ -39,6 +39,75 @@
 from apache_beam.utils.windowed_value import WindowedValue
 
 
+class NameContext(object):
+  """Holds the name information for a step."""
+
+  def __init__(self, step_name):
+    """Creates a new step NameContext.
+
+    Args:
+      step_name: The name of the step.
+    """
+    self.step_name = step_name
+
+  def __eq__(self, other):
+    return self.step_name == other.step_name
+
+  def __ne__(self, other):
+    return not self == other
+
+  def __repr__(self):
+    return 'NameContext(%s)' % self.__dict__()
+
+  def __hash__(self):
+    return hash(self.step_name)
+
+  def metrics_name(self):
+    """Returns the step name used for metrics reporting."""
+    return self.step_name
+
+  def logging_name(self):
+    """Returns the step name used for logging."""
+    return self.step_name
+
+
+class DataflowNameContext(NameContext):
 
 Review comment:
   <!--new_thread; commit:9af473735321a610ce116d3a9dcf5486a68db57e; resolved:0-->
   Do we need this to be exposed in the Beam code?  Can we have this only in the worker? 
If this needs to be done in two steps, can you add a TODO / Jira?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 90260)
    Time Spent: 2h 20m  (was: 2h 10m)

> Step / Operation naming should rely on a NameContext class
> ----------------------------------------------------------
>
>                 Key: BEAM-4028
>                 URL: https://issues.apache.org/jira/browse/BEAM-4028
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Pablo Estrada
>            Assignee: Pablo Estrada
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Steps can have different names depending on the runner (stage, step, user, system name...). 
> Depending on the needs of different components (operations, logging, metrics, statesampling)
these step names are passed around without a specific order.
> Instead, SDK should rely on `NameContext` objects that carry all the naming information
for a single step.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message