Repository: incubator-impala
Updated Branches:
  refs/heads/master cd6d86b83 -> a8a5f6583


IMPALA-4028: Improve message for improper Sentry config to make extra spaces 
visible.

When the Sentry config file contained extra spaces it used to be difficult to
determine what went wrong because the offending path was not quoted making the
spaces hard to see. As a result, Impala startup failed.

This patch quotes the bad file path in the error message to make the extra 
spaces
visible.

Change-Id: I3a76b9e4236caa3f2088fba8a9cf0236fced2634
Reviewed-on: http://gerrit.cloudera.org:8080/4309
Reviewed-by: Tim Armstrong <tarmstr...@cloudera.com>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/a8a5f658
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/a8a5f658
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/a8a5f658

Branch: refs/heads/master
Commit: a8a5f6583ca4bf8a3d90d98b9dfb439fdedc9f8d
Parents: cd6d86b
Author: davidxdh <davy...@163.com>
Authored: Sat Sep 3 16:23:25 2016 +0800
Committer: Internal Jenkins <cloudera-hud...@gerrit.cloudera.org>
Committed: Wed Sep 21 22:04:44 2016 +0000

----------------------------------------------------------------------
 .../java/com/cloudera/impala/authorization/SentryConfig.java    | 5 +++--
 .../java/com/cloudera/impala/analysis/AuthorizationTest.java    | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/a8a5f658/fe/src/main/java/com/cloudera/impala/authorization/SentryConfig.java
----------------------------------------------------------------------
diff --git 
a/fe/src/main/java/com/cloudera/impala/authorization/SentryConfig.java 
b/fe/src/main/java/com/cloudera/impala/authorization/SentryConfig.java
index 438e9d5..48300f4 100644
--- a/fe/src/main/java/com/cloudera/impala/authorization/SentryConfig.java
+++ b/fe/src/main/java/com/cloudera/impala/authorization/SentryConfig.java
@@ -51,8 +51,9 @@ public class SentryConfig {
 
     File configFile = new File(configFile_);
     if (!configFile.exists()) {
+      String configFilePath = "\"" + configFile_ + "\"";
       throw new RuntimeException("Sentry configuration file does not exist: " +
-          configFile_);
+          configFilePath);
     }
 
     if (!configFile.canRead()) {
@@ -70,4 +71,4 @@ public class SentryConfig {
 
   public Configuration getConfig() { return config_; }
   public String getConfigFile() { return configFile_; }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/a8a5f658/fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
----------------------------------------------------------------------
diff --git 
a/fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java 
b/fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
index 3cd04e5..9ee4312 100644
--- a/fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
+++ b/fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
@@ -2082,7 +2082,7 @@ public class AuthorizationTest {
       fail("Expected configuration to fail.");
     } catch (Exception e) {
       Assert.assertEquals(e.getMessage(),
-          "Sentry configuration file does not exist: 
/path/does/not/exist.xml");
+          "Sentry configuration file does not exist: 
\"/path/does/not/exist.xml\"");
     }
 
     // Invalid ResourcePolicyProvider class name.

Reply via email to