public class UnderFileSystemHdfs extends UnderFileSystem
UnderFileSystem.SpaceType| Modifier and Type | Method and Description |
|---|---|
void |
close() |
org.apache.hadoop.fs.FSDataOutputStream |
create(String path) |
org.apache.hadoop.fs.FSDataOutputStream |
create(String path,
int blockSizeByte)
BlockSize should be a multiple of 512
|
org.apache.hadoop.fs.FSDataOutputStream |
create(String path,
short replication,
int blockSizeByte) |
boolean |
delete(String path,
boolean recursive) |
boolean |
exists(String path) |
long |
getBlockSizeByte(String path) |
static UnderFileSystemHdfs |
getClient(String path) |
static UnderFileSystemHdfs |
getClient(String path,
Object conf) |
Object |
getConf()
To get the configuration object for UnderFileSystem.
|
List<String> |
getFileLocations(String path) |
List<String> |
getFileLocations(String path,
long offset) |
long |
getFileSize(String path) |
long |
getModificationTimeMs(String path) |
long |
getSpace(String path,
UnderFileSystem.SpaceType type) |
boolean |
isFile(String path) |
String[] |
list(String path)
Returns an array of strings naming the files and directories in the directory denoted by this
abstract pathname.
|
void |
login(String keytabFileKey,
String keytabFile,
String principalKey,
String principal,
String hostname) |
boolean |
mkdirs(String path,
boolean createParent)
Creates the directory named by this abstract pathname.
|
org.apache.hadoop.fs.FSDataInputStream |
open(String path) |
boolean |
rename(String src,
String dst) |
void |
setConf(Object conf)
To set the configuration object for UnderFileSystem.
|
void |
setPermission(String path,
String posixPerm)
Change posix file permission
|
get, get, parsepublic static UnderFileSystemHdfs getClient(String path)
public static UnderFileSystemHdfs getClient(String path, Object conf)
public void close()
throws IOException
close in class UnderFileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream create(String path) throws IOException
create in class UnderFileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream create(String path, int blockSizeByte) throws IOException
create in class UnderFileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream create(String path, short replication, int blockSizeByte) throws IOException
create in class UnderFileSystemIOExceptionpublic boolean delete(String path, boolean recursive) throws IOException
delete in class UnderFileSystemIOExceptionpublic boolean exists(String path) throws IOException
exists in class UnderFileSystemIOExceptionpublic long getBlockSizeByte(String path) throws IOException
getBlockSizeByte in class UnderFileSystemIOExceptionpublic Object getConf()
UnderFileSystemgetConf in class UnderFileSystempublic List<String> getFileLocations(String path) throws IOException
getFileLocations in class UnderFileSystemIOExceptionpublic List<String> getFileLocations(String path, long offset) throws IOException
getFileLocations in class UnderFileSystemIOExceptionpublic long getFileSize(String path) throws IOException
getFileSize in class UnderFileSystemIOExceptionpublic long getModificationTimeMs(String path) throws IOException
getModificationTimeMs in class UnderFileSystemIOExceptionpublic long getSpace(String path, UnderFileSystem.SpaceType type) throws IOException
getSpace in class UnderFileSystemIOExceptionpublic boolean isFile(String path) throws IOException
isFile in class UnderFileSystemIOExceptionpublic String[] list(String path) throws IOException
UnderFileSystem
If this abstract pathname does not denote a directory, then this method returns null.
Otherwise an array of strings is returned, one for each file or directory in the directory.
Names denoting the directory itself and the directory's parent directory are not included in
the result. Each string is a file name rather than a complete path.
There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
list in class UnderFileSystempath - the path to list.null if this abstract pathname does not denote a directory, or if an I/O error
occurs.IOExceptionpublic void login(String keytabFileKey, String keytabFile, String principalKey, String principal, String hostname) throws IOException
IOExceptionpublic boolean mkdirs(String path, boolean createParent) throws IOException
UnderFileSystemmkdirs in class UnderFileSystempath - the folder to createcreateParent - If true, the method creates any necessary but nonexistent parent
directories. Otherwise, the method does not create nonexistent parent directories.true if and only if the directory was created; false
otherwiseIOExceptionpublic org.apache.hadoop.fs.FSDataInputStream open(String path) throws IOException
open in class UnderFileSystemIOExceptionpublic boolean rename(String src, String dst) throws IOException
rename in class UnderFileSystemIOExceptionpublic void setConf(Object conf)
UnderFileSystemsetConf in class UnderFileSystemconf - The configuration object accepted by ufs.public void setPermission(String path, String posixPerm) throws IOException
UnderFileSystemsetPermission in class UnderFileSystempath - path of the fileposixPerm - standard posix permission like "777", "775", etc.IOExceptionCopyright © 2015. All Rights Reserved.