#include <s3fanout.h>
|
CURL * | AcquireCurlHandle () const |
|
void | ReleaseCurlHandle (JobInfo *info, CURL *handle) const |
|
void | InitPipeWatchFds () |
|
int | InitializeDnsSettings (CURL *handle, std::string remote_host) const |
|
void | InitializeDnsSettingsCurl (CURL *handle, CURLSH *sharehandle, curl_slist *clist) const |
|
Failures | InitializeRequest (JobInfo *info, CURL *handle) const |
|
void | SetUrlOptions (JobInfo *info) const |
|
void | UpdateStatistics (CURL *handle) |
|
bool | CanRetry (const JobInfo *info) |
|
void | Backoff (JobInfo *info) |
|
bool | VerifyAndFinalize (const int curl_error, JobInfo *info) |
|
std::string | GetRequestString (const JobInfo &info) const |
|
std::string | GetContentType (const JobInfo &info) const |
|
std::string | GetUriEncode (const std::string &val, bool encode_slash) const |
|
std::string | GetAwsV4SigningKey (const std::string &date) const |
|
bool | MkPayloadHash (const JobInfo &info, std::string *hex_hash) const |
|
bool | MkV2Authz (const JobInfo &info, std::vector< std::string > *headers) const |
|
bool | MkV4Authz (const JobInfo &info, std::vector< std::string > *headers) const |
|
bool | MkAzureAuthz (const JobInfo &info, std::vector< std::string > *headers) const |
|
std::string | MkUrl (const std::string &objkey) const |
|
std::string | MkCompleteHostname () |
|
| SingleCopy () |
|
Definition at line 170 of file s3fanout.h.
s3fanout::S3FanoutManager::S3FanoutManager |
( |
const S3Config & |
config | ) |
|
|
explicit |
s3fanout::S3FanoutManager::~S3FanoutManager |
( |
| ) |
|
CURL * s3fanout::S3FanoutManager::AcquireCurlHandle |
( |
| ) |
const |
|
private |
Gets an idle CURL handle from the pool. Creates a new one and adds it to the pool if necessary.
Definition at line 385 of file s3fanout.cc.
Referenced by MainUpload().
void s3fanout::S3FanoutManager::Backoff |
( |
JobInfo * |
info | ) |
|
|
private |
Backoff for retry to introduce a jitter into a upload sequence.
- Returns
- true if backoff has been performed, false otherwise
Definition at line 1049 of file s3fanout.cc.
int s3fanout::S3FanoutManager::CallbackCurlSocket |
( |
CURL * |
easy, |
|
|
curl_socket_t |
s, |
|
|
int |
action, |
|
|
void * |
userp, |
|
|
void * |
socketp |
|
) |
| |
|
staticprivate |
bool s3fanout::S3FanoutManager::CanRetry |
( |
const JobInfo * |
info | ) |
|
|
private |
Retry if possible and if not already done too often.
Definition at line 1034 of file s3fanout.cc.
void s3fanout::S3FanoutManager::DetectThrottleIndicator |
( |
const std::string & |
header, |
|
|
JobInfo * |
info |
|
) |
| |
|
static |
Parses Retry-After and X-Retry-In headers attached to HTTP 429 responses
Definition at line 40 of file s3fanout.cc.
string s3fanout::S3FanoutManager::GetAwsV4SigningKey |
( |
const std::string & |
date | ) |
const |
|
private |
string s3fanout::S3FanoutManager::GetContentType |
( |
const JobInfo & |
info | ) |
const |
|
private |
string s3fanout::S3FanoutManager::GetRequestString |
( |
const JobInfo & |
info | ) |
const |
|
private |
const Statistics & s3fanout::S3FanoutManager::GetStatistics |
( |
| ) |
|
string s3fanout::S3FanoutManager::GetUriEncode |
( |
const std::string & |
val, |
|
|
bool |
encode_slash |
|
) |
| const |
|
private |
int s3fanout::S3FanoutManager::InitializeDnsSettings |
( |
CURL * |
handle, |
|
|
std::string |
remote_host |
|
) |
| const |
|
private |
void s3fanout::S3FanoutManager::InitializeDnsSettingsCurl |
( |
CURL * |
handle, |
|
|
CURLSH * |
sharehandle, |
|
|
curl_slist * |
clist |
|
) |
| const |
|
private |
Failures s3fanout::S3FanoutManager::InitializeRequest |
( |
JobInfo * |
info, |
|
|
CURL * |
handle |
|
) |
| const |
|
private |
Request parameters set the URL and other options such as timeout and proxy.
Definition at line 864 of file s3fanout.cc.
Referenced by MainUpload().
void s3fanout::S3FanoutManager::InitPipeWatchFds |
( |
| ) |
|
|
private |
void * s3fanout::S3FanoutManager::MainUpload |
( |
void * |
data | ) |
|
|
staticprivate |
bool s3fanout::S3FanoutManager::MkAzureAuthz |
( |
const JobInfo & |
info, |
|
|
std::vector< std::string > * |
headers |
|
) |
| const |
|
private |
std::string s3fanout::S3FanoutManager::MkCompleteHostname |
( |
| ) |
|
|
inlineprivate |
bool s3fanout::S3FanoutManager::MkPayloadHash |
( |
const JobInfo & |
info, |
|
|
std::string * |
hex_hash |
|
) |
| const |
|
private |
std::string s3fanout::S3FanoutManager::MkUrl |
( |
const std::string & |
objkey | ) |
const |
|
inlineprivate |
bool s3fanout::S3FanoutManager::MkV2Authz |
( |
const JobInfo & |
info, |
|
|
std::vector< std::string > * |
headers |
|
) |
| const |
|
private |
bool s3fanout::S3FanoutManager::MkV4Authz |
( |
const JobInfo & |
info, |
|
|
std::vector< std::string > * |
headers |
|
) |
| const |
|
private |
JobInfo * s3fanout::S3FanoutManager::PopCompletedJob |
( |
| ) |
|
void s3fanout::S3FanoutManager::PushCompletedJob |
( |
JobInfo * |
info | ) |
|
void s3fanout::S3FanoutManager::PushNewJob |
( |
JobInfo * |
info | ) |
|
Push new job to be uploaded to the S3 cloud storage.
Definition at line 1329 of file s3fanout.cc.
void s3fanout::S3FanoutManager::ReleaseCurlHandle |
( |
JobInfo * |
info, |
|
|
CURL * |
handle |
|
) |
| const |
|
private |
void s3fanout::S3FanoutManager::SetUrlOptions |
( |
JobInfo * |
info | ) |
const |
|
private |
Sets the URL specific options such as host to use and timeout.
Definition at line 992 of file s3fanout.cc.
Referenced by MainUpload().
void s3fanout::S3FanoutManager::Spawn |
( |
| ) |
|
Spawns the I/O worker thread. No way back except ~S3FanoutManager.
Definition at line 1312 of file s3fanout.cc.
void s3fanout::S3FanoutManager::UpdateStatistics |
( |
CURL * |
handle | ) |
|
|
private |
Adds transfer time and uploaded bytes to the global counters.
Definition at line 1023 of file s3fanout.cc.
bool s3fanout::S3FanoutManager::VerifyAndFinalize |
( |
const int |
curl_error, |
|
|
JobInfo * |
info |
|
) |
| |
|
private |
Checks the result of a curl request and implements the failure logic and takes care of cleanup.
- Returns
- true if request should be repeated, false otherwise
Definition at line 1094 of file s3fanout.cc.
Referenced by MainUpload().
std::set<JobInfo *>* s3fanout::S3FanoutManager::active_requests_ |
|
private |
Semaphore* s3fanout::S3FanoutManager::available_jobs_ |
|
private |
std::string s3fanout::S3FanoutManager::complete_hostname_ |
|
private |
const S3Config s3fanout::S3FanoutManager::config_ |
|
private |
pthread_mutex_t* s3fanout::S3FanoutManager::curl_handle_lock_ |
|
private |
CURLM* s3fanout::S3FanoutManager::curl_multi_ |
|
private |
std::map<CURL *, S3FanOutDnsEntry *>* s3fanout::S3FanoutManager::curl_sharehandles_ |
|
private |
bool s3fanout::S3FanoutManager::is_curl_debug_ |
|
private |
pthread_mutex_t* s3fanout::S3FanoutManager::jobs_todo_lock_ |
|
private |
const char * s3fanout::S3FanoutManager::kCacheControlCas = "Cache-Control: max-age=259200" |
|
staticprivate |
const char * s3fanout::S3FanoutManager::kCacheControlDotCvmfs |
|
staticprivate |
Initial value:=
"Cache-Control: max-age=61"
Definition at line 231 of file s3fanout.h.
const unsigned s3fanout::S3FanoutManager::kDefault429ThrottleMs = 250 |
|
static |
const unsigned s3fanout::S3FanoutManager::kDefaultHTTPPort = 80 |
|
static |
const unsigned s3fanout::S3FanoutManager::kDefaultHTTPSPort = 443 |
|
static |
const unsigned s3fanout::S3FanoutManager::kLowSpeedLimit = 1024 |
|
staticprivate |
const unsigned s3fanout::S3FanoutManager::kMax429ThrottleMs = 10000 |
|
static |
const unsigned s3fanout::S3FanoutManager::kThrottleReportIntervalSec = 10 |
|
static |
std::pair<std::string, std::string> s3fanout::S3FanoutManager::last_signing_key_ |
|
mutableprivate |
AWS4 signing keys are derived from the secret key, a region and a date. The signing key for current day can be cached.
Definition at line 302 of file s3fanout.h.
unsigned int s3fanout::S3FanoutManager::max_available_jobs_ |
|
private |
bool s3fanout::S3FanoutManager::opt_ipv4_only_ |
|
private |
int s3fanout::S3FanoutManager::pipe_completed_[2] |
|
private |
int s3fanout::S3FanoutManager::pipe_jobs_[2] |
|
private |
int s3fanout::S3FanoutManager::pipe_terminate_[2] |
|
private |
std::set<CURL *>* s3fanout::S3FanoutManager::pool_handles_idle_ |
|
private |
std::set<CURL *>* s3fanout::S3FanoutManager::pool_handles_inuse_ |
|
private |
Prng s3fanout::S3FanoutManager::prng_ |
|
private |
Statistics* s3fanout::S3FanoutManager::statistics_ |
|
private |
pthread_t s3fanout::S3FanoutManager::thread_upload_ |
|
private |
uint64_t s3fanout::S3FanoutManager::timestamp_last_throttle_report_ |
|
private |
std::string* s3fanout::S3FanoutManager::user_agent_ |
|
private |
struct pollfd* s3fanout::S3FanoutManager::watch_fds_ |
|
private |
uint32_t s3fanout::S3FanoutManager::watch_fds_inuse_ |
|
private |
uint32_t s3fanout::S3FanoutManager::watch_fds_max_ |
|
private |
uint32_t s3fanout::S3FanoutManager::watch_fds_size_ |
|
private |
The documentation for this class was generated from the following files:
- /home/sftnight/jenkins/workspace/CvmfsDoxygen/label/docker-x86_64/cvmfs/cvmfs/network/s3fanout.h
- /home/sftnight/jenkins/workspace/CvmfsDoxygen/label/docker-x86_64/cvmfs/cvmfs/network/s3fanout.cc