[
https://issues.apache.org/jira/browse/BEAM-4761?focusedWorklogId=131072&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-131072
]
ASF GitHub Bot logged work on BEAM-4761:
----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Aug/18 21:01
Start Date: 03/Aug/18 21:01
Worklog Time Spent: 10m
Work Description: akedin commented on a change in pull request #6127:
[BEAM-4761] Run Nexmark in thread pool
URL: https://github.com/apache/beam/pull/6127#discussion_r207664753
##########
File path:
sdks/java/nexmark/src/main/java/org/apache/beam/sdk/nexmark/Main.java
##########
@@ -74,30 +82,83 @@
* <p>See <a href="http://datalab.cs.pdx.edu/niagaraST/NEXMark/">
* http://datalab.cs.pdx.edu/niagaraST/NEXMark/</a>
*/
-public class Main<OptionT extends NexmarkOptions> {
+public class Main {
+
+ private static class Result {
+ private final NexmarkConfiguration configuration;
+ private final NexmarkPerf perf;
+
+ private Result(NexmarkConfiguration configuration, NexmarkPerf perf) {
+ this.configuration = configuration;
+ this.perf = perf;
+ }
+ }
+
+ private static class Run implements Callable<Result> {
+ private final NexmarkLauncher<NexmarkOptions> nexmarkLauncher;
+ private final NexmarkConfiguration configuration;
+
+ private Run(String[] args, NexmarkConfiguration configuration) {
+ NexmarkOptions options =
PipelineOptionsFactory.fromArgs(args).as(NexmarkOptions.class);
+ this.nexmarkLauncher = new NexmarkLauncher<>(options);
+ this.configuration = configuration;
+ }
+
+ @Override
+ public Result call() throws IOException {
+ NexmarkPerf perf = nexmarkLauncher.run(configuration);
+ return new Result(configuration, perf);
+ }
+ }
/** Entry point. */
- void runAll(OptionT options, NexmarkLauncher nexmarkLauncher) throws
IOException {
+ void runAll(String[] args) throws IOException {
Instant start = Instant.now();
+ NexmarkOptions options =
+
PipelineOptionsFactory.fromArgs(args).withValidation().as(NexmarkOptions.class);
Map<NexmarkConfiguration, NexmarkPerf> baseline =
loadBaseline(options.getBaselineFilename());
Map<NexmarkConfiguration, NexmarkPerf> actual = new LinkedHashMap<>();
- Iterable<NexmarkConfiguration> configurations =
options.getSuite().getConfigurations(options);
+ Set<NexmarkConfiguration> configurations =
options.getSuite().getConfigurations(options);
+ int nThreads = Math.min(options.getNexmarkParallel(),
configurations.size());
+ ExecutorService executor = Executors.newFixedThreadPool(nThreads);
+ CompletionService<Result> completion = new
ExecutorCompletionService(executor);
boolean successful = true;
try {
- // Run all the configurations.
+ // Schedule all the configurations.
+ int scheduled = 0;
for (NexmarkConfiguration configuration : configurations) {
- NexmarkPerf perf = nexmarkLauncher.run(configuration);
- if (perf != null) {
- if (perf.errors == null || perf.errors.size() > 0) {
- successful = false;
+ completion.submit(new Run(args, configuration));
+ scheduled++;
Review comment:
nit: you don't need to keep `scheduled` counter anymore, you have
`configurations.size()` now
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 131072)
Time Spent: 7h 20m (was: 7h 10m)
> Add postCommit scripts and perfkit dashboards for nexmark on Dataflow runner
> ----------------------------------------------------------------------------
>
> Key: BEAM-4761
> URL: https://issues.apache.org/jira/browse/BEAM-4761
> Project: Beam
> Issue Type: Test
> Components: examples-nexmark
> Reporter: Etienne Chauchot
> Assignee: Andrew Pilloud
> Priority: Major
> Time Spent: 7h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)