You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nemo.apache.org by jo...@apache.org on 2018/10/17 01:13:29 UTC

[incubator-nemo] 12/14: get query string

This is an automated email from the ASF dual-hosted git repository.

johnyangk pushed a commit to branch tpch-fix
in repository https://gitbox.apache.org/repos/asf/incubator-nemo.git

commit 7392dd4e65ab038c7978ae91d50f2ab456ca040d
Author: John Yang <jo...@apache.org>
AuthorDate: Thu Sep 13 11:08:35 2018 +0900

    get query string
---
 client/src/main/java/org/apache/nemo/client/JobLauncher.java |  1 +
 .../main/java/org/apache/nemo/examples/beam/tpch/Tpch.java   | 12 +-----------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/client/src/main/java/org/apache/nemo/client/JobLauncher.java b/client/src/main/java/org/apache/nemo/client/JobLauncher.java
index 0ae7dfd..91a6329 100644
--- a/client/src/main/java/org/apache/nemo/client/JobLauncher.java
+++ b/client/src/main/java/org/apache/nemo/client/JobLauncher.java
@@ -151,6 +151,7 @@ public final class JobLauncher {
       throw new RuntimeException(e);
     } finally {
       // Close everything that's left
+
       driverRPCServer.shutdown();
       driverLauncher.close();
       final Optional<Throwable> possibleError = driverLauncher.getStatus().getError();
diff --git a/examples/beam/src/main/java/org/apache/nemo/examples/beam/tpch/Tpch.java b/examples/beam/src/main/java/org/apache/nemo/examples/beam/tpch/Tpch.java
index 8f7c937..1d6f42c 100644
--- a/examples/beam/src/main/java/org/apache/nemo/examples/beam/tpch/Tpch.java
+++ b/examples/beam/src/main/java/org/apache/nemo/examples/beam/tpch/Tpch.java
@@ -175,24 +175,14 @@ public final class Tpch {
   }
 
   private static String getQueryString(final String queryFilePath) {
-    boolean isStarted = false;
     final List<String> lines = new ArrayList<>();
     try (final Stream<String> stream  = Files.lines(Paths.get(queryFilePath))) {
-      for (final String line : stream.collect(Collectors.toList())) {
-        if (line.equals("select")) {
-          isStarted = true;
-        }
-
-        if (isStarted) {
-          lines.add(line);
-        }
-      }
+      stream.forEach(lines::add);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
 
     System.out.println(lines);
-    lines.remove(lines.size() - 1);
 
     final StringBuilder sb = new StringBuilder();
     lines.forEach(line -> {