accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [3/4] git commit: ACCUMULO-3006 check for viewfs
Date Tue, 05 Aug 2014 14:03:55 GMT
ACCUMULO-3006 check for viewfs


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

Branch: refs/heads/master
Commit: d6472040a9873bcc160199b8da57078118ee3e4a
Parents: 2bbef48
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Tue Aug 5 10:02:36 2014 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Tue Aug 5 10:02:36 2014 -0400

----------------------------------------------------------------------
 .../accumulo/server/fs/VolumeManagerImpl.java   | 23 +++-----------------
 .../server/fs/VolumeManagerImplTest.java        | 10 +++++++++
 2 files changed, 13 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d6472040/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
index 0cfb457..877b9a6 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
@@ -219,16 +219,6 @@ public class VolumeManagerImpl implements VolumeManager {
       final String volumeName = entry.getKey();
       FileSystem fs = entry.getValue().getFileSystem();
 
-      if (ViewFSUtils.isViewFS(fs)) {
-        try {
-          FileSystem resolvedFs = ViewFSUtils.resolvePath(fs, new Path("/")).getFileSystem(fs.getConf());
-          log.debug("resolved " + fs.getUri() + " to " + resolvedFs.getUri() + " for sync
check");
-          fs = resolvedFs;
-        } catch (IOException e) {
-          log.warn("Failed to resolve " + fs.getUri(), e);
-        }
-      }
-
       if (fs instanceof DistributedFileSystem) {
         final String DFS_DURABLE_SYNC = "dfs.durable.sync", DFS_SUPPORT_APPEND = "dfs.support.append";
         final String ticketMessage = "See ACCUMULO-623 and ACCUMULO-1637 for more details.";
@@ -410,6 +400,9 @@ public class VolumeManagerImpl implements VolumeManager {
         // Cannot re-define the default volume
         throw new IllegalArgumentException();
 
+      if (volumeUriOrDir.startsWith("viewfs"))
+        throw new IllegalArgumentException();
+
       // We require a URI here, fail if it doesn't look like one
       if (volumeUriOrDir.contains(":")) {
         volumes.put(volumeUriOrDir, VolumeConfiguration.create(new Path(volumeUriOrDir),
hadoopConf));
@@ -426,16 +419,6 @@ public class VolumeManagerImpl implements VolumeManager {
     for (Volume volume : getFileSystems().values()) {
       FileSystem fs = volume.getFileSystem();
 
-      if (ViewFSUtils.isViewFS(fs)) {
-        try {
-          FileSystem resolvedFs = ViewFSUtils.resolvePath(fs, new Path("/")).getFileSystem(fs.getConf());
-          log.debug("resolved " + fs.getUri() + " to " + resolvedFs.getUri() + " for ready
check");
-          fs = resolvedFs;
-        } catch (IOException e) {
-          log.warn("Failed to resolve " + fs.getUri(), e);
-        }
-      }
-
       if (!(fs instanceof DistributedFileSystem))
         continue;
       DistributedFileSystem dfs = (DistributedFileSystem) fs;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d6472040/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
index f29d220..5f97bf6 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
@@ -19,6 +19,9 @@ package org.apache.accumulo.server.fs;
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.ConfigurationCopy;
+import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.server.fs.VolumeManager.FileType;
 import org.apache.hadoop.fs.Path;
 import org.junit.Assert;
@@ -82,4 +85,11 @@ public class VolumeManagerImplTest {
       Assert.assertEquals(new Path(expectedBase, pathToTest), fullPath);
     }
   }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void noViewFS() throws Exception {
+    ConfigurationCopy conf = new ConfigurationCopy();
+    conf.set(Property.INSTANCE_VOLUMES, "viewfs://dummy");
+    VolumeManagerImpl.get(conf);
+  }
 }


Mime
View raw message