@ThreadSafe public final class S3UnderFileSystem extends UnderFileSystem
UnderFileSystem implementation based on the jets3t library.UnderFileSystem.SpaceTypeLISTING_LENGTH, mProperties, mUri| Modifier | Constructor and Description |
|---|---|
protected |
S3UnderFileSystem(AlluxioURI uri,
org.jets3t.service.S3Service s3Service,
String bucketName,
String bucketPrefix,
short bucketMode,
String accountOwner)
Constructor for
S3UnderFileSystem. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connectFromMaster(String hostname) |
void |
connectFromWorker(String hostname) |
OutputStream |
create(String path) |
OutputStream |
create(String path,
CreateOptions options) |
static S3UnderFileSystem |
createInstance(AlluxioURI uri)
Constructs a new instance of
S3UnderFileSystem. |
boolean |
delete(String path,
boolean recursive) |
boolean |
exists(String path) |
long |
getBlockSizeByte(String path)
Gets the block size in bytes.
|
Object |
getConf() |
List<String> |
getFileLocations(String path) |
List<String> |
getFileLocations(String path,
long offset) |
long |
getFileSize(String path) |
String |
getGroup(String path) |
short |
getMode(String path) |
long |
getModificationTimeMs(String path) |
String |
getOwner(String path) |
long |
getSpace(String path,
UnderFileSystem.SpaceType type) |
String |
getUnderFSType() |
boolean |
isFile(String path) |
String[] |
list(String path) |
boolean |
mkdirs(String path,
boolean createParent) |
boolean |
mkdirs(String path,
MkdirsOptions options) |
InputStream |
open(String path) |
InputStream |
openAtPosition(String path,
long pos)
Opens a S3 object at given position and returns the opened input stream.
|
boolean |
rename(String src,
String dst) |
void |
setConf(Object conf) |
void |
setMode(String path,
short mode) |
void |
setOwner(String path,
String user,
String group) |
boolean |
supportsFlush() |
configureProperties, get, get, getProperties, isHadoopUnderFS, listRecursive, parse, providesStorage, resolveUri, setPropertiesprotected S3UnderFileSystem(AlluxioURI uri, org.jets3t.service.S3Service s3Service, String bucketName, String bucketPrefix, short bucketMode, String accountOwner)
S3UnderFileSystem.uri - the AlluxioURI for this UFSs3Service - Jets3t S3 clientbucketName - bucket name of user's configured Alluxio bucketbucketPrefix - prefix of the bucketbucketMode - the permission mode that the account owner has to the bucketaccountOwner - the name of the account ownerpublic static S3UnderFileSystem createInstance(AlluxioURI uri) throws org.jets3t.service.ServiceException
S3UnderFileSystem.uri - the AlluxioURI for this UFSS3UnderFileSystem instanceorg.jets3t.service.ServiceException - when a connection to S3 could not be createdpublic String getUnderFSType()
getUnderFSType in class UnderFileSystempublic void close()
throws IOException
close in class UnderFileSystemIOExceptionpublic void connectFromMaster(String hostname)
connectFromMaster in class UnderFileSystempublic void connectFromWorker(String hostname)
connectFromWorker in class UnderFileSystempublic OutputStream create(String path) throws IOException
create in class UnderFileSystemIOExceptionpublic OutputStream create(String path, CreateOptions options) 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 UnderFileSystempath - the file nameIOException - this implementation will not throw this exception, but subclasses maypublic Object getConf()
getConf 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
list in class UnderFileSystemIOExceptionpublic boolean mkdirs(String path, boolean createParent) throws IOException
mkdirs in class UnderFileSystemIOExceptionpublic boolean mkdirs(String path, MkdirsOptions options) throws IOException
mkdirs in class UnderFileSystemIOExceptionpublic InputStream open(String path) throws IOException
open in class UnderFileSystemIOExceptionpublic InputStream openAtPosition(String path, long pos) throws IOException
path - the S3 object pathpos - the position to open atIOException - if failed to open file at positionpublic boolean rename(String src, String dst) throws IOException
rename in class UnderFileSystemIOExceptionpublic void setConf(Object conf)
setConf in class UnderFileSystempublic void setOwner(String path, String user, String group)
setOwner in class UnderFileSystempublic void setMode(String path, short mode) throws IOException
setMode in class UnderFileSystemIOExceptionpublic String getOwner(String path) throws IOException
getOwner in class UnderFileSystemIOExceptionpublic String getGroup(String path) throws IOException
getGroup in class UnderFileSystemIOExceptionpublic short getMode(String path) throws IOException
getMode in class UnderFileSystemIOExceptionpublic boolean supportsFlush()
supportsFlush in class UnderFileSystemCopyright © 2016. All Rights Reserved.