accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [1/6] accumulo git commit: ACCUMULO-3865 Throw better exception with miniDFS
Date Tue, 09 Jun 2015 17:52:50 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 b754d1212 -> 8c0d881c3
  refs/heads/1.7 e16a6faef -> e0c72f250
  refs/heads/master f93803ff6 -> f7777839d


ACCUMULO-3865 Throw better exception with miniDFS

* Throw IllegalStateException with informative message when attempting to
  restart mini when using miniDFS, since that feature is not supported.
* Add javadoc to explain the restriction.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/8c0d881c
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/8c0d881c
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/8c0d881c

Branch: refs/heads/1.6
Commit: 8c0d881c32c107039f29a4f43df230e2a098804f
Parents: b754d12
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Tue Jun 9 13:12:38 2015 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Tue Jun 9 13:12:38 2015 -0400

----------------------------------------------------------------------
 .../accumulo/minicluster/impl/MiniAccumuloClusterImpl.java    | 4 ++++
 .../accumulo/minicluster/impl/MiniAccumuloConfigImpl.java     | 7 +++++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/8c0d881c/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index 6e67c9f..e512936 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -473,6 +473,10 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
    */
   @Override
   public synchronized void start() throws IOException, InterruptedException {
+    if (config.useMiniDFS() && miniDFS == null) {
+      throw new IllegalStateException("Cannot restart mini when using miniDFS");
+    }
+
     MiniAccumuloClusterControl control = getClusterControl();
 
     if (config.useExistingInstance()) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8c0d881c/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloConfigImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloConfigImpl.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloConfigImpl.java
index 10d5a9c..8feef61 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloConfigImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloConfigImpl.java
@@ -29,8 +29,10 @@ import org.apache.accumulo.core.conf.CredentialProviderFactoryShim;
 import org.apache.accumulo.core.conf.DefaultConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.minicluster.MemoryUnit;
+import org.apache.accumulo.minicluster.MiniAccumuloCluster;
 import org.apache.accumulo.server.util.PortUtils;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.log4j.Logger;
 
 /**
@@ -484,6 +486,11 @@ public class MiniAccumuloConfigImpl {
     return useMiniDFS;
   }
 
+  /**
+   * Configures this cluster to use miniDFS instead of the local {@link FileSystem}. Using
this feature will not allow you to re-start
+   * {@link MiniAccumuloCluster} by calling {@link MiniAccumuloCluster#start()} after {@link
MiniAccumuloCluster#stop()}, because the underlying miniDFS cannot
+   * be restarted.
+   */
   public void useMiniDFS(boolean useMiniDFS) {
     this.useMiniDFS = useMiniDFS;
   }


Mime
View raw message