org.apache.hadoop.fs
Class ProxyFileSystem

java.lang.Object
  extended by FilterFileSystem
      extended by org.apache.hadoop.fs.ProxyFileSystem

public class ProxyFileSystem
extends FilterFileSystem

A FileSystem that can serve a given scheme/authority using some other file system. In that sense, it serves as a proxy for the real/underlying file system


Field Summary
protected  String myAuthority
           
protected  String myScheme
           
protected  URI myUri
           
protected  String realAuthority
           
protected  String realScheme
           
protected  URI realUri
           
 
Constructor Summary
ProxyFileSystem()
           
ProxyFileSystem(FileSystem fs)
           
ProxyFileSystem(FileSystem fs, URI myUri)
          Create a proxy file system for fs.
 
Method Summary
 FSDataOutputStream append(Path f, int bufferSize, Progressable progress)
           
protected  void checkPath(Path path)
           
 void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile)
           
 void copyFromLocalFile(boolean delSrc, boolean overwrite, Path[] srcs, Path dst)
           
 void copyFromLocalFile(boolean delSrc, boolean overwrite, Path src, Path dst)
           
 void copyFromLocalFile(boolean delSrc, Path src, Path dst)
           
 void copyToLocalFile(boolean delSrc, Path src, Path dst)
           
 FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress)
           
 boolean delete(Path f, boolean recursive)
           
 boolean deleteOnExit(Path f)
           
 ContentSummary getContentSummary(Path f)
           
 BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len)
           
 FileChecksum getFileChecksum(Path f)
           
 FileStatus getFileStatus(Path f)
           
 Path getHomeDirectory()
           
 String getName()
           
 URI getUri()
           
 Path getWorkingDirectory()
           
 void initialize(URI name, Configuration conf)
           
 FileStatus[] listStatus(Path f)
           
 Path makeQualified(Path path)
           
 boolean mkdirs(Path f, FsPermission permission)
           
 FSDataInputStream open(Path f, int bufferSize)
           
 boolean rename(Path src, Path dst)
           
 Path resolvePath(Path p)
           
 void setOwner(Path p, String username, String groupname)
           
 void setPermission(Path p, FsPermission permission)
           
 boolean setReplication(Path src, short replication)
           
 void setTimes(Path p, long mtime, long atime)
           
 void setWorkingDirectory(Path newDir)
           
 Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myScheme

protected String myScheme

myAuthority

protected String myAuthority

myUri

protected URI myUri

realScheme

protected String realScheme

realAuthority

protected String realAuthority

realUri

protected URI realUri
Constructor Detail

ProxyFileSystem

public ProxyFileSystem()

ProxyFileSystem

public ProxyFileSystem(FileSystem fs)

ProxyFileSystem

public ProxyFileSystem(FileSystem fs,
                       URI myUri)
Create a proxy file system for fs.

Parameters:
fs - FileSystem to create proxy for
myUri - URI to use as proxy. Only the scheme and authority from this are used right now
Method Detail

resolvePath

public Path resolvePath(Path p)
                 throws IOException
Parameters:
p -
Returns:
Throws:
IOException

initialize

public void initialize(URI name,
                       Configuration conf)
                throws IOException
Throws:
IOException

getUri

public URI getUri()

getName

public String getName()

makeQualified

public Path makeQualified(Path path)

checkPath

protected void checkPath(Path path)

getFileBlockLocations

public BlockLocation[] getFileBlockLocations(FileStatus file,
                                             long start,
                                             long len)
                                      throws IOException
Throws:
IOException

open

public FSDataInputStream open(Path f,
                              int bufferSize)
                       throws IOException
Throws:
IOException

append

public FSDataOutputStream append(Path f,
                                 int bufferSize,
                                 Progressable progress)
                          throws IOException
Throws:
IOException

create

public FSDataOutputStream create(Path f,
                                 FsPermission permission,
                                 boolean overwrite,
                                 int bufferSize,
                                 short replication,
                                 long blockSize,
                                 Progressable progress)
                          throws IOException
Throws:
IOException

setReplication

public boolean setReplication(Path src,
                              short replication)
                       throws IOException
Throws:
IOException

rename

public boolean rename(Path src,
                      Path dst)
               throws IOException
Throws:
IOException

delete

public boolean delete(Path f,
                      boolean recursive)
               throws IOException
Throws:
IOException

deleteOnExit

public boolean deleteOnExit(Path f)
                     throws IOException
Throws:
IOException

listStatus

public FileStatus[] listStatus(Path f)
                        throws IOException
Throws:
IOException

getHomeDirectory

public Path getHomeDirectory()

setWorkingDirectory

public void setWorkingDirectory(Path newDir)

getWorkingDirectory

public Path getWorkingDirectory()

mkdirs

public boolean mkdirs(Path f,
                      FsPermission permission)
               throws IOException
Throws:
IOException

copyFromLocalFile

public void copyFromLocalFile(boolean delSrc,
                              Path src,
                              Path dst)
                       throws IOException
Throws:
IOException

copyFromLocalFile

public void copyFromLocalFile(boolean delSrc,
                              boolean overwrite,
                              Path[] srcs,
                              Path dst)
                       throws IOException
Throws:
IOException

copyFromLocalFile

public void copyFromLocalFile(boolean delSrc,
                              boolean overwrite,
                              Path src,
                              Path dst)
                       throws IOException
Throws:
IOException

copyToLocalFile

public void copyToLocalFile(boolean delSrc,
                            Path src,
                            Path dst)
                     throws IOException
Throws:
IOException

startLocalOutput

public Path startLocalOutput(Path fsOutputFile,
                             Path tmpLocalFile)
                      throws IOException
Throws:
IOException

completeLocalOutput

public void completeLocalOutput(Path fsOutputFile,
                                Path tmpLocalFile)
                         throws IOException
Throws:
IOException

getContentSummary

public ContentSummary getContentSummary(Path f)
                                 throws IOException
Throws:
IOException

getFileStatus

public FileStatus getFileStatus(Path f)
                         throws IOException
Throws:
IOException

getFileChecksum

public FileChecksum getFileChecksum(Path f)
                             throws IOException
Throws:
IOException

setOwner

public void setOwner(Path p,
                     String username,
                     String groupname)
              throws IOException
Throws:
IOException

setTimes

public void setTimes(Path p,
                     long mtime,
                     long atime)
              throws IOException
Throws:
IOException

setPermission

public void setPermission(Path p,
                          FsPermission permission)
                   throws IOException
Throws:
IOException


Copyright © 2012 The Apache Software Foundation