Package alluxio.underfs.oss
Class OSSUnderFileSystem
- java.lang.Object
-
- alluxio.underfs.BaseUnderFileSystem
-
- alluxio.underfs.ObjectUnderFileSystem
-
- alluxio.underfs.oss.OSSUnderFileSystem
-
- All Implemented Interfaces:
alluxio.underfs.AsyncUfsClient,alluxio.underfs.UnderFileSystem,java.io.Closeable,java.lang.AutoCloseable
@ThreadSafe public class OSSUnderFileSystem extends alluxio.underfs.ObjectUnderFileSystemAliyun OSSUnderFileSystemimplementation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class alluxio.underfs.ObjectUnderFileSystem
alluxio.underfs.ObjectUnderFileSystem.DeleteBuffer, alluxio.underfs.ObjectUnderFileSystem.ObjectListingChunk, alluxio.underfs.ObjectUnderFileSystem.ObjectPermissions, alluxio.underfs.ObjectUnderFileSystem.ObjectStatus, alluxio.underfs.ObjectUnderFileSystem.ObjectStoreOperation<T extends java.lang.Object>, alluxio.underfs.ObjectUnderFileSystem.OperationBuffer<T extends java.lang.Object>, alluxio.underfs.ObjectUnderFileSystem.RenameBuffer, alluxio.underfs.ObjectUnderFileSystem.UfsStatusIterator
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOSSUnderFileSystem(alluxio.AlluxioURI uri, com.aliyun.oss.OSS ossClient, java.lang.String bucketName, alluxio.underfs.UnderFileSystemConfiguration conf)Constructor forOSSUnderFileSystem.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()voidclose()protected booleancopyObject(java.lang.String src, java.lang.String dst)booleancreateEmptyObject(java.lang.String key)static OSSUnderFileSystemcreateInstance(alluxio.AlluxioURI uri, alluxio.underfs.UnderFileSystemConfiguration conf)Constructs a new instance ofOSSUnderFileSystem.protected java.io.OutputStreamcreateObject(java.lang.String key)protected booleandeleteObject(java.lang.String key)protected java.util.List<java.lang.String>deleteObjects(java.util.List<java.lang.String> keys)protected java.lang.StringgetFolderSuffix()protected alluxio.underfs.ObjectUnderFileSystem.ObjectListingChunkgetObjectListingChunk(java.lang.String key, boolean recursive)protected alluxio.underfs.ObjectUnderFileSystem.ObjectStatusgetObjectStatus(java.lang.String key)protected alluxio.underfs.ObjectUnderFileSystem.ObjectPermissionsgetPermissions()protected java.lang.StringgetRootKey()java.lang.StringgetUnderFSType()static com.aliyun.oss.ClientBuilderConfigurationinitializeOSSClientConfig(alluxio.conf.AlluxioConfiguration alluxioConf)Creates an OSSClientConfigurationusing an Alluxio Configuration.protected java.io.InputStreamopenObject(java.lang.String key, alluxio.underfs.options.OpenOptions options, alluxio.retry.RetryPolicy retryPolicy)alluxio.PositionReaderopenPositionRead(java.lang.String path, long fileLength)voidsetMode(java.lang.String path, short mode)voidsetOwner(java.lang.String path, java.lang.String user, java.lang.String group)-
Methods inherited from class alluxio.underfs.ObjectUnderFileSystem
connectFromMaster, connectFromWorker, convertToFolderName, create, createNonexistingFile, createNonexistingFile, deleteDirectory, deleteExistingDirectory, deleteExistingDirectory, deleteExistingFile, deleteFile, getBlockSizeByte, getChildName, getDirectoryStatus, getExistingDirectoryStatus, getExistingFileStatus, getExistingStatus, getFileLocations, getFileLocations, getFileStatus, getListingChunkLength, getListingChunkLengthMax, getObjectListingChunk, getObjectListingChunkForPath, getObjectListingChunkForPath, getParentPath, getSpace, getStatus, isDirectory, isExistingDirectory, isFile, isObjectStorage, isRoot, listInternal, listStatus, listStatus, listStatusIterable, mkdirs, mkdirsInternal, open, openExistingFile, openExistingFile, parentExists, renameDirectory, renameFile, renameRenamableDirectory, renameRenamableFile, retryOnException, stripPrefixIfPresent, supportsFlush
-
Methods inherited from class alluxio.underfs.BaseUnderFileSystem
create, deleteDirectory, exists, getAclPair, getActiveSyncInfo, getConfiguration, getFingerprint, getOperationMode, getParsedFingerprint, getParsedFingerprint, getPhysicalStores, isSeekable, mkdirs, open, performListingAsync, resolveUri, setAclEntries, startActiveSyncPolling, startSync, stopActiveSyncPolling, stopSync, supportsActiveSync, validatePath
-
-
-
-
Constructor Detail
-
OSSUnderFileSystem
protected OSSUnderFileSystem(alluxio.AlluxioURI uri, @Nullable com.aliyun.oss.OSS ossClient, java.lang.String bucketName, alluxio.underfs.UnderFileSystemConfiguration conf)Constructor forOSSUnderFileSystem.- Parameters:
uri- theAlluxioURIfor this UFSossClient- Aliyun OSS clientbucketName- bucket name of user's configured Alluxio bucketconf- configuration for this UFS
-
-
Method Detail
-
createInstance
public static OSSUnderFileSystem createInstance(alluxio.AlluxioURI uri, alluxio.underfs.UnderFileSystemConfiguration conf) throws java.lang.Exception
Constructs a new instance ofOSSUnderFileSystem.- Parameters:
uri- theAlluxioURIfor this UFSconf- the configuration for this UFS- Returns:
- the created
OSSUnderFileSysteminstance - Throws:
java.lang.Exception
-
cleanup
public void cleanup() throws java.io.IOException- Specified by:
cleanupin interfacealluxio.underfs.UnderFileSystem- Overrides:
cleanupin classalluxio.underfs.ObjectUnderFileSystem- Throws:
java.io.IOException
-
getUnderFSType
public java.lang.String getUnderFSType()
-
openPositionRead
public alluxio.PositionReader openPositionRead(java.lang.String path, long fileLength)
-
setOwner
public void setOwner(java.lang.String path, java.lang.String user, java.lang.String group)
-
setMode
public void setMode(java.lang.String path, short mode) throws java.io.IOException- Throws:
java.io.IOException
-
copyObject
protected boolean copyObject(java.lang.String src, java.lang.String dst)- Specified by:
copyObjectin classalluxio.underfs.ObjectUnderFileSystem
-
createEmptyObject
public boolean createEmptyObject(java.lang.String key)
- Specified by:
createEmptyObjectin classalluxio.underfs.ObjectUnderFileSystem
-
createObject
protected java.io.OutputStream createObject(java.lang.String key) throws java.io.IOException- Specified by:
createObjectin classalluxio.underfs.ObjectUnderFileSystem- Throws:
java.io.IOException
-
deleteObject
protected boolean deleteObject(java.lang.String key)
- Specified by:
deleteObjectin classalluxio.underfs.ObjectUnderFileSystem
-
deleteObjects
protected java.util.List<java.lang.String> deleteObjects(java.util.List<java.lang.String> keys) throws java.io.IOException- Overrides:
deleteObjectsin classalluxio.underfs.ObjectUnderFileSystem- Throws:
java.io.IOException
-
getFolderSuffix
protected java.lang.String getFolderSuffix()
- Specified by:
getFolderSuffixin classalluxio.underfs.ObjectUnderFileSystem
-
getObjectListingChunk
protected alluxio.underfs.ObjectUnderFileSystem.ObjectListingChunk getObjectListingChunk(java.lang.String key, boolean recursive) throws java.io.IOException- Specified by:
getObjectListingChunkin classalluxio.underfs.ObjectUnderFileSystem- Throws:
java.io.IOException
-
getObjectStatus
protected alluxio.underfs.ObjectUnderFileSystem.ObjectStatus getObjectStatus(java.lang.String key)
- Specified by:
getObjectStatusin classalluxio.underfs.ObjectUnderFileSystem
-
getPermissions
protected alluxio.underfs.ObjectUnderFileSystem.ObjectPermissions getPermissions()
- Specified by:
getPermissionsin classalluxio.underfs.ObjectUnderFileSystem
-
getRootKey
protected java.lang.String getRootKey()
- Specified by:
getRootKeyin classalluxio.underfs.ObjectUnderFileSystem
-
initializeOSSClientConfig
public static com.aliyun.oss.ClientBuilderConfiguration initializeOSSClientConfig(alluxio.conf.AlluxioConfiguration alluxioConf)
Creates an OSSClientConfigurationusing an Alluxio Configuration.- Parameters:
alluxioConf- the OSS Configuration- Returns:
- the OSS
ClientBuilderConfiguration
-
openObject
protected java.io.InputStream openObject(java.lang.String key, alluxio.underfs.options.OpenOptions options, alluxio.retry.RetryPolicy retryPolicy) throws java.io.IOException- Specified by:
openObjectin classalluxio.underfs.ObjectUnderFileSystem- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classalluxio.underfs.ObjectUnderFileSystem- Throws:
java.io.IOException
-
-