public class AliyunOSSFileSystemStore extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
| 构造器和说明 |
|---|
AliyunOSSFileSystemStore() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close OSS client properly.
|
boolean |
copyFile(String srcKey,
String dstKey)
Copy an object from source key to destination key.
|
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.
|
void |
initialize(URI uri,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem.Statistics stat) |
com.aliyun.oss.model.ObjectListing |
listObjects(String prefix,
int maxListingLength,
String marker,
boolean recursive)
list objects.
|
void |
multipartUploadObject(String key,
File file)
Upload a file as an OSS object, using multipart upload.
|
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.
|
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.
|
public void initialize(URI uri, org.apache.hadoop.conf.Configuration conf, 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)
keysToDelete - collection of keys to delete.public void deleteDirs(String key)
key - directory key to delete.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, String dstKey)
srcKey - source key.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 void multipartUploadObject(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)
prefix - Aliyun OSS object prefix.Copyright © 2018. All Rights Reserved.