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-2855) Implement a python version of the nexmark queries
Date Tue, 26 Jun 2018 06:23:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 26/Jun/18 06:22
            Start Date: 26/Jun/18 06:22
    Worklog Time Spent: 10m 
      Work Description: aaltay commented on a change in pull request #5738: [BEAM-2855] Add
Python Nexmark suite
URL: https://github.com/apache/beam/pull/5738#discussion_r198023427
 
 

 ##########
 File path: sdks/python/apache_beam/testing/benchmarks/nexmark/nexmark_launcher.py
 ##########
 @@ -168,32 +189,45 @@ def run_query(query, args, pipeline_options):
       result.cancel()
     else:
       result.wait_until_finish()
-  except NotImplementedError as exp:
-    print(exp)
+  except Exception as exc:
+    thread_errors.append(str(exc))
 
 
 def run(argv=None):
   args, _ = parse_args()
 
   queries = {
       0: query0,
-      # TODO(mariagh): Add more queries
+      1: query1,
+      2: query2,
+      # TODO(mariagh): query4
   }
 
   for i in args.query:
     args, pipeline_options = parse_args()
     logging.info('Running query %d', i)
 
-    job_setup_time = 20 * 1000    # in milliseconds
-    query_duration = pipeline_options.view_as(TestOptions).wait_until_finish_duration + job_setup_time
# pylint: disable=line-too-long
-    command = Command(run_query, args=[queries[i], args, pipeline_options])
-    try:
-      command.run(timeout=query_duration/1000)
-    except Exception as exp:
-      logging.error('Command failed with "%s"', exp)
-
-  logging.info('Queries run successfully: %s', args.query)
-
+    # The DirectRunner is the default runner, and it needs
+    # special handling to cancel streaming jobs.
+    launch_from_direct_runner = pipeline_options.view_as(
+        StandardOptions).runner in [None, 'DirectRunner']
+
+    if launch_from_direct_runner:
+      thread_errors = collections.defaultdict(list)
+      command = Command(run_query, args=[queries[i], args, pipeline_options,
+                                         thread_errors[i]])
+      query_duration = pipeline_options.view_as(TestOptions).wait_until_finish_duration #
pylint: disable=line-too-long
 
 Review comment:
   By using the same `wait_until_finish_duration` in both places, we would not give a chance
for `cancel` to execute. This needs to have some buffer for that. (In DataflowRunner case)

----------------------------------------------------------------
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: 115790)
    Time Spent: 7h 20m  (was: 7.5h)

> Implement a python version of the nexmark queries
> -------------------------------------------------
>
>                 Key: BEAM-2855
>                 URL: https://issues.apache.org/jira/browse/BEAM-2855
>             Project: Beam
>          Issue Type: Improvement
>          Components: examples-nexmark, sdk-py-core, testing
>            Reporter: Ismaël Mejía
>            Assignee: María GH
>            Priority: Minor
>              Labels: newbie, nexmark, starter
>          Time Spent: 7h 20m
>  Remaining Estimate: 0h
>
> Currently we have a Java only implementation of Nexmark, a python based implementation
would be nice to have to validate the direct and dataflow runners, but also to validate the
new support of multiple SDKs in multiple runners via the runner/fn API.



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

Mime
View raw message