Merge pull request #831 from JoohnSF/onezone_ia_support

Add support for storage class ONEZONE_IA.
This commit is contained in:
Takeshi Nakatani 2018-10-08 22:57:12 +09:00 committed by GitHub
commit 8649a68766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 2 deletions

View File

@ -78,7 +78,7 @@ delete local file cache when s3fs starts and exits.
\fB\-o\fR storage_class (default is standard)
store object with specified storage class.
this option replaces the old option use_rrs.
Possible values: standard, standard_ia, and reduced_redundancy.
Possible values: standard, standard_ia, onezone_ia and reduced_redundancy.
.TP
\fB\-o\fR use_rrs (default is disable)
use Amazon's Reduced Redundancy Storage.

View File

@ -2816,6 +2816,8 @@ int S3fsCurl::PutHeadRequest(const char* tpath, headers_t& meta, bool is_copy)
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY");
} else if(STANDARD_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA");
} else if(ONEZONE_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
}
// SSE
if(!is_copy){
@ -2945,6 +2947,8 @@ int S3fsCurl::PutRequest(const char* tpath, headers_t& meta, int fd)
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY");
} else if(STANDARD_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA");
} else if(ONEZONE_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
}
// SSE
string ssevalue("");
@ -3212,6 +3216,8 @@ int S3fsCurl::PreMultipartPostRequest(const char* tpath, headers_t& meta, string
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY");
} else if(STANDARD_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA");
} else if(ONEZONE_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
}
// SSE
if(!is_copy){

View File

@ -163,6 +163,7 @@ typedef std::list<sseckeymap_t> sseckeylist_t;
enum storage_class_t {
STANDARD,
STANDARD_IA,
ONEZONE_IA,
REDUCED_REDUNDANCY
};

View File

@ -4390,6 +4390,8 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar
S3fsCurl::SetStorageClass(STANDARD);
}else if(0 == strcmp(storage_class, "standard_ia")){
S3fsCurl::SetStorageClass(STANDARD_IA);
}else if(0 == strcmp(storage_class, "onezone_ia")){
S3fsCurl::SetStorageClass(ONEZONE_IA);
}else if(0 == strcmp(storage_class, "reduced_redundancy")){
S3fsCurl::SetStorageClass(REDUCED_REDUNDANCY);
}else{

View File

@ -1024,7 +1024,7 @@ void show_help (void)
"\n"
" storage_class (default=\"standard\")\n"
" - store object with specified storage class. Possible values:\n"
" standard, standard_ia, and reduced_redundancy.\n"
" standard, standard_ia, onezone_ia and reduced_redundancy.\n"
"\n"
" use_sse (default is disable)\n"
" - Specify three type Amazon's Server-Site Encryption: SSE-S3,\n"