Commit 84aa3465 authored by Sid Stenersen's avatar Sid Stenersen
Browse files

Update documentation - thread safety

parent 200abfab
Pipeline #37295 passed with stage
in 47 seconds
......@@ -1069,14 +1069,17 @@ namespace seismicdrive {
* @param context the underlying HTTP connection configuration
* @param HttpConnectionLink The connection link where this settings must apply (ANY by default)
*
* NOTE: This method is not thread-safe. Do not call it while more
* than one thread is accessing this dataset.
*
* usage example:
*
* - HttpContext* storage_context = new HttpContext();
* - seismic_dms_context->timeoutSecs = 300; // 5 minutes
* - HttpContext storage_context;
* - storage_context->timeoutSecs = 300; // 5 minutes
* -
* - SDManager sdmanager;
* - SDGenericDataset dataset(&sdmanager, "sd://tenant/subproject/data");
* - dataset.setHttpContext(storage_context, HttpConnectionLink::CLOUD_STORAGE);
* - dataset.setHttpContext(&storage_context, HttpConnectionLink::CLOUD_STORAGE);
* - // work with dataset
* - dataset.close();
*
......@@ -1091,15 +1094,17 @@ namespace seismicdrive {
* @param policy The exponential retry back-off policy settings.
* @param HttpConnectionLink The connection link where this settings must apply (ANY by default)
*
* NOTE: This method is not thread-safe. Do not call it while more
* than one thread is accessing this dataset.
*
* usage example:
*
* - const setExponentialRetryBackoffPolicy* policy = new ExponentialRetryBackoffPolicy();
* - policy->maxRetry = 5; // set paramters
* - // policy->enable = false; // disable the retry policy
* - ExponentialRetryBackoffPolicy policy;
* - policy.maxRetry = 5;
* -
* - SDManager sdmanager;
* - SDGenericDataset dataset(&sdmanager, "sd://tenant/subproject/data");
* - dataset.setExponentialRetryBackoffPolicy(policy, HttpConnectionLink::CLOUD_STORAGE);
* - dataset.setExponentialRetryBackoffPolicy(&policy, HttpConnectionLink::CLOUD_STORAGE);
* - // work with dataset
* - dataset.close();
*
......
......@@ -350,6 +350,9 @@ class Storage: public StorageIF {
* This method sets a default http context for access requests.
*
* @param pContext is the http context of the access request
*
* NOTE: This method is not thread-safe. Do not call it while more
* than one thread is accessing this object.
******************************************************************************/
void setHttpContext(const HttpContext *pContext = nullptr);
......@@ -359,6 +362,9 @@ class Storage: public StorageIF {
* This method sets a default http retry policy strategy.
*
* @param policy is the back-off retry policy to apply on request
*
* NOTE: This method is not thread-safe. Do not call it while more
* than one thread is accessing this object.
******************************************************************************/
void setExponentialRetryBackoffPolicy(const ExponentialRetryBackoffPolicy* policy);
......
......@@ -396,8 +396,13 @@ namespace seismicdrive {
void waitLockObject(const std::string &cs_path, const GcsContext* pContext);
void unlockObject(const std::string &cs_path, const GcsContext* pContext);
void getChildren(const std::string &objPath, bool recursiveList, std::string *nextPageToken,std::vector<StorageObjectInfo> *result, const GcsContext* pContext);
// Not thread-safe
void setHttpContext(const HttpContext *pContext);
// Not thread-safe
void setExponentialRetryBackoffPolicy(const ExponentialRetryBackoffPolicy *policy);
std::shared_ptr<CloudBlobClientIF> getBlobClient();
TokenInfo getCachedStorageAccessToken(const std::string &resourceRef);
......@@ -691,6 +696,7 @@ namespace seismicdrive {
throw seismicdrive::SDException("Not yet implemented");
}
// Not thread-safe
void AzureStorageImpl::setHttpContext(const HttpContext* pContext) {
if (pContext) {
......@@ -699,6 +705,7 @@ namespace seismicdrive {
context.reset(pContext);
}
// Not thread-safe
void AzureStorageImpl::setExponentialRetryBackoffPolicy(const ExponentialRetryBackoffPolicy* policy) {
if (policy) {
policy = new ExponentialRetryBackoffPolicy(*policy);
......@@ -787,10 +794,12 @@ namespace seismicdrive {
_impl->unlockObject(cs_path, pContext);
}
// Not thread-safe
void AzureStorage::setHttpContext(const HttpContext *pContext) {
_impl->setHttpContext(pContext);
}
// Not thread-safe
void AzureStorage::setExponentialRetryBackoffPolicy(const ExponentialRetryBackoffPolicy* policy) {
_impl->setExponentialRetryBackoffPolicy(policy);
}
......
......@@ -274,6 +274,9 @@ public:
* This method sets a default http context for access requests.
*
* @param pContext is the http context of the access request
*
* NOTE: This method is not thread-safe. Do not call it while more
* than one thread is accessing this object.
******************************************************************************/
void setHttpContext(const HttpContext *pContext = nullptr) override;
......@@ -283,6 +286,9 @@ public:
* This method sets a default http retry policy strategy.
*
* @param policy is the back-off retry policy to apply on request
*
* NOTE: This method is not thread-safe. Do not call it while more
* than one thread is accessing this object.
******************************************************************************/
void setExponentialRetryBackoffPolicy(const ExponentialRetryBackoffPolicy* policy);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment