accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1431079 - in /accumulo/trunk/start/src: main/java/org/apache/accumulo/start/classloader/vfs/ main/java/org/apache/accumulo/start/classloader/vfs/providers/ main/java/org/apache/commons/vfs2/ main/java/org/apache/commons/vfs2/provider/ main...
Date Wed, 09 Jan 2013 21:11:26 GMT
Author: kturner
Date: Wed Jan  9 21:11:26 2013
New Revision: 1431079

URL: http://svn.apache.org/viewvc?rev=1431079&view=rev
Log:
ACCUMULO-927 applied patch from Dave Marion with modifications

Added:
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileAttributes.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileProvider.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/package.html
    accumulo/trunk/start/src/main/java/org/apache/commons/vfs2/
    accumulo/trunk/start/src/main/java/org/apache/commons/vfs2/provider/
    accumulo/trunk/start/src/main/java/org/apache/commons/vfs2/provider/hdfs/
Removed:
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsReadOnlyFileContentInfoFactory.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsReadOnlyRandomAccessContent.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProvider.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileSystem.java
Modified:
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileObject.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystemConfigBuilder.java
    accumulo/trunk/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java
    accumulo/trunk/start/src/test/java/org/apache/accumulo/test/AccumuloDFSBase.java

Modified: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java?rev=1431079&r1=1431078&r2=1431079&view=diff
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java (original)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java Wed Jan  9 21:11:26 2013
@@ -23,7 +23,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 
 import org.apache.accumulo.start.classloader.AccumuloClassLoader;
-import org.apache.accumulo.start.classloader.vfs.providers.ReadOnlyHdfsFileProvider;
+import org.apache.accumulo.start.classloader.vfs.providers.HdfsFileProvider;
 import org.apache.commons.vfs2.CacheStrategy;
 import org.apache.commons.vfs2.FileObject;
 import org.apache.commons.vfs2.FileSystemException;
@@ -208,7 +208,7 @@ public class AccumuloVFSClassLoader {
             vfs.addProvider("tbz2", new org.apache.commons.vfs2.provider.tar.TarFileProvider());
             vfs.addProvider("tgz", new org.apache.commons.vfs2.provider.tar.TarFileProvider());
             vfs.addProvider("bz2", new org.apache.commons.vfs2.provider.bzip2.Bzip2FileProvider());
-            vfs.addProvider("hdfs", new ReadOnlyHdfsFileProvider());
+            vfs.addProvider("hdfs", new HdfsFileProvider());
             vfs.addExtensionMap("jar", "jar");
             vfs.addExtensionMap("zip", "zip");
             vfs.addExtensionMap("gz", "gz");

Added: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileAttributes.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileAttributes.java?rev=1431079&view=auto
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileAttributes.java (added)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileAttributes.java Wed Jan  9 21:11:26 2013
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.start.classloader.vfs.providers;
+
+/**
+ * HDFS file content attributes.
+ * 
+ * @since 2.1
+ */
+public enum HdfsFileAttributes
+{
+    /**
+     * Last access time.
+     */
+    LAST_ACCESS_TIME,
+
+    /**
+     * Block size.
+     */
+    BLOCK_SIZE,
+
+    /**
+     * Group.
+     */
+    GROUP,
+
+    /**
+     * Owner.
+     */
+    OWNER,
+
+    /**
+     * Permissions.
+     */
+    PERMISSIONS,
+
+    /**
+     * Length.
+     */
+    LENGTH,
+
+    /**
+     * Modification time.
+     */
+    MODIFICATION_TIME;
+}

Added: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java?rev=1431079&view=auto
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java (added)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java Wed Jan  9 21:11:26 2013
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.start.classloader.vfs.providers;
+
+import org.apache.commons.vfs2.FileContent;
+import org.apache.commons.vfs2.FileContentInfo;
+import org.apache.commons.vfs2.FileContentInfoFactory;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.impl.DefaultFileContentInfo;
+
+/**
+ * Creates FileContentInfo instances for HDFS.
+ * 
+ * @since 2.1
+ */
+public class HdfsFileContentInfoFactory implements FileContentInfoFactory
+{
+    private static final String CONTENT = "text/plain";
+    private static final String ENCODING = "UTF-8";
+
+    /**
+     * Creates a FileContentInfo for a the given FileContent.
+     * 
+     * @param fileContent
+     *            Use this FileContent to create a matching FileContentInfo
+     * @return a FileContentInfo for the given FileContent with content set to "text/plain" and encoding set to "UTF-8"
+     * @throws FileSystemException
+     *             when a problem occurs creating the FileContentInfo.
+     */
+    @Override
+    public FileContentInfo create(final FileContent fileContent) throws FileSystemException
+    {
+        return new DefaultFileContentInfo(CONTENT, ENCODING);
+    }
+
+}

Modified: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileObject.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileObject.java?rev=1431079&r1=1431078&r2=1431079&view=diff
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileObject.java (original)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileObject.java Wed Jan  9 21:11:26 2013
@@ -6,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,6 +21,7 @@ import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.commons.vfs2.FileNotFolderException;
 import org.apache.commons.vfs2.FileObject;
 import org.apache.commons.vfs2.FileSystemException;
 import org.apache.commons.vfs2.FileType;
@@ -32,178 +33,322 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
-public class HdfsFileObject extends AbstractFileObject {
+/**
+ * A VFS representation of an HDFS file.
+ * 
+ * @since 2.1
+ */
+public class HdfsFileObject extends AbstractFileObject
+{
+    private final HdfsFileSystem fs;
+    private final FileSystem hdfs;
+    private final Path path;
+    private FileStatus stat;
+
+    /**
+     * Constructs a new HDFS FileObject
+     * 
+     * @param name
+     *            FileName
+     * @param fs
+     *            HdfsFileSystem instance
+     * @param hdfs
+     *            Hadoop FileSystem instance
+     * @param p
+     *            Path to the file in HDFS
+     */
+    protected HdfsFileObject(final AbstractFileName name, final HdfsFileSystem fs, final FileSystem hdfs, final Path p)
+    {
+        super(name, fs);
+        this.fs = fs;
+        this.hdfs = hdfs;
+        this.path = p;
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#canRenameTo(org.apache.commons.vfs2.FileObject)
+     */
+    @Override
+    public boolean canRenameTo(final FileObject newfile)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doAttach()
+     */
+    @Override
+    protected void doAttach() throws Exception
+    {
+        try
+        {
+            this.stat = this.hdfs.getFileStatus(this.path);
+        }
+        catch (final FileNotFoundException e)
+        {
+            this.stat = null;
+            return;
+        }
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetAttributes()
+     */
+    @Override
+    protected Map<String, Object> doGetAttributes() throws Exception
+    {
+        if (null == this.stat)
+        {
+            return super.doGetAttributes();
+        }
+        else
+        {
+            final Map<String, Object> attrs = new HashMap<String, Object>();
+            attrs.put(HdfsFileAttributes.LAST_ACCESS_TIME.toString(), this.stat.getAccessTime());
+            attrs.put(HdfsFileAttributes.BLOCK_SIZE.toString(), this.stat.getBlockSize());
+            attrs.put(HdfsFileAttributes.GROUP.toString(), this.stat.getGroup());
+            attrs.put(HdfsFileAttributes.OWNER.toString(), this.stat.getOwner());
+            attrs.put(HdfsFileAttributes.PERMISSIONS.toString(), this.stat.getPermission().toString());
+            attrs.put(HdfsFileAttributes.LENGTH.toString(), this.stat.getLen());
+            attrs.put(HdfsFileAttributes.MODIFICATION_TIME.toString(), this.stat.getModificationTime());
+            return attrs;
+        }
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetContentSize()
+     */
+    @Override
+    protected long doGetContentSize() throws Exception
+    {
+        return stat.getLen();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetInputStream()
+     */
+    @Override
+    protected InputStream doGetInputStream() throws Exception
+    {
+        return this.hdfs.open(this.path);
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetLastModifiedTime()
+     */
+    @Override
+    protected long doGetLastModifiedTime() throws Exception
+    {
+        if (null != this.stat)
+        {
+            return this.stat.getModificationTime();
+        }
+        else
+        {
+            return -1;
+        }
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetRandomAccessContent
+     *      (org.apache.commons.vfs2.util.RandomAccessMode)
+     */
+    @Override
+    protected RandomAccessContent doGetRandomAccessContent(final RandomAccessMode mode) throws Exception
+    {
+        if (mode.equals(RandomAccessMode.READWRITE))
+        {
+            throw new UnsupportedOperationException();
+        }
+        return new HdfsRandomAccessContent(this.path, this.hdfs);
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetType()
+     */
+    @Override
+    protected FileType doGetType() throws Exception
+    {
+        try
+        {
+            doAttach();
+            if (null == stat)
+            {
+                return FileType.IMAGINARY;
+            }
+            if (stat.isDir())
+            {
+                return FileType.FOLDER;
+            }
+            else
+            {
+                return FileType.FILE;
+            }
+        }
+        catch (final FileNotFoundException fnfe)
+        {
+            return FileType.IMAGINARY;
+        }
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doIsHidden()
+     */
+    @Override
+    protected boolean doIsHidden() throws Exception
+    {
+        return false;
+    }
 
-  public static final String LAST_ACCESS_TIME = "LAST_ACCESS_TIME";
-  public static final String BLOCK_SIZE = "BLOCK_SIZE";
-  public static final String GROUP = "GROUP";
-  public static final String OWNER = "OWNER";
-  public static final String PERMISSIONS = "PERMISSIONS";
-  public static final String LENGTH = "LENGTH";
-  public static final String MODIFICATION_TIME = "MODIFICATION_TIME";
-  
-  private ReadOnlyHdfsFileSystem fs = null;
-  private FileSystem hdfs = null;
-  private Path path = null;
-  private FileStatus stat = null;
-  
-  protected HdfsFileObject(AbstractFileName name, ReadOnlyHdfsFileSystem fs, FileSystem hdfs, Path p) {
-    super(name,fs);
-    this.fs = fs;
-    this.hdfs = hdfs;
-    this.path = p;
-  }
-
-  @Override
-  protected void doAttach() throws Exception {
-      this.stat = this.hdfs.getFileStatus(this.path);
-  }
-
-  @Override
-  protected FileType doGetType() throws Exception {
-    doAttach();
-    if (stat.isDir())
-      return FileType.FOLDER;
-    else
-      return FileType.FILE;
-  }
-  
-  @Override
-  public boolean exists() throws FileSystemException {
-    try {
-      doAttach();
-      return this.stat != null;
-    } catch (FileNotFoundException fne) {
-      return false;
-    } catch (Exception e) {
-      throw new FileSystemException("Unable to check existance ", e);
-    } 
-  }
-
-  @Override
-  public boolean canRenameTo(FileObject newfile) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  protected String[] doListChildren() throws Exception {
-      FileStatus[] files = this.hdfs.listStatus(this.path);
-      String[] children = new String[files.length];
-      int i = 0;
-      for (FileStatus status : files) {
-        children[i++] = status.getPath().getName();
-      }
-      return children;
-  }
-
-  @Override
-  protected long doGetContentSize() throws Exception {
-      return stat.getLen();
-  }
-
-  @Override
-  protected InputStream doGetInputStream() throws Exception {
-    return this.hdfs.open(this.path);
-  }
-
-  @Override
-  protected boolean doIsHidden() throws Exception {
-    return false;
-  }
-
-  @Override
-  protected boolean doIsReadable() throws Exception {
-    return true;
-  }
-
-  @Override
-  protected boolean doIsWriteable() throws Exception {
-    return false;
-  }
-
-  @Override
-  protected FileObject[] doListChildrenResolved() throws Exception {
-    String[] children = doListChildren();
-    FileObject[] fo = new FileObject[children.length];
-    for (int i = 0; i < children.length; i++) {
-      Path p = new Path(this.path, children[i]);
-      fo[i] = this.fs.resolveFile(p.toUri().toString());
-    }
-    return fo;
-  }
-
-  @Override
-  protected long doGetLastModifiedTime() throws Exception {
-    if (null != this.stat)
-      return this.stat.getModificationTime();
-    else
-      return -1;
-  }
-
-  @Override
-  protected boolean doSetLastModifiedTime(long modtime) throws Exception {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  protected Map<String,Object> doGetAttributes() throws Exception {
-    if (null == this.stat)
-      return super.doGetAttributes();
-    else {
-      Map<String,Object> attrs = new HashMap<String,Object>();
-      attrs.put(LAST_ACCESS_TIME, this.stat.getAccessTime());
-      attrs.put(BLOCK_SIZE, this.stat.getBlockSize());
-      attrs.put(GROUP, this.stat.getGroup());
-      attrs.put(OWNER, this.stat.getOwner());
-      attrs.put(PERMISSIONS, this.stat.getPermission().toString());
-      attrs.put(LENGTH, this.stat.getLen());
-      attrs.put(MODIFICATION_TIME, this.stat.getModificationTime());
-      return attrs;
-    }
-  }
-
-  @Override
-  protected void doSetAttribute(String attrName, Object value) throws Exception {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  protected void doRemoveAttribute(String attrName) throws Exception {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  protected RandomAccessContent doGetRandomAccessContent(RandomAccessMode mode) throws Exception {
-    if (mode.equals(RandomAccessMode.READWRITE))
-      throw new UnsupportedOperationException();
-    return new HdfsReadOnlyRandomAccessContent(this.path, this.hdfs);
-  }
-
-  @Override
-  protected boolean doIsSameFile(FileObject destFile) throws FileSystemException {
-    throw new UnsupportedOperationException();
-  }
-  
-  @Override
-  public boolean equals(Object o) {
-    if (null == o) return false;
-    if (o == this) return true;
-    if (o instanceof HdfsFileObject) {
-      HdfsFileObject other = (HdfsFileObject) o;
-      try {
-        if (other.getURL().equals(this.getURL()))
-          return true;
-      } catch (FileSystemException e) {
-        //TODO: log error
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doIsReadable()
+     */
+    @Override
+    protected boolean doIsReadable() throws Exception
+    {
+        return true;
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doIsSameFile(org.apache.commons.vfs2.FileObject)
+     */
+    @Override
+    protected boolean doIsSameFile(final FileObject destFile) throws FileSystemException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doIsWriteable()
+     */
+    @Override
+    protected boolean doIsWriteable() throws Exception
+    {
         return false;
-      }
     }
-    return false;
-  }
 
-  @Override
-  public int hashCode() {
-    return this.path.getName().toString().hashCode();
-  }
-  
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doListChildren()
+     */
+    @Override
+    protected String[] doListChildren() throws Exception
+    {
+        if (this.doGetType() != FileType.FOLDER)
+        {
+            throw new FileNotFolderException(this);
+        }
+
+        final FileStatus[] files = this.hdfs.listStatus(this.path);
+        final String[] children = new String[files.length];
+        int i = 0;
+        for (final FileStatus status : files)
+        {
+            children[i++] = status.getPath().getName();
+        }
+        return children;
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doListChildrenResolved()
+     */
+    @Override
+    protected FileObject[] doListChildrenResolved() throws Exception
+    {
+        if (this.doGetType() != FileType.FOLDER)
+        {
+            return null;
+        }
+        final String[] children = doListChildren();
+        final FileObject[] fo = new FileObject[children.length];
+        for (int i = 0; i < children.length; i++)
+        {
+            final Path p = new Path(this.path, children[i]);
+            fo[i] = this.fs.resolveFile(p.toUri().toString());
+        }
+        return fo;
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doRemoveAttribute(java.lang.String)
+     */
+    @Override
+    protected void doRemoveAttribute(final String attrName) throws Exception
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doSetAttribute(java.lang.String, java.lang.Object)
+     */
+    @Override
+    protected void doSetAttribute(final String attrName, final Object value) throws Exception
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doSetLastModifiedTime(long)
+     */
+    @Override
+    protected boolean doSetLastModifiedTime(final long modtime) throws Exception
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(final Object o)
+    {
+        if (null == o)
+        {
+            return false;
+        }
+        if (o == this)
+        {
+            return true;
+        }
+        if (o instanceof HdfsFileObject)
+        {
+            final HdfsFileObject other = (HdfsFileObject) o;
+            if (other.path.equals(this.path))
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists()
+     * @return boolean true if file exists, false if not
+     */
+    @Override
+    public boolean exists() throws FileSystemException
+    {
+        try
+        {
+            doAttach();
+            return this.stat != null;
+        }
+        catch (final FileNotFoundException fne)
+        {
+            return false;
+        }
+        catch (final Exception e)
+        {
+            throw new FileSystemException("Unable to check existance ", e);
+        }
+    }
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        return this.path.getName().toString().hashCode();
+    }
+
 }

Added: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileProvider.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileProvider.java?rev=1431079&view=auto
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileProvider.java (added)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileProvider.java Wed Jan  9 21:11:26 2013
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.start.classloader.vfs.providers;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.apache.commons.vfs2.Capability;
+import org.apache.commons.vfs2.FileName;
+import org.apache.commons.vfs2.FileSystem;
+import org.apache.commons.vfs2.FileSystemConfigBuilder;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider;
+import org.apache.commons.vfs2.provider.http.HttpFileNameParser;
+
+/**
+ * FileProvider for HDFS files.
+ * 
+ * @since 2.1
+ */
+public class HdfsFileProvider extends AbstractOriginatingFileProvider
+{
+    protected static final Collection<Capability> CAPABILITIES = Collections.unmodifiableCollection(Arrays
+            .asList(new Capability[]
+            {
+                    Capability.GET_TYPE,
+                    Capability.READ_CONTENT,
+                    Capability.URI,
+                    Capability.GET_LAST_MODIFIED,
+                    Capability.ATTRIBUTES,
+                    Capability.RANDOM_ACCESS_READ,
+                    Capability.DIRECTORY_READ_CONTENT,
+                    Capability.LIST_CHILDREN }));
+
+    /**
+     * Constructs a new HdfsFileProvider
+     */
+    public HdfsFileProvider()
+    {
+        super();
+        this.setFileNameParser(HttpFileNameParser.getInstance());
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider#
+     *      doCreateFileSystem(org.apache.commons.vfs2.FileName, org.apache.commons.vfs2.FileSystemOptions)
+     */
+    @Override
+    protected FileSystem doCreateFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions)
+            throws FileSystemException
+    {
+        return new HdfsFileSystem(rootName, fileSystemOptions);
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.FileProvider#getCapabilities()
+     */
+    @Override
+    public Collection<Capability> getCapabilities()
+    {
+        return CAPABILITIES;
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileProvider#getConfigBuilder()
+     */
+    @Override
+    public FileSystemConfigBuilder getConfigBuilder()
+    {
+        return HdfsFileSystemConfigBuilder.getInstance();
+    }
+
+}

Added: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java?rev=1431079&view=auto
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java (added)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java Wed Jan  9 21:11:26 2013
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.start.classloader.vfs.providers;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Collection;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.vfs2.CacheStrategy;
+import org.apache.commons.vfs2.Capability;
+import org.apache.commons.vfs2.FileName;
+import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.provider.AbstractFileName;
+import org.apache.commons.vfs2.provider.AbstractFileSystem;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+
+/**
+ * A VFS FileSystem that interacts with HDFS.
+ * 
+ * @since 2.1
+ */
+public class HdfsFileSystem extends AbstractFileSystem
+{
+    private static final Log log = LogFactory.getLog(HdfsFileSystem.class);
+
+    private FileSystem fs;
+
+    /**
+     * 
+     * @param rootName
+     * @param fileSystemOptions
+     */
+    protected HdfsFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions)
+    {
+        super(rootName, null, fileSystemOptions);
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileSystem#addCapabilities(java .util.Collection)
+     */
+    @Override
+    protected void addCapabilities(final Collection<Capability> capabilities)
+    {
+        capabilities.addAll(HdfsFileProvider.CAPABILITIES);
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileSystem#close()
+     */
+    @Override
+    public void close()
+    {
+        try
+        {
+            if (null != fs)
+            {
+                fs.close();
+            }
+        }
+        catch (final IOException e)
+        {
+            throw new RuntimeException("Error closing HDFS client", e);
+        }
+        super.close();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileSystem#createFile(org.apache
+     *      .commons.vfs2.provider.AbstractFileName)
+     */
+    @Override
+    protected FileObject createFile(final AbstractFileName name) throws Exception
+    {
+        throw new FileSystemException("Operation not supported");
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileSystem#resolveFile(org.apache .commons.vfs2.FileName)
+     */
+    @Override
+    public FileObject resolveFile(final FileName name) throws FileSystemException
+    {
+
+        synchronized (this)
+        {
+            if (null == this.fs)
+            {
+                final String hdfsUri = name.getRootURI();
+                final Configuration conf = new Configuration(true);
+                conf.set(org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY, hdfsUri);
+                this.fs = null;
+                try
+                {
+                    fs = org.apache.hadoop.fs.FileSystem.get(conf);
+                }
+                catch (final IOException e)
+                {
+                    log.error("Error connecting to filesystem " + hdfsUri, e);
+                    throw new FileSystemException("Error connecting to filesystem " + hdfsUri, e);
+                }
+            }
+        }
+
+        boolean useCache = (null != getContext().getFileSystemManager().getFilesCache());
+        FileObject file;
+        if (useCache)
+        {
+            file = this.getFileFromCache(name);
+        }
+        else
+        {
+            file = null;
+        }
+        if (null == file)
+        {
+            String path = null;
+            try
+            {
+                path = URLDecoder.decode(name.getPath(), "UTF-8");
+            }
+            catch (final UnsupportedEncodingException e)
+            {
+                path = name.getPath();
+            }
+            final Path filePath = new Path(path);
+            file = new HdfsFileObject((AbstractFileName) name, this, fs, filePath);
+            if (useCache)
+            {
+        this.putFileToCache(file);
+            }
+      
+    }
+    
+    /**
+     * resync the file information if requested
+     */
+    if (getFileSystemManager().getCacheStrategy().equals(CacheStrategy.ON_RESOLVE)) {
+      file.refresh();
+    }
+    
+    return file;
+  }
+
+}

Modified: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystemConfigBuilder.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystemConfigBuilder.java?rev=1431079&r1=1431078&r2=1431079&view=diff
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystemConfigBuilder.java (original)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystemConfigBuilder.java Wed Jan  9 21:11:26 2013
@@ -6,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,27 +19,30 @@ package org.apache.accumulo.start.classl
 import org.apache.commons.vfs2.FileSystem;
 import org.apache.commons.vfs2.FileSystemConfigBuilder;
 
-public class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
+/**
+ * Configuration settings for the HdfsFileSystem.
+ * 
+ * @since 2.1
+ */
+public class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder
+{
+    private static final HdfsFileSystemConfigBuilder BUILDER = new HdfsFileSystemConfigBuilder();
 
-  private final static HdfsFileSystemConfigBuilder BUILDER = new HdfsFileSystemConfigBuilder(); 
-  
-  private String hdfsUri = null;
-  
-  public String getHdfsUri() {
-    return hdfsUri;
-  }
+    /**
+     * @return HdfsFileSystemConfigBuilder instance
+     */
+    public static HdfsFileSystemConfigBuilder getInstance()
+    {
+        return BUILDER;
+    }
 
-  public void setHdfsUri(String hdfsUri) {
-    this.hdfsUri = hdfsUri;
-  }
+    /**
+     * @return HDFSFileSystem
+     */
+    @Override
+    protected Class<? extends FileSystem> getConfigClass()
+    {
+        return HdfsFileSystem.class;
+    }
 
-  @Override
-  protected Class<? extends FileSystem> getConfigClass() {
-    return ReadOnlyHdfsFileSystem.class;
-  }
-  
-  public static HdfsFileSystemConfigBuilder getInstance() {
-    return BUILDER;
-  }
-  
 }

Added: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java?rev=1431079&view=auto
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java (added)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java Wed Jan  9 21:11:26 2013
@@ -0,0 +1,362 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.start.classloader.vfs.providers;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.vfs2.RandomAccessContent;
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+
+/**
+ * Provides random access to content in an HdfsFileObject. Currently this only supports read operations. All write
+ * operations throw an {@link UnsupportedOperationException}.
+ * 
+ * @since 2.1
+ */
+public class HdfsRandomAccessContent implements RandomAccessContent
+{
+    private final FileSystem fs;
+    private final Path path;
+    private final FSDataInputStream fis;
+
+    /**
+     * 
+     * @param path
+     *            A Hadoop Path
+     * @param fs
+     *            A Hadoop FileSystem
+     * @throws IOException
+     *             when the path cannot be processed.
+     */
+    public HdfsRandomAccessContent(final Path path, final FileSystem fs) throws IOException
+    {
+        this.fs = fs;
+        this.path = path;
+        this.fis = this.fs.open(this.path);
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.RandomAccessContent#close()
+     */
+    @Override
+    public void close() throws IOException
+    {
+        this.fis.close();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.RandomAccessContent#getFilePointer()
+     */
+    @Override
+    public long getFilePointer() throws IOException
+    {
+        return this.fis.getPos();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.RandomAccessContent#getInputStream()
+     */
+    @Override
+    public InputStream getInputStream() throws IOException
+    {
+        return this.fis;
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.RandomAccessContent#length()
+     */
+    @Override
+    public long length() throws IOException
+    {
+        return this.fs.getFileStatus(this.path).getLen();
+    }
+
+    /**
+     * @see java.io.DataInput#readBoolean()
+     */
+    @Override
+    public boolean readBoolean() throws IOException
+    {
+        return this.fis.readBoolean();
+    }
+
+    /**
+     * @see java.io.DataInput#readByte()
+     */
+    @Override
+    public byte readByte() throws IOException
+    {
+        return this.fis.readByte();
+    }
+
+    /**
+     * @see java.io.DataInput#readChar()
+     */
+    @Override
+    public char readChar() throws IOException
+    {
+        return this.fis.readChar();
+    }
+
+    /**
+     * @see java.io.DataInput#readDouble()
+     */
+    @Override
+    public double readDouble() throws IOException
+    {
+        return this.fis.readDouble();
+    }
+
+    /**
+     * @see java.io.DataInput#readFloat()
+     */
+    @Override
+    public float readFloat() throws IOException
+    {
+        return this.fis.readFloat();
+    }
+
+    /**
+     * @see java.io.DataInput#readFully(byte[])
+     */
+    @Override
+    public void readFully(final byte[] b) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataInput#readFully(byte[], int, int)
+     */
+    @Override
+    public void readFully(final byte[] b, final int off, final int len) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataInput#readInt()
+     */
+    @Override
+    public int readInt() throws IOException
+    {
+        return this.fis.readInt();
+    }
+
+    /**
+     * @see java.io.DataInput#readLine()
+     */
+    @Override
+    @SuppressWarnings("deprecation")
+    public String readLine() throws IOException
+    {
+        return this.fis.readLine();
+    }
+
+    /**
+     * @see java.io.DataInput#readLong()
+     */
+    @Override
+    public long readLong() throws IOException
+    {
+        return this.fis.readLong();
+    }
+
+    /**
+     * @see java.io.DataInput#readShort()
+     */
+    @Override
+    public short readShort() throws IOException
+    {
+        return this.fis.readShort();
+    }
+
+    /**
+     * @see java.io.DataInput#readUnsignedByte()
+     */
+    @Override
+    public int readUnsignedByte() throws IOException
+    {
+        return this.fis.readUnsignedByte();
+    }
+
+    /**
+     * @see java.io.DataInput#readUnsignedShort()
+     */
+    @Override
+    public int readUnsignedShort() throws IOException
+    {
+        return this.fis.readUnsignedShort();
+    }
+
+    /**
+     * @see java.io.DataInput#readUTF()
+     */
+    @Override
+    public String readUTF() throws IOException
+    {
+        return this.fis.readUTF();
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.RandomAccessContent#seek(long)
+     */
+    @Override
+    public void seek(final long pos) throws IOException
+    {
+        this.fis.seek(pos);
+    }
+
+    /**
+     * @see java.io.DataInput#skipBytes(int)
+     */
+    @Override
+    public int skipBytes(final int n) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#write(byte[])
+     */
+    @Override
+    public void write(final byte[] b) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#write(byte[], int, int)
+     */
+    @Override
+    public void write(final byte[] b, final int off, final int len) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#write(int)
+     */
+    @Override
+    public void write(final int b) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeBoolean(boolean)
+     */
+    @Override
+    public void writeBoolean(final boolean v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeByte(int)
+     */
+    @Override
+    public void writeByte(final int v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeBytes(java.lang.String)
+     */
+    @Override
+    public void writeBytes(final String s) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeChar(int)
+     */
+    @Override
+    public void writeChar(final int v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeChars(java.lang.String)
+     */
+    @Override
+    public void writeChars(final String s) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeDouble(double)
+     */
+    @Override
+    public void writeDouble(final double v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeFloat(float)
+     */
+    @Override
+    public void writeFloat(final float v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeInt(int)
+     */
+    @Override
+    public void writeInt(final int v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeLong(long)
+     */
+    @Override
+    public void writeLong(final long v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeShort(int)
+     */
+    @Override
+    public void writeShort(final int v) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see java.io.DataOutput#writeUTF(java.lang.String)
+     */
+    @Override
+    public void writeUTF(final String s) throws IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+}

Added: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/package.html
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/package.html?rev=1431079&view=auto
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/package.html (added)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/package.html Wed Jan  9 21:11:26 2013
@@ -0,0 +1,19 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<body>
+<p>The HDFS File Provider</p>
+</body>

Modified: accumulo/trunk/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java?rev=1431079&r1=1431078&r2=1431079&view=diff
==============================================================================
--- accumulo/trunk/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java (original)
+++ accumulo/trunk/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java Wed Jan  9 21:11:26 2013
@@ -19,8 +19,6 @@ package org.apache.accumulo.start.classl
 import java.io.IOException;
 import java.util.Map;
 
-import org.apache.accumulo.start.classloader.vfs.providers.HdfsFileObject;
-import org.apache.accumulo.start.classloader.vfs.providers.ReadOnlyHdfsFileProvider;
 import org.apache.accumulo.test.AccumuloDFSBase;
 import org.apache.commons.vfs2.FileObject;
 import org.apache.commons.vfs2.FileSystemException;
@@ -47,7 +45,7 @@ public class ReadOnlyHdfsFileProviderTes
   @Before
   public void setup() throws Exception {
     manager = new DefaultFileSystemManager();
-    manager.addProvider("hdfs", new ReadOnlyHdfsFileProvider());
+    manager.addProvider("hdfs", new HdfsFileProvider());
     manager.init();
     this.hdfs = cluster.getFileSystem();
   }
@@ -192,13 +190,13 @@ public class ReadOnlyHdfsFileProviderTes
     //Create the test file
     FileObject file = createTestFile(hdfs);
     Map<String,Object> attributes = file.getContent().getAttributes();
-    Assert.assertTrue(attributes.containsKey(HdfsFileObject.BLOCK_SIZE));
-    Assert.assertTrue(attributes.containsKey(HdfsFileObject.GROUP));
-    Assert.assertTrue(attributes.containsKey(HdfsFileObject.LAST_ACCESS_TIME));
-    Assert.assertTrue(attributes.containsKey(HdfsFileObject.LENGTH));
-    Assert.assertTrue(attributes.containsKey(HdfsFileObject.MODIFICATION_TIME));
-    Assert.assertTrue(attributes.containsKey(HdfsFileObject.OWNER));
-    Assert.assertTrue(attributes.containsKey(HdfsFileObject.PERMISSIONS));
+    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.BLOCK_SIZE.toString()));
+    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.GROUP.toString()));
+    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LAST_ACCESS_TIME.toString()));
+    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LENGTH.toString()));
+    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.MODIFICATION_TIME.toString()));
+    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.OWNER.toString()));
+    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.PERMISSIONS.toString()));
   }
   
   @Test(expected=FileSystemException.class)

Modified: accumulo/trunk/start/src/test/java/org/apache/accumulo/test/AccumuloDFSBase.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/test/java/org/apache/accumulo/test/AccumuloDFSBase.java?rev=1431079&r1=1431078&r2=1431079&view=diff
==============================================================================
--- accumulo/trunk/start/src/test/java/org/apache/accumulo/test/AccumuloDFSBase.java (original)
+++ accumulo/trunk/start/src/test/java/org/apache/accumulo/test/AccumuloDFSBase.java Wed Jan  9 21:11:26 2013
@@ -21,7 +21,7 @@ import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.URI;
 
-import org.apache.accumulo.start.classloader.vfs.providers.ReadOnlyHdfsFileProvider;
+import org.apache.accumulo.start.classloader.vfs.providers.HdfsFileProvider;
 import org.apache.commons.vfs2.CacheStrategy;
 import org.apache.commons.vfs2.FileSystemException;
 import org.apache.commons.vfs2.cache.DefaultFilesCache;
@@ -122,7 +122,7 @@ public class AccumuloDFSBase {
       vfs.addProvider("tbz2", new org.apache.commons.vfs2.provider.tar.TarFileProvider());
       vfs.addProvider("tgz", new org.apache.commons.vfs2.provider.tar.TarFileProvider());
       vfs.addProvider("bz2", new org.apache.commons.vfs2.provider.bzip2.Bzip2FileProvider());
-      vfs.addProvider("hdfs", new ReadOnlyHdfsFileProvider());
+      vfs.addProvider("hdfs", new HdfsFileProvider());
       vfs.addExtensionMap("jar", "jar");
       vfs.addExtensionMap("zip", "zip");
       vfs.addExtensionMap("gz", "gz");



Mime
View raw message