Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Domain Data Mgmt Services
Seismic
Seismic DMS Suite
seismic-dms-cpp-lib
Commits
c8ee76ae
Commit
c8ee76ae
authored
Apr 26, 2021
by
Diego Molteni
Browse files
fixed code structure
parent
1862df87
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
.devcontainer.json
deleted
100644 → 0
View file @
1862df87
//
See
https://aka.ms/vscode-remote/devcontainer.json
for
format
details.
{
"name"
:
"os-seimic-store-cpp-lib-container"
,
//
Sets
the
run
context
"context"
:
"."
,
//
Use
pre-created
image
//
"image"
:
"gcr.io/cds-dev-155819/carrot/brick-server"
,
"image"
:
"local/sdapi-osdu-centos7-static-deps"
,
//
"runArgs"
:
[
"--cap-add=SYS_PTRACE"
,
"--security-opt"
,
"seccomp=unconfined"
],
//
Publish
ports.
"appPort"
:
[
8050
],
//
Uncomment
the
next
line
if
you
want
to
add
in
default
container
specific
settings.json
values
//
"settings"
:
{
"workbench.colorTheme"
:
"Quiet Light"
},
//
Run
commands
after
the
container
is
created.
//
"postCreateCommand"
:
"gcc -v"
,
//
"postCreateCommand"
:
"bash automation/vscode-install-dev-tools.sh"
,
"extensions"
:
[
"ms-vscode.cpptools"
,
"davidschuldenfrei.gtest-adapter"
,
"ms-vscode.cmake-tools"
,
"VisualStudioExptTeam.vscodeintellicode"
,
"ms-azuretools.vscode-docker"
],
//
Add
in
default
container
specific
settings.json
valuesQ
"settings"
:
{
"terminal.integrated.shell.linux"
:
"/bin/bash"
}
}
\ No newline at end of file
devops/docker/build.centos7.staticdeps.dockerfile
View file @
c8ee76ae
...
...
@@ -188,11 +188,12 @@ RUN make -j $(nproc) && make install
WORKDIR
/tmp
RUN
rm
-rf
azure-storage-cpp
# [azure-sdk-for-cpp]
# new hand-crafted C++ client library for various Azure APIs
# based on libCURL on linux.
# DUO CHECK START
WORKDIR
/tmp
RUN
git clone https://github.com/Azure/azure-sdk-for-cpp.git azure-sdk-for-cpp
&&
\
cd
azure-sdk-for-cpp
&&
\
...
...
@@ -206,8 +207,23 @@ RUN git clone https://github.com/Azure/azure-sdk-for-cpp.git azure-sdk-for-cpp &
cmake
--build
cmake-out
--target
install
--
-j
$(
nproc
)
WORKDIR
/tmp
RUN
rm
-rf
/tmp/azure-sdk-for-cpp
# AZURE_STORAGE_FOR_CPP_VERSION=12.0.0-beta.9
# wget https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION}.tar.gz \
# && tar -zxvf azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION}.tar.gz \
# && cd azure-sdk-for-cpp-azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION} \
# && mkdir build \
# && cd build \
# && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=NO -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DBUILD_TRANSPORT_CURL:BOOL=ON .. \
# && make -j $(nproc) \
# && sudo make install \
# && rm -rf azure-sdk-for-cpp-azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION} \
# && rm -rf azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION}.tar.gz \
# DUO CHECK END
FROM
azure-storage-dev
AS
aws-dev
ARG
AWS_SDK_CPP_RELEASE_TAG=1.8.123
...
...
devops/scripts/build-linux64.sh
View file @
c8ee76ae
...
...
@@ -68,12 +68,12 @@ for i in "$@"; do
cloud_providers
=
"
${
cloud_providers
}
;azure"
fi
;;
--azure-
new
-provider
)
--azure-
curl
-provider
)
shift
if
[
-z
"
${
cloud_providers
}
"
]
;
then
cloud_providers
=
"azure-
new
"
cloud_providers
=
"azure-
curl
"
else
cloud_providers
=
"
${
cloud_providers
}
;azure-
new
"
cloud_providers
=
"
${
cloud_providers
}
;azure-
curl
"
fi
;;
--aws-provider
)
...
...
@@ -134,7 +134,7 @@ options:
--azure-provider
Also build the Azure optional cloud provider code. ( functional, based on Azure Storage C++ SDK, cpprest based )
--azure-
new
-provider
--azure-
curl
-provider
Also build the Azure optional cloud provider code. ( functional, based on Azure Storage C++ SDK, libcurl based )
--aws-provider
...
...
src/CMakeLists.txt
View file @
c8ee76ae
...
...
@@ -85,7 +85,7 @@ if(NOT WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Coverage" )
endif
()
option
(
AZURE_PROVIDER_ENABLED OFF
)
option
(
AZURE_
NEW
_PROVIDER_ENABLED OFF
)
option
(
AZURE_
CURL
_PROVIDER_ENABLED OFF
)
option
(
AWS_PROVIDER_ENABLED OFF
)
option
(
GCP_PROVIDER_ENABLED OFF
)
...
...
@@ -99,11 +99,11 @@ else()
message
(
STATUS
"NOT BUILDING AZURE PROVIDER"
)
endif
()
if
(
"azure-
new
"
IN_LIST OPTIONAL_STORAGE_PROVIDERS_ENABLED
)
set
(
AZURE_
NEW
_PROVIDER_ENABLED ON
)
add_definitions
(
-DHAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
)
if
(
"azure-
curl
"
IN_LIST OPTIONAL_STORAGE_PROVIDERS_ENABLED
)
set
(
AZURE_
CURL
_PROVIDER_ENABLED ON
)
add_definitions
(
-DHAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
)
else
()
message
(
STATUS
"NOT BUILDING AZURE
NEW
PROVIDER"
)
message
(
STATUS
"NOT BUILDING AZURE PROVIDER
CURL
"
)
endif
()
...
...
@@ -122,7 +122,7 @@ else ()
endif
()
message
(
STATUS
"AZURE_PROVIDER_ENABLED=
${
AZURE_PROVIDER_ENABLED
}
"
)
message
(
STATUS
"AZURE_
NEW
_PROVIDER_ENABLED=
${
AZURE_
NEW
_PROVIDER_ENABLED
}
"
)
message
(
STATUS
"AZURE_
CURL
_PROVIDER_ENABLED=
${
AZURE_
CURL
_PROVIDER_ENABLED
}
"
)
message
(
STATUS
"AWS_PROVIDER_ENABLED=
${
AWS_PROVIDER_ENABLED
}
"
)
message
(
STATUS
"GCP_PROVIDER_ENABLED=
${
GCP_PROVIDER_ENABLED
}
"
)
...
...
@@ -162,10 +162,10 @@ file(GLOB SRC_LIB_ACCESSORS ${sdapi_SOURCE_DIR}/src/lib/accessors/*.cc)
file
(
GLOB SRC_LIB_PROVIDERS
${
sdapi_SOURCE_DIR
}
/src/lib/cloud/providers/*.cc
)
if
(
AZURE_PROVIDER_ENABLED
)
file
(
GLOB SRC_LIB_PROVIDERS_AZURE
${
sdapi_SOURCE_DIR
}
/src/lib/cloud/providers/azure/*.cc
)
file
(
GLOB SRC_LIB_PROVIDERS_AZURE
${
sdapi_SOURCE_DIR
}
/src/lib/cloud/providers/azure/
cpprest/
*.cc
)
endif
()
if
(
AZURE_
NEW
_PROVIDER_ENABLED
)
file
(
GLOB SRC_LIB_PROVIDERS_AZURE_NEW
${
sdapi_SOURCE_DIR
}
/src/lib/cloud/providers/azure
_new
/*.cc
)
if
(
AZURE_
CURL
_PROVIDER_ENABLED
)
file
(
GLOB SRC_LIB_PROVIDERS_AZURE_NEW
${
sdapi_SOURCE_DIR
}
/src/lib/cloud/providers/azure
/curl
/*.cc
)
endif
()
if
(
AWS_PROVIDER_ENABLED
)
file
(
GLOB SRC_LIB_PROVIDERS_AWS
${
sdapi_SOURCE_DIR
}
/src/lib/cloud/providers/aws/*.cc
)
...
...
@@ -184,7 +184,7 @@ if(AZURE_PROVIDER_ENABLED)
set
(
SOURCES
${
SOURCES
}
${
SRC_LIB_PROVIDERS_AZURE
}
)
endif
()
if
(
AZURE_
NEW
_PROVIDER_ENABLED
)
if
(
AZURE_
CURL
_PROVIDER_ENABLED
)
set
(
SOURCES
${
SOURCES
}
${
SRC_LIB_PROVIDERS_AZURE_NEW
}
)
endif
()
...
...
@@ -203,7 +203,7 @@ else()
set
(
OPENSSL_LIBRARY
""
)
endif
()
if
(
AZURE_
NEW
_PROVIDER_ENABLED
)
if
(
AZURE_
CURL
_PROVIDER_ENABLED
)
if
(
NOT WIN32
)
...
...
@@ -335,9 +335,9 @@ if(NOT WIN32)
${
CRC32C_LIBRARY
}
)
if
(
AZURE_
NEW
_PROVIDER_ENABLED
)
if
(
AZURE_
CURL
_PROVIDER_ENABLED
)
target_link_libraries
(
sdapi PRIVATE Azure::azure-storage-blobs LibXml2::LibXml2
)
endif
(
AZURE_
NEW
_PROVIDER_ENABLED
)
endif
(
AZURE_
CURL
_PROVIDER_ENABLED
)
if
(
AZURE_PROVIDER_ENABLED
)
#stuff with no proper targets defined in CMake module or package?
...
...
@@ -380,7 +380,7 @@ else()
${
CRC32C_LIBRARY
}
)
if
(
AZURE_
NEW
_PROVIDER_ENABLED
)
if
(
AZURE_
CURL
_PROVIDER_ENABLED
)
target_link_libraries
(
sdapi PRIVATE Azure::azure-storage-blobs
)
endif
()
...
...
@@ -456,7 +456,7 @@ if(NOT WIN32)
${
CRC32C_LIBRARY
}
)
if
(
AZURE_
NEW
_PROVIDER_ENABLED
)
if
(
AZURE_
CURL
_PROVIDER_ENABLED
)
target_link_libraries
(
sdapi_static PRIVATE Azure::azure-storage-blobs LibXml2::LibXml2
)
endif
()
...
...
@@ -500,7 +500,7 @@ else()
${
CRC32C_LIBRARY
}
)
if
(
AZURE_
NEW
_PROVIDER_ENABLED
)
if
(
AZURE_
CURL
_PROVIDER_ENABLED
)
target_link_libraries
(
sdapi_static PRIVATE Azure::azure-storage-blobs
)
endif
()
...
...
src/src/lib/cloud/providers/Storage.cc
View file @
c8ee76ae
...
...
@@ -23,11 +23,11 @@
#include
"accessors/GcsAccessor.h"
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
#include
"cloud/providers/azure/AzureStorage.h"
#include
"cloud/providers/azure/
cpprest/
AzureStorage.h"
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#include
"cloud/providers/azure
_new
/AzureStorage
New
.h"
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
#include
"cloud/providers/azure
/curl
/AzureStorage.h"
#endif
#ifdef HAS_AWS_S3_STORAGE_PROVIDER
...
...
@@ -53,7 +53,7 @@ class StorageObjectInfoIteratorImpl {
public:
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
StorageObjectInfoIteratorImpl
(
std
::
shared_ptr
<
AzureStorage
>
accessor
,
const
std
::
string
&
storagePath
,
const
GcsContext
*
pContext
,
bool
recursive
)
:
StorageObjectInfoIteratorImpl
(
std
::
shared_ptr
<
cpprest
::
AzureStorage
>
accessor
,
const
std
::
string
&
storagePath
,
const
GcsContext
*
pContext
,
bool
recursive
)
:
_storagePath
(
storagePath
),
_http_context
(
pContext
),
_azaccessor
(
accessor
),
...
...
@@ -64,8 +64,8 @@ public:
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
StorageObjectInfoIteratorImpl
(
std
::
shared_ptr
<
AzureStorage
New
>
accessor
,
const
std
::
string
&
storagePath
,
const
GcsContext
*
pContext
,
bool
recursive
)
:
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
StorageObjectInfoIteratorImpl
(
std
::
shared_ptr
<
curl
::
AzureStorage
>
accessor
,
const
std
::
string
&
storagePath
,
const
GcsContext
*
pContext
,
bool
recursive
)
:
_storagePath
(
storagePath
),
_http_context
(
pContext
),
_azaccessornew
(
accessor
),
...
...
@@ -134,7 +134,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_azaccessornew
)
{
_azaccessornew
->
getChildren
(
_storagePath
,
_recursive
,
&
_nextPageToken
,
&
_items
,
_http_context
);
return
;
...
...
@@ -164,10 +164,10 @@ private:
const
GcsContext
*
_http_context
;
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
std
::
shared_ptr
<
AzureStorage
>
_azaccessor
;
std
::
shared_ptr
<
cpprest
::
AzureStorage
>
_azaccessor
;
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
std
::
shared_ptr
<
AzureStorage
New
>
_azaccessornew
;
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
std
::
shared_ptr
<
curl
::
AzureStorage
>
_azaccessornew
;
#endif
#ifdef HAS_AWS_S3_STORAGE_PROVIDER
std
::
shared_ptr
<
AwsStorage
>
_awsaccessor
;
...
...
@@ -212,9 +212,9 @@ private:
if
(
_provider
==
kAzureCloudProvider
)
{
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_azstorage
=
std
::
make_shared
<
AzureStorage
>
(
auth_provider
,
sdresource
,
readonly
);
#elif HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
_azstoragenew
=
std
::
make_shared
<
AzureStorage
New
>
(
auth_provider
,
sdresource
,
readonly
);
_azstorage
=
std
::
make_shared
<
cpprest
::
AzureStorage
>
(
auth_provider
,
sdresource
,
readonly
);
#elif HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
_azstoragenew
=
std
::
make_shared
<
curl
::
AzureStorage
>
(
auth_provider
,
sdresource
,
readonly
);
#else
throw
std
::
logic_error
(
"azure / blob: not supported : no client library code compiled"
);
#endif
...
...
@@ -250,7 +250,7 @@ private:
return
_azstorage
->
objectExists
(
storage_path
,
pContext
);
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
return
_azstoragenew
->
objectExists
(
storage_path
,
pContext
);
}
...
...
@@ -278,7 +278,7 @@ private:
_azstorage
,
storage_path
,
pContext
,
false
));
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
return
StorageObjectInfoIterator
(
new
StorageObjectInfoIteratorImpl
(
...
...
@@ -305,7 +305,7 @@ private:
_azstorage
,
storage_path
,
pContext
,
recursive
));
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
return
StorageObjectInfoIterator
(
new
StorageObjectInfoIteratorImpl
(
...
...
@@ -330,7 +330,7 @@ private:
return
_azstorage
->
objectSize
(
storage_path
,
pContext
);
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
return
_azstoragenew
->
objectSize
(
storage_path
,
pContext
);
}
...
...
@@ -349,7 +349,7 @@ private:
return
_azstorage
->
objectsSize
(
storage_paths
,
pContext
);
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
return
_azstoragenew
->
objectsSize
(
storage_paths
,
pContext
);
}
...
...
@@ -369,7 +369,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
uploadObject
(
storage_path
,
data
,
len
,
pContext
);
return
;
...
...
@@ -391,7 +391,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
uploadObject
(
storage_path
,
file_name
,
pContext
);
return
;
...
...
@@ -413,7 +413,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
downloadObject
(
storage_path
,
data
,
offset
,
len
,
pContext
);
return
;
...
...
@@ -435,7 +435,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
downloadObject
(
storage_path
,
data
,
len
,
pContext
);
return
;
...
...
@@ -457,7 +457,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
downloadObject
(
storage_path
,
data
,
len
,
pContext
);
return
;
...
...
@@ -479,7 +479,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
deleteObject
(
storage_path
,
pContext
);
return
;
...
...
@@ -501,7 +501,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
lockObject
(
storage_path
,
pContext
);
return
;
...
...
@@ -523,7 +523,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
waitLockObject
(
storage_path
,
pContext
);
return
;
...
...
@@ -545,7 +545,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
unlockObject
(
storage_path
,
pContext
);
return
;
...
...
@@ -567,7 +567,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
setHttpContext
(
pContext
);
return
;
...
...
@@ -589,7 +589,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
setExponentialRetryBackoffPolicy
(
policy
);
return
;
...
...
@@ -607,7 +607,7 @@ private:
return
_azstorage
->
getCachedStorageAccessToken
(
resourceRef
);
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
return
_azstoragenew
->
getCachedStorageAccessToken
(
resourceRef
);
}
...
...
@@ -627,7 +627,7 @@ private:
return
;
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
_azstoragenew
->
setCachedStorageAccessToken
(
resourceRef
,
credentials
);
return
;
...
...
@@ -648,7 +648,7 @@ private:
return
_azstorage
->
ls
(
storage_path
,
pContext
);
}
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
if
(
_provider
==
kAzureCloudProvider
)
{
return
_azstoragenew
->
ls
(
storage_path
,
pContext
);
}
...
...
src/src/lib/cloud/providers/Storage.h
View file @
c8ee76ae
...
...
@@ -25,10 +25,14 @@
namespace
seismicdrive
{
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
class
AzureStorage
;
namespace
cpprest
{
class
AzureStorage
;
}
#endif
#ifdef HAS_AZURE_NEW_BLOB_STORAGE_PROVIDER
class
AzureStorageNew
;
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER_CURL
namespace
curl
{
class
AzureStorage
;
}
#endif
#ifdef HAS_AWS_S3_STORAGE_PROVIDER
class
AwsStorage
;
...
...
@@ -404,11 +408,11 @@ class Storage: public StorageIF {
std
::
shared_ptr
<
GcsAccessor
>
_gcsaccessor
;
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
std
::
shared_ptr
<
AzureStorage
>
_azstorage
;
std
::
shared_ptr
<
cpprest
::
AzureStorage
>
_azstorage
;
#endif
#ifdef HAS_AZURE_
NEW_
BLOB_STORAGE_PROVIDER
std
::
shared_ptr
<
AzureStorage
New
>
_azstoragenew
;
#ifdef HAS_AZURE_BLOB_STORAGE_PROVIDER
_CURL
std
::
shared_ptr
<
curl
::
AzureStorage
>
_azstoragenew
;
#endif
...
...
src/src/lib/cloud/providers/azure/AzureStorage.cc
→
src/src/lib/cloud/providers/azure/
cpprest/
AzureStorage.cc
View file @
c8ee76ae
...
...
@@ -17,7 +17,7 @@
#define BUILDING_DLL
#include
"auth/auth_provider.h"
#include
"cloud/providers/azure/AzureStorage.h"
#include
"cloud/providers/azure/
cpprest/
AzureStorage.h"
#include
"accessors/GcsAccessor.h"
#include
"shared/config.h"
#include
"shared/mex.h"
...
...
@@ -41,7 +41,7 @@
#include
<codecvt>
#include
<regex>
namespace
seismicdrive
{
namespace
seismicdrive
{
namespace
cpprest
{
template
<
class
Catch
,
class
Throw
>
...
...
@@ -813,4 +813,5 @@ namespace seismicdrive {
std
::
vector
<
std
::
pair
<
std
::
string
,
uint64_t
>>
AzureStorage
::
ls
(
const
std
::
string
&
objPath
,
const
GcsContext
*
pContext
)
{
return
_impl
->
ls
(
objPath
,
pContext
);
}
}
}
}
// namespace seismicdrive::cpprest
src/src/lib/cloud/providers/azure/AzureStorage.h
→
src/src/lib/cloud/providers/azure/
cpprest/
AzureStorage.h
View file @
c8ee76ae
...
...
@@ -23,7 +23,7 @@
#include
<was/blob.h>
namespace
seismicdrive
{
namespace
seismicdrive
{
namespace
cpprest
{
class
AzureStorageImpl
;
...
...
@@ -343,6 +343,6 @@ private:
};
}
// namespace seismicdrive
}
}
// namespace seismicdrive
::cpprest
#endif // SDAPI_AZURESTORAGE_H
src/src/lib/cloud/providers/azure
_new
/AzureStorage
New
.cc
→
src/src/lib/cloud/providers/azure
/curl
/AzureStorage.cc
View file @
c8ee76ae
This diff is collapsed.
Click to expand it.
src/src/lib/cloud/providers/azure
_new
/AzureStorage
New
.h
→
src/src/lib/cloud/providers/azure
/curl
/AzureStorage.h
View file @
c8ee76ae
...
...
@@ -14,25 +14,24 @@
// limitations under the License.
// ============================================================================
#ifndef SDAPI_AZURESTORAGE_NEW_H
#define SDAPI_AZURESTORAGE_NEW_H
#pragma once
#include
"DLL_EXPORT.h"
#include
"cloud/providers/Storage.h"
namespace
seismicdrive
{
namespace
seismicdrive
{
namespace
curl
{
// For the only purpose of mocking
class
AzureStorage
New
Impl
;
class
AzureStorageImpl
;
// --------------------------------
// Azure Cloud Blob Client Interface
// --------------------------------
struct
CloudBlobClient
New
IF
struct
CloudBlobClientIF
{
virtual
~
CloudBlobClient
New
IF
()
=
default
;
virtual
~
CloudBlobClientIF
()
=
default
;
virtual
bool
exists
(
const
std
::
string
&
container_name
,
const
std
::
string
&
blob_name
,
const
GcsContext
*
pContext
)
=
0
;
virtual
void
upload_from_file
(
const
std
::
string
&
container_name
,
const
std
::
string
&
blob_name
,
const
std
::
string
&
file_name
,
const
GcsContext
*
pContext
)
=
0
;
virtual
void
upload_from
(
const
std
::
string
&
container_name
,
const
std
::
string
&
blob_name
,
const
char
*
source
,
std
::
uint64_t
length
,
const
GcsContext
*
pContext
)
=
0
;
...
...
@@ -43,14 +42,14 @@ namespace seismicdrive
virtual
void
list_blobs_segmented
(
const
std
::
string
&
container_name
,
const
std
::
string
&
prefix
,
bool
recursiveList
,
std
::
string
*
nextPageToken
,
std
::
vector
<
StorageObjectInfo
>
*
result
,
const
GcsContext
*
pContext
)
=
0
;
virtual
void
list_blobs_segmented
(
const
std
::
string
&
container_name
,
const
std
::
string
&
prefix
,
bool
recursiveList
,
std
::
string
*
nextPageToken
,
std
::
vector
<
std
::
pair
<
std
::
string
,
std
::
uint64_t
>>
*
result
,
const
GcsContext
*
pContext
)
=
0
;
};
struct
CloudBlobClient
New
FactoryIF
struct
CloudBlobClientFactoryIF
{
virtual
~
CloudBlobClient
New
FactoryIF
()
=
default
;
virtual
std
::
shared_ptr
<
CloudBlobClient
New
IF
>
create
(
const
std
::
string
&
account_name
,
const
std
::
string
&
sas_token
)
=
0
;
virtual
~
CloudBlobClientFactoryIF
()
=
default
;
virtual
std
::
shared_ptr
<
CloudBlobClientIF
>
create
(
const
std
::
string
&
account_name
,
const
std
::
string
&
sas_token
)
=
0
;
};
/*******************************************************************************/
/**
* @class AzureStorage
New
AzureStorage
New
.h
* @class AzureStorage AzureStorage.h
*
* @brief This class is an accessor for the Azure blob storage objects.
*
...
...
@@ -58,18 +57,18 @@ namespace seismicdrive
*
******************************************************************************/
class
AzureStorage
New
:
public
StorageIF
class
AzureStorage
:
public
StorageIF
{
public:
/*******************************************************************************/
/**
* @brief Default constructor.
*
* This contructor creates a AzureStorage
New
object and
* This contructor creates a AzureStorage object and
* initialize the dataset info.
*
******************************************************************************/
AzureStorage
New
();
AzureStorage
();
/*******************************************************************************/
/**
* @brief Parameterized contructor
...
...
@@ -80,40 +79,40 @@ namespace seismicdrive
* @param sdresource is the seismic drive subproject resource (optional if the auth provider is a google default one)
* @param readonly define the access policy (read or readwrite)
******************************************************************************/
AzureStorage
New
(
void
*
auth_provider
,
const
std
::
string
&
sdresource
=
""
,
const
bool
readonly
=
false
);
AzureStorage
(
void
*
auth_provider
,
const
std
::
string
&
sdresource
=
""
,
const
bool
readonly
=
false
);
/*******************************************************************************/
/**
* @brief Copy Constructor.
*
******************************************************************************/
AzureStorage
New
(
const
AzureStorage
New
&
rhs
)
=
delete
;
AzureStorage
(
const
AzureStorage
&
rhs
)
=
delete
;
/*******************************************************************************/
/**
* @brief Copy Assignment Operator.
*
******************************************************************************/
AzureStorage
New
&
operator
=
(
const
AzureStorage
New
&
)
=
delete
;
AzureStorage
&
operator
=
(
const
AzureStorage
&
)
=
delete
;
/*******************************************************************************/
/**
* @brief Move Constructor.
*
******************************************************************************/
AzureStorage
New
(
AzureStorage
New
&&
op
)
noexcept
;
AzureStorage
(
AzureStorage
&&
op
)
noexcept
;
/*******************************************************************************/
/**
<