Add intelligent tiering as option for storage class

Resolves Issue #1219
This commit is contained in:
Andrei Precup 2020-01-04 15:40:40 +02:00 committed by Andrew Gaul
parent 23945a0130
commit 39102608aa
4 changed files with 11 additions and 2 deletions

View File

@ -3149,6 +3149,8 @@ int S3fsCurl::PutHeadRequest(const char* tpath, headers_t& meta, bool is_copy)
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA");
} else if(ONEZONE_IA == GetStorageClass()){ } else if(ONEZONE_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
} else if(INTELLIGENT_TIERING == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "INTELLIGENT_TIERING");
} }
// SSE // SSE
if(!is_copy){ if(!is_copy){
@ -3278,6 +3280,8 @@ int S3fsCurl::PutRequest(const char* tpath, headers_t& meta, int fd)
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA");
} else if(ONEZONE_IA == GetStorageClass()){ } else if(ONEZONE_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
} else if(INTELLIGENT_TIERING == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "INTELLIGENT_TIERING");
} }
// SSE // SSE
string ssevalue; string ssevalue;
@ -3536,6 +3540,8 @@ int S3fsCurl::PreMultipartPostRequest(const char* tpath, headers_t& meta, string
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "STANDARD_IA");
} else if(ONEZONE_IA == GetStorageClass()){ } else if(ONEZONE_IA == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
} else if(INTELLIGENT_TIERING == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "INTELLIGENT_TIERING");
} }
// SSE // SSE
if(!is_copy){ if(!is_copy){

View File

@ -201,7 +201,8 @@ enum storage_class_t {
STANDARD, STANDARD,
STANDARD_IA, STANDARD_IA,
ONEZONE_IA, ONEZONE_IA,
REDUCED_REDUNDANCY REDUCED_REDUNDANCY,
INTELLIGENT_TIERING
}; };
enum acl_t { enum acl_t {

View File

@ -4617,6 +4617,8 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar
S3fsCurl::SetStorageClass(ONEZONE_IA); S3fsCurl::SetStorageClass(ONEZONE_IA);
}else if(0 == strcmp(storage_class, "reduced_redundancy")){ }else if(0 == strcmp(storage_class, "reduced_redundancy")){
S3fsCurl::SetStorageClass(REDUCED_REDUNDANCY); S3fsCurl::SetStorageClass(REDUCED_REDUNDANCY);
}else if(0 == strcmp(storage_class, "intelligent_tiering")){
S3fsCurl::SetStorageClass(INTELLIGENT_TIERING);
}else{ }else{
S3FS_PRN_EXIT("unknown value for storage_class: %s", storage_class); S3FS_PRN_EXIT("unknown value for storage_class: %s", storage_class);
return -1; return -1;

View File

@ -1097,7 +1097,7 @@ void show_help ()
"\n" "\n"
" storage_class (default=\"standard\")\n" " storage_class (default=\"standard\")\n"
" - store object with specified storage class. Possible values:\n" " - store object with specified storage class. Possible values:\n"
" standard, standard_ia, onezone_ia and reduced_redundancy.\n" " standard, standard_ia, onezone_ia, reduced_redundancy and intelligent_tiering.\n"
"\n" "\n"
" use_rrs (default is disable)\n" " use_rrs (default is disable)\n"
" - use Amazon's Reduced Redundancy Storage.\n" " - use Amazon's Reduced Redundancy Storage.\n"