org.apache.hadoop.hdfs
Class HftpFileSystem

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.hadoop.fs.FileSystem
          extended by org.apache.hadoop.hdfs.HftpFileSystem
All Implemented Interfaces:
Closeable, org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
HsftpFileSystem

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class HftpFileSystem
extends org.apache.hadoop.fs.FileSystem

An implementation of a protocol for accessing filesystems over HTTP. The following implementation provides a limited, read-only interface to a filesystem over HTTP.

See Also:
ListPathsServlet, FileDataServlet

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.FileSystem.Statistics
 
Field Summary
protected static ThreadLocal<SimpleDateFormat> df
           
static String HFTP_DATE_FORMAT
           
static String HFTP_TIMEZONE
           
protected  InetSocketAddress nnAddr
           
protected  Random ran
           
protected  org.apache.hadoop.security.UserGroupInformation ugi
           
 
Fields inherited from class org.apache.hadoop.fs.FileSystem
DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, statistics
 
Constructor Summary
HftpFileSystem()
           
 
Method Summary
 org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path f, int bufferSize, org.apache.hadoop.util.Progressable progress)
          This optional operation is not yet supported.
 org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress)
           
 boolean delete(org.apache.hadoop.fs.Path f, boolean recursive)
           
 org.apache.hadoop.fs.ContentSummary getContentSummary(org.apache.hadoop.fs.Path f)
          
static SimpleDateFormat getDateFormat()
           
 org.apache.hadoop.fs.FileChecksum getFileChecksum(org.apache.hadoop.fs.Path f)
          
 org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
           
 URI getUri()
           
 org.apache.hadoop.fs.Path getWorkingDirectory()
           
 void initialize(URI name, org.apache.hadoop.conf.Configuration conf)
           
 org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
           
 boolean mkdirs(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsPermission permission)
           
 org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f, int buffersize)
           
protected  HttpURLConnection openConnection(String path, String query)
          Open an HTTP connection to the namenode to read file data and metadata.
 boolean rename(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst)
           
 void setWorkingDirectory(org.apache.hadoop.fs.Path f)
           
 
Methods inherited from class org.apache.hadoop.fs.FileSystem
append, append, checkPath, clearStatistics, close, closeAll, completeLocalOutput, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, createNewFile, delete, deleteOnExit, exists, get, get, get, getAllStatistics, getBlockSize, getDefaultBlockSize, getDefaultReplication, getDefaultUri, getFileBlockLocations, getFileBlockLocations, getHomeDirectory, getInitialWorkingDirectory, getLength, getLocal, getName, getNamed, getReplication, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getUsed, globStatus, globStatus, isDirectory, isFile, listStatus, listStatus, listStatus, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, rename, setDefaultUri, setDefaultUri, setOwner, setPermission, setReplication, setTimes, setVerifyChecksum, startLocalOutput
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nnAddr

protected InetSocketAddress nnAddr

ugi

protected org.apache.hadoop.security.UserGroupInformation ugi

ran

protected final Random ran

HFTP_TIMEZONE

public static final String HFTP_TIMEZONE
See Also:
Constant Field Values

HFTP_DATE_FORMAT

public static final String HFTP_DATE_FORMAT
See Also:
Constant Field Values

df

protected static final ThreadLocal<SimpleDateFormat> df
Constructor Detail

HftpFileSystem

public HftpFileSystem()
Method Detail

getDateFormat

public static final SimpleDateFormat getDateFormat()

initialize

public void initialize(URI name,
                       org.apache.hadoop.conf.Configuration conf)
                throws IOException
Overrides:
initialize in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

getUri

public URI getUri()
Specified by:
getUri in class org.apache.hadoop.fs.FileSystem

openConnection

protected HttpURLConnection openConnection(String path,
                                           String query)
                                    throws IOException
Open an HTTP connection to the namenode to read file data and metadata.

Parameters:
path - The path component of the URL
query - The query component of the URL
Throws:
IOException

open

public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f,
                                                   int buffersize)
                                            throws IOException
Specified by:
open in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

listStatus

public org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
                                             throws IOException
Specified by:
listStatus in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

getFileStatus

public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
                                              throws IOException
Specified by:
getFileStatus in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

getFileChecksum

public org.apache.hadoop.fs.FileChecksum getFileChecksum(org.apache.hadoop.fs.Path f)
                                                  throws IOException

Overrides:
getFileChecksum in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

getWorkingDirectory

public org.apache.hadoop.fs.Path getWorkingDirectory()
Specified by:
getWorkingDirectory in class org.apache.hadoop.fs.FileSystem

setWorkingDirectory

public void setWorkingDirectory(org.apache.hadoop.fs.Path f)
Specified by:
setWorkingDirectory in class org.apache.hadoop.fs.FileSystem

append

public org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path f,
                                                      int bufferSize,
                                                      org.apache.hadoop.util.Progressable progress)
                                               throws IOException
This optional operation is not yet supported.

Specified by:
append in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

create

public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path f,
                                                      org.apache.hadoop.fs.permission.FsPermission permission,
                                                      boolean overwrite,
                                                      int bufferSize,
                                                      short replication,
                                                      long blockSize,
                                                      org.apache.hadoop.util.Progressable progress)
                                               throws IOException
Specified by:
create in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

rename

public boolean rename(org.apache.hadoop.fs.Path src,
                      org.apache.hadoop.fs.Path dst)
               throws IOException
Specified by:
rename in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

delete

public boolean delete(org.apache.hadoop.fs.Path f,
                      boolean recursive)
               throws IOException
Specified by:
delete in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

mkdirs

public boolean mkdirs(org.apache.hadoop.fs.Path f,
                      org.apache.hadoop.fs.permission.FsPermission permission)
               throws IOException
Specified by:
mkdirs in class org.apache.hadoop.fs.FileSystem
Throws:
IOException

getContentSummary

public org.apache.hadoop.fs.ContentSummary getContentSummary(org.apache.hadoop.fs.Path f)
                                                      throws IOException

Overrides:
getContentSummary in class org.apache.hadoop.fs.FileSystem
Throws:
IOException


Copyright © 2009 The Apache Software Foundation