public class AliyunOSSFileSystemStore extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
AliyunOSSFileSystemStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
abortMultipartUpload(String key,
String uploadId)
Abort the specific multipart upload.
|
void |
close()
Close OSS client properly.
|
com.aliyun.oss.model.CompleteMultipartUploadResult |
completeMultipartUpload(String key,
String uploadId,
List<com.aliyun.oss.model.PartETag> partETags)
Complete the specific multipart upload.
|
boolean |
copyFile(String srcKey,
long srcLen,
String dstKey)
Copy an object from source key to destination key.
|
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> |
createLocatedFileStatusIterator(String prefix,
int maxListingLength,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.PathFilter filter,
FileStatusAcceptor acceptor,
String delimiter) |
void |
deleteDirs(String key)
Delete a directory from Aliyun OSS.
|
void |
deleteObject(String key)
Delete an object, and update write operation statistics.
|
void |
deleteObjects(List<String> keysToDelete)
Delete a list of keys, and update write operation statistics.
|
com.aliyun.oss.model.ObjectMetadata |
getObjectMetadata(String key)
Return metadata of a given object key.
|
String |
getUploadId(String key)
Initiate multipart upload.
|
void |
initialize(URI uri,
org.apache.hadoop.conf.Configuration conf,
String user,
org.apache.hadoop.fs.FileSystem.Statistics stat) |
com.aliyun.oss.model.ObjectListing |
listObjects(String prefix,
int maxListingLength,
String marker,
boolean recursive)
list objects.
|
void |
purge(String prefix)
Clean up all objects matching the prefix.
|
InputStream |
retrieve(String key,
long byteStart,
long byteEnd)
Retrieve a part of an object.
|
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> |
singleStatusRemoteIterator(org.apache.hadoop.fs.FileStatus fileStatus,
org.apache.hadoop.fs.BlockLocation[] locations) |
void |
storeEmptyFile(String key)
Upload an empty file as an OSS object, using single upload.
|
void |
uploadObject(String key,
File file)
Upload a file as an OSS object, using single upload.
|
com.aliyun.oss.model.PartETag |
uploadPart(File file,
String key,
String uploadId,
int idx) |
public void initialize(URI uri, org.apache.hadoop.conf.Configuration conf, String user, org.apache.hadoop.fs.FileSystem.Statistics stat) throws IOException
IOExceptionpublic void deleteObject(String key)
key - key to blob to delete.public void deleteObjects(List<String> keysToDelete) throws IOException
keysToDelete - collection of keys to delete.IOException - if failed to delete objects.public void deleteDirs(String key) throws IOException
key - directory key to delete.IOException - if failed to delete directory.public com.aliyun.oss.model.ObjectMetadata getObjectMetadata(String key)
key - object key.public void storeEmptyFile(String key) throws IOException
key - object key.IOException - if failed to upload object.public boolean copyFile(String srcKey, long srcLen, String dstKey)
srcKey - source key.srcLen - source file length.dstKey - destination key.public void uploadObject(String key, File file) throws IOException
key - object key.file - local file to upload.IOException - if failed to upload object.public com.aliyun.oss.model.ObjectListing listObjects(String prefix, int maxListingLength, String marker, boolean recursive)
prefix - prefix.maxListingLength - max no. of entriesmarker - last key in any previous search.recursive - whether to list directory recursively.public InputStream retrieve(String key, long byteStart, long byteEnd)
key - the object name that is being retrieved from the Aliyun OSS.byteStart - start position.byteEnd - end position.public void close()
public void purge(String prefix) throws IOException
prefix - Aliyun OSS object prefix.IOException - if failed to clean up objects.public org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> singleStatusRemoteIterator(org.apache.hadoop.fs.FileStatus fileStatus,
org.apache.hadoop.fs.BlockLocation[] locations)
public org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> createLocatedFileStatusIterator(String prefix, int maxListingLength, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.PathFilter filter, FileStatusAcceptor acceptor, String delimiter)
public com.aliyun.oss.model.PartETag uploadPart(File file, String key, String uploadId, int idx) throws IOException
IOExceptionpublic com.aliyun.oss.model.CompleteMultipartUploadResult completeMultipartUpload(String key, String uploadId, List<com.aliyun.oss.model.PartETag> partETags)
Copyright © 2008–2020 Apache Software Foundation. All rights reserved.