You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by sh...@apache.org on 2015/12/30 08:10:44 UTC

[25/50] [abbrv] lens git commit: LENS-883 : httpresultset api should return 404 when resultset file does not exist

LENS-883 : httpresultset api should return 404 when resultset file does not exist


Project: http://git-wip-us.apache.org/repos/asf/lens/repo
Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/942f071f
Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/942f071f
Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/942f071f

Branch: refs/heads/LENS-581
Commit: 942f071f9925b1265a67a1f7b2ab437127485a09
Parents: 5d79ecf
Author: Deepak Barr <de...@gmail.com>
Authored: Thu Nov 26 13:51:14 2015 +0530
Committer: Rajat Khandelwal <ra...@gmail.com>
Committed: Thu Nov 26 13:51:14 2015 +0530

----------------------------------------------------------------------
 .../apache/lens/server/query/QueryExecutionServiceImpl.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lens/blob/942f071f/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java b/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
index 941b1e5..7201e0d 100644
--- a/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
+++ b/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
@@ -2485,6 +2485,14 @@ public class QueryExecutionServiceImpl extends BaseLensService implements QueryE
       throw new NotFoundException("http result not available");
     }
     final Path resultPath = new Path(resultSet.getOutputPath());
+    try {
+      FileSystem fs = resultPath.getFileSystem(conf);
+      if (!fs.exists(resultPath)) {
+        throw new NotFoundException("Result file does not exist!");
+      }
+    } catch (IOException e) {
+      throw new LensException(e);
+    }
     final QueryContext ctx = getQueryContext(sessionHandle, queryHandle);
     String resultFSReadUrl = conf.get(RESULT_FS_READ_URL);
     if (resultFSReadUrl != null) {