nemo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnya...@apache.org
Subject [incubator-nemo] 12/14: get query string
Date Wed, 17 Oct 2018 01:13:29 GMT
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 <johnyangk@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 -> {


Mime
View raw message