You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2016/07/11 20:40:30 UTC
[1/6] accumulo git commit: ACCUMULO-4369 Restructure try-catch to
ensure a logical exception is raised
Repository: accumulo
Updated Branches:
refs/heads/1.7 b70b52810 -> 196b6bdb9
refs/heads/1.8 757dedf7a -> 4c4ad8664
refs/heads/master ad6e98112 -> bf7290546
ACCUMULO-4369 Restructure try-catch to ensure a logical exception is raised
If getZooInstance throws a RuntimeException, then an IllegalArgumentException
would be re-thrown saying that the client configuration was invalid/missing.
This was because the broad catch on Exception was unintentionally catching
all RTE's as well.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/196b6bdb
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/196b6bdb
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/196b6bdb
Branch: refs/heads/1.7
Commit: 196b6bdb94c4731f30e10bfd651ca55c8b4828ac
Parents: b70b528
Author: Josh Elser <el...@apache.org>
Authored: Mon Jul 11 15:46:19 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jul 11 15:46:19 2016 -0400
----------------------------------------------------------------------
shell/src/main/java/org/apache/accumulo/shell/Shell.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/196b6bdb/shell/src/main/java/org/apache/accumulo/shell/Shell.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 2dd8068..0005c36 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -169,6 +169,7 @@ import org.apache.commons.cli.MissingOptionException;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Level;
@@ -448,11 +449,13 @@ public class Shell extends ShellOptions implements KeywordExecutable {
instanceName = options.getZooKeeperInstanceName();
hosts = options.getZooKeeperHosts();
}
+ final ClientConfiguration clientConf;
try {
- instance = getZooInstance(instanceName, hosts, options.getClientConfiguration());
- } catch (Exception e) {
+ clientConf = options.getClientConfiguration();
+ } catch (ConfigurationException | FileNotFoundException e) {
throw new IllegalArgumentException("Unable to load client config from " + options.getClientConfigFile(), e);
}
+ instance = getZooInstance(instanceName, hosts, clientConf);
}
}
[2/6] accumulo git commit: ACCUMULO-4369 Restructure try-catch to
ensure a logical exception is raised
Posted by el...@apache.org.
ACCUMULO-4369 Restructure try-catch to ensure a logical exception is raised
If getZooInstance throws a RuntimeException, then an IllegalArgumentException
would be re-thrown saying that the client configuration was invalid/missing.
This was because the broad catch on Exception was unintentionally catching
all RTE's as well.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/196b6bdb
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/196b6bdb
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/196b6bdb
Branch: refs/heads/1.8
Commit: 196b6bdb94c4731f30e10bfd651ca55c8b4828ac
Parents: b70b528
Author: Josh Elser <el...@apache.org>
Authored: Mon Jul 11 15:46:19 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jul 11 15:46:19 2016 -0400
----------------------------------------------------------------------
shell/src/main/java/org/apache/accumulo/shell/Shell.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/196b6bdb/shell/src/main/java/org/apache/accumulo/shell/Shell.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 2dd8068..0005c36 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -169,6 +169,7 @@ import org.apache.commons.cli.MissingOptionException;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Level;
@@ -448,11 +449,13 @@ public class Shell extends ShellOptions implements KeywordExecutable {
instanceName = options.getZooKeeperInstanceName();
hosts = options.getZooKeeperHosts();
}
+ final ClientConfiguration clientConf;
try {
- instance = getZooInstance(instanceName, hosts, options.getClientConfiguration());
- } catch (Exception e) {
+ clientConf = options.getClientConfiguration();
+ } catch (ConfigurationException | FileNotFoundException e) {
throw new IllegalArgumentException("Unable to load client config from " + options.getClientConfigFile(), e);
}
+ instance = getZooInstance(instanceName, hosts, clientConf);
}
}
[5/6] accumulo git commit: Merge branch '1.7' into 1.8
Posted by el...@apache.org.
Merge branch '1.7' into 1.8
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4c4ad866
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4c4ad866
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4c4ad866
Branch: refs/heads/1.8
Commit: 4c4ad86645336d84cbe4ca4ef75e6e0f03d58e6a
Parents: 757dedf 196b6bd
Author: Josh Elser <el...@apache.org>
Authored: Mon Jul 11 15:48:07 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jul 11 15:48:07 2016 -0400
----------------------------------------------------------------------
shell/src/main/java/org/apache/accumulo/shell/Shell.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4c4ad866/shell/src/main/java/org/apache/accumulo/shell/Shell.java
----------------------------------------------------------------------
[3/6] accumulo git commit: ACCUMULO-4369 Restructure try-catch to
ensure a logical exception is raised
Posted by el...@apache.org.
ACCUMULO-4369 Restructure try-catch to ensure a logical exception is raised
If getZooInstance throws a RuntimeException, then an IllegalArgumentException
would be re-thrown saying that the client configuration was invalid/missing.
This was because the broad catch on Exception was unintentionally catching
all RTE's as well.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/196b6bdb
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/196b6bdb
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/196b6bdb
Branch: refs/heads/master
Commit: 196b6bdb94c4731f30e10bfd651ca55c8b4828ac
Parents: b70b528
Author: Josh Elser <el...@apache.org>
Authored: Mon Jul 11 15:46:19 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jul 11 15:46:19 2016 -0400
----------------------------------------------------------------------
shell/src/main/java/org/apache/accumulo/shell/Shell.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/196b6bdb/shell/src/main/java/org/apache/accumulo/shell/Shell.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 2dd8068..0005c36 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -169,6 +169,7 @@ import org.apache.commons.cli.MissingOptionException;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Level;
@@ -448,11 +449,13 @@ public class Shell extends ShellOptions implements KeywordExecutable {
instanceName = options.getZooKeeperInstanceName();
hosts = options.getZooKeeperHosts();
}
+ final ClientConfiguration clientConf;
try {
- instance = getZooInstance(instanceName, hosts, options.getClientConfiguration());
- } catch (Exception e) {
+ clientConf = options.getClientConfiguration();
+ } catch (ConfigurationException | FileNotFoundException e) {
throw new IllegalArgumentException("Unable to load client config from " + options.getClientConfigFile(), e);
}
+ instance = getZooInstance(instanceName, hosts, clientConf);
}
}
[6/6] accumulo git commit: Merge branch '1.8'
Posted by el...@apache.org.
Merge branch '1.8'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bf729054
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bf729054
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bf729054
Branch: refs/heads/master
Commit: bf7290546a4c720e9ba2d40498d653bc54b12741
Parents: ad6e981 4c4ad86
Author: Josh Elser <el...@apache.org>
Authored: Mon Jul 11 16:40:17 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jul 11 16:40:17 2016 -0400
----------------------------------------------------------------------
shell/src/main/java/org/apache/accumulo/shell/Shell.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/bf729054/shell/src/main/java/org/apache/accumulo/shell/Shell.java
----------------------------------------------------------------------
diff --cc shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 9f4b4b64,053e998..2300d9e
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@@ -442,22 -448,28 +443,24 @@@ public class Shell extends ShellOption
protected void setInstance(ShellOptionsJC options) {
// should only be one set of instance options set
instance = null;
- if (options.isFake()) {
- instance = DeprecationUtil.makeMockInstance("fake");
+ String instanceName, hosts;
+ if (options.isHdfsZooInstance()) {
+ instanceName = hosts = null;
+ } else if (options.getZooKeeperInstance().size() > 0) {
+ List<String> zkOpts = options.getZooKeeperInstance();
+ instanceName = zkOpts.get(0);
+ hosts = zkOpts.get(1);
} else {
- String instanceName, hosts;
- if (options.isHdfsZooInstance()) {
- instanceName = hosts = null;
- } else if (options.getZooKeeperInstance().size() > 0) {
- List<String> zkOpts = options.getZooKeeperInstance();
- instanceName = zkOpts.get(0);
- hosts = zkOpts.get(1);
- } else {
- instanceName = options.getZooKeeperInstanceName();
- hosts = options.getZooKeeperHosts();
- }
- final ClientConfiguration clientConf;
- try {
- clientConf = options.getClientConfiguration();
- } catch (ConfigurationException | FileNotFoundException e) {
- throw new IllegalArgumentException("Unable to load client config from " + options.getClientConfigFile(), e);
- }
- instance = getZooInstance(instanceName, hosts, clientConf);
+ instanceName = options.getZooKeeperInstanceName();
+ hosts = options.getZooKeeperHosts();
+ }
++ final ClientConfiguration clientConf;
+ try {
- instance = getZooInstance(instanceName, hosts, options.getClientConfiguration());
- } catch (Exception e) {
++ clientConf = options.getClientConfiguration();
++ } catch (ConfigurationException | FileNotFoundException e) {
+ throw new IllegalArgumentException("Unable to load client config from " + options.getClientConfigFile(), e);
}
++ instance = getZooInstance(instanceName, hosts, clientConf);
}
/**
[4/6] accumulo git commit: Merge branch '1.7' into 1.8
Posted by el...@apache.org.
Merge branch '1.7' into 1.8
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4c4ad866
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4c4ad866
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4c4ad866
Branch: refs/heads/master
Commit: 4c4ad86645336d84cbe4ca4ef75e6e0f03d58e6a
Parents: 757dedf 196b6bd
Author: Josh Elser <el...@apache.org>
Authored: Mon Jul 11 15:48:07 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jul 11 15:48:07 2016 -0400
----------------------------------------------------------------------
shell/src/main/java/org/apache/accumulo/shell/Shell.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4c4ad866/shell/src/main/java/org/apache/accumulo/shell/Shell.java
----------------------------------------------------------------------