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
Open VDS
Commits
d61a4a09
Commit
d61a4a09
authored
Mar 15, 2022
by
Jørgen Lind
Browse files
Merge branch 'feature/jorgen.lind/update_2.2' into '2.2'
update_2.2 for 2.2.2 See merge request
!580
parents
e473d6ff
50213984
Pipeline
#98695
passed with stages
in 42 minutes and 38 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMake/BuildLibreSSL.cmake
View file @
d61a4a09
...
...
@@ -4,11 +4,11 @@ function(BuildLibreSSL)
if
(
${
_isMultiConfig
}
)
set
(
TOOLSET_VERSION
${
MSVC_TOOLSET_VERSION_LOCAL
}
)
endif
()
list
(
APPEND LIBRESSL_LIBS_LIST
"lib/crypto-4
6
.lib"
)
list
(
APPEND LIBRESSL_LIBS_LIST
"lib/tls-2
0
.lib"
)
list
(
APPEND LIBRESSL_LIBS_LIST
"lib/crypto-4
9
.lib"
)
list
(
APPEND LIBRESSL_LIBS_LIST
"lib/tls-2
4
.lib"
)
list
(
APPEND LIBRESSL_DLLS_LIST
"bin/crypto-4
6
.dll"
)
list
(
APPEND LIBRESSL_DLLS_LIST
"bin/tls-2
0
.dll"
)
list
(
APPEND LIBRESSL_DLLS_LIST
"bin/crypto-4
9
.dll"
)
list
(
APPEND LIBRESSL_DLLS_LIST
"bin/tls-2
4
.dll"
)
list
(
APPEND CMAKE_ARGS
"-DLIBRESSL_APPS=OFF"
)
list
(
APPEND CMAKE_ARGS
"-DLIBRESSL_TESTS=OFF"
)
...
...
CMake/Fetch3rdPartyInBuild.cmake
View file @
d61a4a09
...
...
@@ -99,7 +99,7 @@ function(Fetch3rdParty)
Fetch3rdParty_Package
(
curl 7.73.0 https://github.com/curl/curl/releases/download/curl-7_73_0/curl-7.73.0.tar.gz SHA256=ba98332752257b47b9dea6d8c0ad25ec1745c20424f1dd3ff2c99ab59e97cf91
)
Fetch3rdParty_Package
(
libuv 1.34.1 https://github.com/libuv/libuv/archive/v1.34.1.tar.gz SHA256=e3e0105c9b26e181e0547607cb6893462beb0c652674c3795766b2e5555288b3
)
Fetch3rdParty_Package
(
zlib 1.2.11 http://zlib.net/zlib-1.2.11.tar.gz SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
)
Fetch3rdParty_Package
(
libressl 3.
3
.0 https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.
3
.0.tar.gz SHA256=
728a5edc63ccb418e9166bed11d4b43e9629ff1c4d42a39b649347a20416fad6
)
Fetch3rdParty_Package
(
libressl 3.
5
.0 https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.
5
.0.tar.gz SHA256=
f01d4f76191558158a06afbdc2405fefd5b02540a197ab2546c840e06a5c0fb7
)
Fetch3rdParty_Package
(
absl 20200225.2 https://codeload.github.com/abseil/abseil-cpp/tar.gz/20200225.2 SHA256=f41868f7a938605c92936230081175d1eae87f6ea2c248f41077c8f88316f111
)
Fetch3rdParty_Package
(
crc32c 1.1.1 https://codeload.github.com/google/crc32c/tar.gz/1.1.1 SHA256=a6533f45b1670b5d59b38a514d82b09c6fb70cc1050467220216335e873074e8
)
Fetch3rdParty_Package
(
google-cloud-cpp 1.14.0 https://codeload.github.com/googleapis/google-cloud-cpp/tar.gz/v1.14.0 SHA256=839b2d4dcb36a671734dac6b30ea8c298bbeaafcf7a45ee4a7d7aa5986b16569
)
...
...
VERSION
View file @
d61a4a09
2.2.
1
2.2.
2
src/OpenVDS/BulkDataStore/VDSObjectParser.cpp
View file @
d61a4a09
...
...
@@ -113,6 +113,11 @@ size_t GetVDSObjectJsonString(const Parser *parser, char *jsonStringBuffer, size
return
oss
.
str
().
size
();
}
static
bool
TranslateBoolean
(
Json
::
Value
const
&
root
,
const
char
*
member
)
{
return
root
.
isMember
(
member
)
&&
root
[
member
].
asString
()
!=
"FALSE"
;
}
Json
::
Value
TranslateVolumeDataLayoutDescriptor
(
Json
::
Value
const
&
root
)
{
int
brickSize
=
0
;
...
...
@@ -128,8 +133,8 @@ Json::Value TranslateVolumeDataLayoutDescriptor(Json::Value const & root)
layoutDescriptorJson
[
"positiveMargin"
]
=
root
[
"PositiveMargin"
].
asInt
();
layoutDescriptorJson
[
"brickSize2DMultiplier"
]
=
4
;
// FIXME: Check if object type is VDSSpread and set to 1 in that case
layoutDescriptorJson
[
"lodLevels"
]
=
(
lodLevels
==
0
)
?
std
::
string
(
"LODLevels_None"
)
:
fmt
::
format
(
"LODLevels_{}"
,
lodLevels
);
layoutDescriptorJson
[
"create2DLODs"
]
=
(
root
[
"Create2DLODs"
].
asString
()
!=
"FALSE"
);
layoutDescriptorJson
[
"forceFullResolutionDimension"
]
=
(
root
[
"ForceFullResolutionDimension"
].
asString
()
!=
"FALSE"
);
layoutDescriptorJson
[
"create2DLODs"
]
=
TranslateBoolean
(
root
,
"Create2DLODs"
);
layoutDescriptorJson
[
"forceFullResolutionDimension"
]
=
TranslateBoolean
(
root
,
"ForceFullResolutionDimension"
);
layoutDescriptorJson
[
"fullResolutionDimension"
]
=
root
[
"FullResolutionDimension"
].
asInt
();
return
layoutDescriptorJson
;
}
...
...
@@ -190,10 +195,10 @@ Json::Value TranslateChannelDescriptor(Json::Value const & root, bool isPrimaryC
channelDescriptorJson
[
"valueRange"
]
=
valueRangeJson
;
channelDescriptorJson
[
"channelMapping"
]
=
isPrimaryChannel
?
"Direct"
:
(
root
[
"ChannelMapping"
].
asInt64
()
==
1976800267773298824LL
?
"PerTrace"
:
"Direct"
);
channelDescriptorJson
[
"mappedValues"
]
=
isPrimaryChannel
?
0
:
root
[
"MappedValues"
].
asInt
();
channelDescriptorJson
[
"discrete"
]
=
(
root
[
"DiscreteData"
].
asString
()
!=
"FALSE"
);
channelDescriptorJson
[
"renderable"
]
=
isPrimaryChannel
?
true
:
(
root
[
"Renderable"
].
asString
()
!=
"FALSE"
);
channelDescriptorJson
[
"allowLossyCompression"
]
=
isPrimaryChannel
?
!
(
root
[
"DiscreteData"
].
asString
()
!=
"FALSE"
)
:
(
root
[
"AllowLossyCompression"
].
asString
()
!=
"FALSE"
);
channelDescriptorJson
[
"useNoValue"
]
=
(
root
[
"UseNoValue"
].
asString
()
!=
"FALSE"
);
channelDescriptorJson
[
"discrete"
]
=
TranslateBoolean
(
root
,
"DiscreteData"
);
channelDescriptorJson
[
"renderable"
]
=
isPrimaryChannel
?
true
:
TranslateBoolean
(
root
,
"Renderable"
);
channelDescriptorJson
[
"allowLossyCompression"
]
=
isPrimaryChannel
?
!
TranslateBoolean
(
root
,
"DiscreteData"
)
:
TranslateBoolean
(
root
,
"AllowLossyCompression"
);
channelDescriptorJson
[
"useNoValue"
]
=
TranslateBoolean
(
root
,
"UseNoValue"
);
channelDescriptorJson
[
"noValue"
]
=
root
[
"NoValue"
].
asFloat
();
channelDescriptorJson
[
"integerScale"
]
=
root
[
"IntegerScale"
].
asFloat
();
channelDescriptorJson
[
"integerOffset"
]
=
root
[
"IntegerOffset"
].
asFloat
();
...
...
src/OpenVDS/CMakeLists.txt
View file @
d61a4a09
...
...
@@ -103,6 +103,7 @@ set (PRIVATE_HEADER_FILES
VDS/ConnectionStringParser.h
VDS/GlobalStateImpl.h
VDS/StringToDouble.h
VDS/LayerMetadataContainer.h
${
COMMON_DIR
}
/Base64/Base64.h
${
COMMON_DIR
}
/ThreadPool/ThreadPool.h
json_cpp_include.h
)
...
...
src/OpenVDS/OpenVDS.cpp
View file @
d61a4a09
...
...
@@ -612,7 +612,7 @@ static bool Init(VDS *vds, VolumeDataStore *volumeDataStore, Error& error)
{
return
false
;
}
if
(
!
ParseVolumeDataLayout
(
serializedVolumeDataLayout
,
vds
->
layoutDescriptor
,
vds
->
axisDescriptors
,
vds
->
channelDescriptors
,
vds
->
descriptorStrings
,
vds
->
metadataContainer
,
error
))
if
(
!
ParseVolumeDataLayout
(
serializedVolumeDataLayout
,
vds
->
layoutDescriptor
,
vds
->
axisDescriptors
,
vds
->
channelDescriptors
,
vds
->
descriptorStrings
,
vds
->
metadataContainer
,
vds
->
volumeDataStore
->
GetLayerMetadataContainer
(),
error
))
{
return
false
;
}
...
...
src/OpenVDS/VDS/LayerMetadataContainer.h
0 → 100644
View file @
d61a4a09
/****************************************************************************
** Copyright 2022 The Open Group
** Copyright 2022 Bluware, Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
****************************************************************************/
#ifndef LAYERMETADATACONTAINER_H
#define LAYERMETADATACONTAINER_H
namespace
OpenVDS
{
class
LayerMetadataContainer
{
public:
virtual
bool
GetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
)
const
=
0
;
virtual
bool
IsChannelZipped
(
std
::
string
const
&
channelName
,
bool
isPrimary
)
const
=
0
;
virtual
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
std
::
string
const
&
channelName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
=
0
;
};
}
#endif
src/OpenVDS/VDS/MetadataManager.cpp
View file @
d61a4a09
...
...
@@ -69,9 +69,10 @@ MetadataPage *metadataPage;
std
::
vector
<
uint8_t
>
metadata
;
};
MetadataManager
::
MetadataManager
(
IOManager
*
iomanager
,
std
::
string
const
&
layerUrl
,
MetadataStatus
const
&
metadataStatus
,
int
pageLimit
)
MetadataManager
::
MetadataManager
(
IOManager
*
iomanager
,
std
::
string
const
&
layerUrl
,
std
::
string
const
&
channelName
,
MetadataStatus
const
&
metadataStatus
,
int
pageLimit
)
:
m_iomanager
(
iomanager
)
,
m_layerUrl
(
layerUrl
)
,
m_channelName
(
channelName
)
,
m_metadataStatus
(
metadataStatus
)
,
m_pageLimit
(
pageLimit
)
{
...
...
src/OpenVDS/VDS/MetadataManager.h
View file @
d61a4a09
...
...
@@ -94,6 +94,7 @@ namespace OpenVDS
{
IOManager
*
m_iomanager
;
std
::
string
m_layerUrl
;
std
::
string
m_channelName
;
MetadataStatus
m_metadataStatus
;
...
...
@@ -109,11 +110,12 @@ namespace OpenVDS
void
LimitPages
();
public:
MetadataManager
(
IOManager
*
iomanager
,
std
::
string
const
&
layerURL
,
MetadataStatus
const
&
MetadataStatus
,
int
pageLimit
);
MetadataManager
(
IOManager
*
iomanager
,
std
::
string
const
&
layerURL
,
std
::
string
const
&
channelName
,
MetadataStatus
const
&
MetadataStatus
,
int
pageLimit
);
~
MetadataManager
();
const
char
*
LayerUrl
()
const
{
return
m_layerUrl
.
c_str
();
}
const
std
::
string
&
LayerUrlStr
()
const
{
return
m_layerUrl
;
}
const
std
::
string
&
ChannelName
()
const
{
return
m_channelName
;
}
MetadataPage
*
LockPage
(
int
pageIndex
,
bool
*
InitiateTransfer
);
...
...
src/OpenVDS/VDS/ParseVDSJson.cpp
View file @
d61a4a09
...
...
@@ -910,7 +910,7 @@ bool DownloadAndParseVolumeDataLayoutAndLayerStatus(VDS& vds, Error& error)
try
{
if
(
!
ParseVolumeDataLayout
(
serializedVolumeDataLayout
,
vds
.
layoutDescriptor
,
vds
.
axisDescriptors
,
vds
.
channelDescriptors
,
vds
.
descriptorStrings
,
vds
.
metadataContainer
,
error
))
if
(
!
ParseVolumeDataLayout
(
serializedVolumeDataLayout
,
vds
.
layoutDescriptor
,
vds
.
axisDescriptors
,
vds
.
channelDescriptors
,
vds
.
descriptorStrings
,
vds
.
metadataContainer
,
vds
.
volumeDataStore
->
GetLayerMetadataContainer
(),
error
))
return
false
;
}
...
...
@@ -926,7 +926,7 @@ bool DownloadAndParseVolumeDataLayoutAndLayerStatus(VDS& vds, Error& error)
return
true
;
}
bool
ParseVolumeDataLayout
(
const
std
::
vector
<
uint8_t
>
&
json
,
VolumeDataLayoutDescriptor
&
layoutDescriptor
,
std
::
vector
<
VolumeDataAxisDescriptor
>
&
axisDescriptors
,
std
::
vector
<
VolumeDataChannelDescriptor
>
&
channelDescriptors
,
DescriptorStringContainer
&
descriptorStrings
,
MetadataContainer
&
metadataContainer
,
Error
&
error
)
bool
ParseVolumeDataLayout
(
const
std
::
vector
<
uint8_t
>
&
json
,
VolumeDataLayoutDescriptor
&
layoutDescriptor
,
std
::
vector
<
VolumeDataAxisDescriptor
>
&
axisDescriptors
,
std
::
vector
<
VolumeDataChannelDescriptor
>
&
channelDescriptors
,
DescriptorStringContainer
&
descriptorStrings
,
MetadataContainer
&
metadataContainer
,
const
LayerMetadataContainer
&
layerMetadaContainer
,
Error
&
error
)
{
Json
::
Value
root
;
...
...
@@ -968,8 +968,11 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VolumeDataLayoutDes
axisDescriptors
.
push_back
(
axisDescriptor
);
}
bool
primary
=
true
;
for
(
const
Json
::
Value
&
channelDescriptorJson
:
root
[
"channelDescriptors"
])
{
bool
noLossyCompressionUseZip
=
layerMetadaContainer
.
IsChannelZipped
(
channelDescriptorJson
[
"name"
].
asString
(),
primary
)
&&
!
channelDescriptorJson
[
"allowLossyCompression"
].
asBool
();
primary
=
false
;
if
(
channelDescriptorJson
[
"useNoValue"
].
asBool
())
{
VolumeDataChannelDescriptor
...
...
@@ -983,7 +986,8 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VolumeDataLayoutDes
channelDescriptorJson
[
"mappedValues"
].
asInt
(),
(
channelDescriptorJson
[
"discrete"
].
asBool
()
?
VolumeDataChannelDescriptor
::
DiscreteData
:
VolumeDataChannelDescriptor
::
Default
)
|
(
channelDescriptorJson
[
"renderable"
].
asBool
()
?
VolumeDataChannelDescriptor
::
Default
:
VolumeDataChannelDescriptor
::
NotRenderable
)
|
(
channelDescriptorJson
[
"allowLossyCompression"
].
asBool
()
?
VolumeDataChannelDescriptor
::
Default
:
VolumeDataChannelDescriptor
::
NoLossyCompression
),
(
channelDescriptorJson
[
"allowLossyCompression"
].
asBool
()
?
VolumeDataChannelDescriptor
::
Default
:
VolumeDataChannelDescriptor
::
NoLossyCompression
)
|
(
noLossyCompressionUseZip
?
VolumeDataChannelDescriptor
::
NoLossyCompressionUseZip
:
VolumeDataChannelDescriptor
::
Default
),
channelDescriptorJson
[
"noValue"
].
asFloat
(),
channelDescriptorJson
[
"integerScale"
].
asFloat
(),
channelDescriptorJson
[
"integerOffset"
].
asFloat
());
...
...
@@ -1003,7 +1007,8 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VolumeDataLayoutDes
channelDescriptorJson
[
"mappedValues"
].
asInt
(),
(
channelDescriptorJson
[
"discrete"
].
asBool
()
?
VolumeDataChannelDescriptor
::
DiscreteData
:
VolumeDataChannelDescriptor
::
Default
)
|
(
channelDescriptorJson
[
"renderable"
].
asBool
()
?
VolumeDataChannelDescriptor
::
Default
:
VolumeDataChannelDescriptor
::
NotRenderable
)
|
(
channelDescriptorJson
[
"allowLossyCompression"
].
asBool
()
?
VolumeDataChannelDescriptor
::
Default
:
VolumeDataChannelDescriptor
::
NoLossyCompression
),
(
channelDescriptorJson
[
"allowLossyCompression"
].
asBool
()
?
VolumeDataChannelDescriptor
::
Default
:
VolumeDataChannelDescriptor
::
NoLossyCompression
)
|
(
noLossyCompressionUseZip
?
VolumeDataChannelDescriptor
::
NoLossyCompressionUseZip
:
VolumeDataChannelDescriptor
::
Default
),
channelDescriptorJson
[
"integerScale"
].
asFloat
(),
channelDescriptorJson
[
"integerOffset"
].
asFloat
());
...
...
@@ -1159,12 +1164,14 @@ bool ParseLayerStatus(const std::vector<uint8_t> &json, VDS &vds, LayerMetadataC
std
::
string
layerName
=
layerStatus
[
"layerName"
].
asString
();
std
::
string
channelName
=
layerStatus
[
"channelName"
].
asString
();
if
(
hasChunkMetadataPages
)
{
int
pageLimit
=
vds
.
axisDescriptors
.
size
()
<=
3
?
64
:
1024
;
layerMetadataContainer
.
SetMetadataStatus
(
layerName
,
metadataStatus
,
pageLimit
);
layerMetadataContainer
.
SetMetadataStatus
(
layerName
,
channelName
,
metadataStatus
,
pageLimit
);
}
}
}
...
...
src/OpenVDS/VDS/ParseVDSJson.h
View file @
d61a4a09
...
...
@@ -23,7 +23,7 @@
namespace
OpenVDS
{
bool
ParseVolumeDataLayout
(
const
std
::
vector
<
uint8_t
>
&
json
,
VolumeDataLayoutDescriptor
&
layoutDescriptor
,
std
::
vector
<
VolumeDataAxisDescriptor
>
&
axisDescriptors
,
std
::
vector
<
VolumeDataChannelDescriptor
>
&
channelDescriptors
,
DescriptorStringContainer
&
descriptorStrings
,
MetadataContainer
&
metadataContainer
,
Error
&
error
);
bool
ParseVolumeDataLayout
(
const
std
::
vector
<
uint8_t
>
&
json
,
VolumeDataLayoutDescriptor
&
layoutDescriptor
,
std
::
vector
<
VolumeDataAxisDescriptor
>
&
axisDescriptors
,
std
::
vector
<
VolumeDataChannelDescriptor
>
&
channelDescriptors
,
DescriptorStringContainer
&
descriptorStrings
,
MetadataContainer
&
metadataContainer
,
const
LayerMetadataContainer
&
layerMetadaContainer
,
Error
&
error
);
bool
ParseLayerStatus
(
const
std
::
vector
<
uint8_t
>
&
json
,
VDS
&
vds
,
LayerMetadataContainer
&
layerMetadataContainer
,
Error
&
error
);
std
::
vector
<
uint8_t
>
SerializeVolumeDataLayout
(
VDS
&
vds
);
std
::
vector
<
uint8_t
>
SerializeLayerStatus
(
VDS
&
vds
,
LayerMetadataContainer
const
&
layerMetadataContainer
);
...
...
src/OpenVDS/VDS/VDS.h
View file @
d61a4a09
...
...
@@ -40,13 +40,6 @@
namespace
OpenVDS
{
class
LayerMetadataContainer
{
public:
virtual
bool
GetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
)
const
=
0
;
virtual
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
=
0
;
};
class
DescriptorStringContainer
{
std
::
vector
<
std
::
unique_ptr
<
char
[]
>>
m_descriptorStrings
;
...
...
src/OpenVDS/VDS/VolumeDataStore.h
View file @
d61a4a09
...
...
@@ -28,6 +28,7 @@
#include
"VolumeDataHash.h"
#include
"ParsedMetadata.h"
#include
"GlobalStateImpl.h"
#include
"LayerMetadataContainer.h"
#include
<vector>
#include
<map>
...
...
@@ -71,6 +72,8 @@ public:
virtual
bool
WriteSerializedVolumeDataLayout
(
const
std
::
vector
<
uint8_t
>&
serializedVolumeDataLayout
,
Error
&
error
)
=
0
;
virtual
bool
AddLayer
(
VolumeDataLayer
*
volumeDataLayer
,
int
chunkMetadataPageSize
)
=
0
;
virtual
bool
RemoveLayer
(
VolumeDataLayer
*
volumeDataLayer
)
=
0
;
virtual
const
LayerMetadataContainer
&
GetLayerMetadataContainer
()
const
=
0
;
bool
DeserializeVolumeData
(
const
VolumeDataChunk
&
volumeDataChunk
,
const
std
::
vector
<
uint8_t
>&
serializedData
,
const
std
::
vector
<
uint8_t
>&
metadata
,
CompressionMethod
compressionMethod
,
int32_t
adaptiveLevel
,
VolumeDataChannelDescriptor
::
Format
loadFormat
,
DataBlock
&
dataBlock
,
std
::
vector
<
uint8_t
>&
target
,
Error
&
error
);
...
...
src/OpenVDS/VDS/VolumeDataStoreIOManager.cpp
View file @
d61a4a09
...
...
@@ -303,7 +303,8 @@ VolumeDataStoreIOManager::AddLayer(VolumeDataLayer* volumeDataLayer, int chunkMe
int
pageLimit
=
volumeDataLayer
->
GetLayout
()
->
GetDimensionality
()
<=
3
?
64
:
1024
;
SetMetadataStatus
(
GetLayerName
(
*
volumeDataLayer
),
metadataStatus
,
pageLimit
);
std
::
string
channelName
=
volumeDataLayer
->
GetLayout
()
->
GetChannelName
(
volumeDataLayer
->
GetChannelIndex
());;
SetMetadataStatus
(
GetLayerName
(
*
volumeDataLayer
),
channelName
,
metadataStatus
,
pageLimit
);
return
true
;
}
...
...
@@ -858,14 +859,30 @@ VolumeDataStoreIOManager::GetMetadataStatus(std::string const &layerName, Metada
}
}
bool
VolumeDataStoreIOManager
::
IsChannelZipped
(
std
::
string
const
&
channelName
,
bool
isPrimaryChannel
)
const
{
(
void
)
isPrimaryChannel
;
std
::
unique_lock
<
std
::
mutex
>
lock
(
m_mutex
);
for
(
auto
&
metadataManager
:
m_metadataManagers
)
{
const
std
::
string
&
metaChannelName
=
metadataManager
.
second
->
ChannelName
();
if
(
metaChannelName
==
channelName
)
{
return
metadataManager
.
second
->
GetMetadataStatus
().
m_compressionMethod
==
CompressionMethod
::
Zip
;
}
}
return
false
;
}
void
VolumeDataStoreIOManager
::
SetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
VolumeDataStoreIOManager
::
SetMetadataStatus
(
std
::
string
const
&
layerName
,
std
::
string
const
&
channelName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
m_mutex
);
if
(
m_metadataManagers
.
find
(
layerName
)
==
m_metadataManagers
.
end
())
{
m_metadataManagers
.
insert
(
std
::
make_pair
(
layerName
,
std
::
unique_ptr
<
MetadataManager
>
(
new
MetadataManager
(
m_ioManager
.
get
(),
layerName
,
metadataStatus
,
pageLimit
))));
m_metadataManagers
.
insert
(
std
::
make_pair
(
layerName
,
std
::
unique_ptr
<
MetadataManager
>
(
new
MetadataManager
(
m_ioManager
.
get
(),
layerName
,
channelName
,
metadataStatus
,
pageLimit
))));
}
}
...
...
src/OpenVDS/VDS/VolumeDataStoreIOManager.h
View file @
d61a4a09
...
...
@@ -135,7 +135,11 @@ public:
bool
RemoveLayer
(
VolumeDataLayer
*
volumeDataLayer
)
override
{
return
false
;
}
bool
GetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
)
const
override
;
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
override
;
bool
IsChannelZipped
(
std
::
string
const
&
channelName
,
bool
isPrimaryChannel
)
const
override
;
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
std
::
string
const
&
channelName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
override
;
const
LayerMetadataContainer
&
GetLayerMetadataContainer
()
const
override
{
return
*
this
;
}
VolumeDataStoreIOManager
(
VDS
&
vds
,
IOManager
*
ioManager
);
~
VolumeDataStoreIOManager
();
...
...
src/OpenVDS/VDS/VolumeDataStoreVDSFile.cpp
View file @
d61a4a09
...
...
@@ -485,7 +485,32 @@ bool VolumeDataStoreVDSFile::GetMetadataStatus(std::string const &layerName, Met
return
true
;
}
void
VolumeDataStoreVDSFile
::
SetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
bool
VolumeDataStoreVDSFile
::
IsChannelZipped
(
std
::
string
const
&
channelName
,
bool
isPrimary
)
const
{
for
(
auto
&
layerFileEntry
:
m_layerFiles
)
{
const
LayerFile
*
layerFile
=
&
layerFileEntry
.
second
;
std
::
string
layerName
=
layerFile
->
fileInterface
->
GetFileName
();
size_t
lodIndex
=
layerName
.
rfind
(
"LOD"
);
size_t
dimensionsIndex
=
layerName
.
rfind
(
"Dimensions_"
);
if
(
lodIndex
==
std
::
string
::
npos
||
dimensionsIndex
==
std
::
string
::
npos
||
lodIndex
<
dimensionsIndex
)
{
continue
;
}
std
::
string
cName
=
layerName
.
substr
(
0
,
dimensionsIndex
);
if
((
isPrimary
&&
cName
.
empty
())
||
cName
==
channelName
)
{
return
CompressionMethod
(
layerFile
->
layerMetadata
.
m_compressionMethod
)
==
CompressionMethod
::
Zip
;
}
}
return
false
;
}
void
VolumeDataStoreVDSFile
::
SetMetadataStatus
(
std
::
string
const
&
layerName
,
std
::
string
const
&
channelName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
{
assert
(
0
&&
"Not implemented"
);
}
...
...
src/OpenVDS/VDS/VolumeDataStoreVDSFile.h
View file @
d61a4a09
...
...
@@ -80,7 +80,11 @@ public:
bool
RemoveLayer
(
VolumeDataLayer
*
volumeDataLayer
)
override
{
return
false
;
}
bool
GetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
)
const
override
;
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
override
;
bool
IsChannelZipped
(
std
::
string
const
&
channelName
,
bool
isPrimary
)
const
override
;
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
std
::
string
const
&
channelName
,
MetadataStatus
&
metadataStatus
,
int
pageLimit
)
override
;
const
LayerMetadataContainer
&
GetLayerMetadataContainer
()
const
override
{
return
*
this
;
}
VolumeDataStoreVDSFile
(
VDS
&
vds
,
const
std
::
string
&
fileName
,
Mode
mode
,
Error
&
error
);
~
VolumeDataStoreVDSFile
();
...
...
tests/VDS/ParseVDSJsonTest.cpp
View file @
d61a4a09
...
...
@@ -68,8 +68,10 @@ public:
return
false
;
}
}
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
OpenVDS
::
MetadataStatus
&
metadataStatus
,
int
/*pageLimit*/
)
override
bool
IsChannelZipped
(
std
::
string
const
&
,
bool
)
const
override
{
return
false
;
}
void
SetMetadataStatus
(
std
::
string
const
&
layerName
,
std
::
string
const
&
channelName
,
OpenVDS
::
MetadataStatus
&
metadataStatus
,
int
/*pageLimit*/
)
override
{
(
void
)
channelName
;
m_metadataStatusMap
[
layerName
]
=
metadataStatus
;
}
};
...
...
@@ -130,14 +132,14 @@ GTEST_TEST(VDS_integration, ParseVolumeDataLayoutAndLayerStatus)
// Clear error
error
=
OpenVDS
::
Error
();
// Parse volume data layout
OpenVDS
::
ParseVolumeDataLayout
(
serializedVolumeDataLayoutReference
,
handle
.
layoutDescriptor
,
handle
.
axisDescriptors
,
handle
.
channelDescriptors
,
handle
.
descriptorStrings
,
handle
.
metadataContainer
,
error
);
EXPECT_EQ
(
error
.
code
,
0
);
// Parse layer status
OpenVDS
::
ParseLayerStatus
(
serializedLayerStatusReference
,
handle
,
layerMetadataContainer
,
error
);
EXPECT_EQ
(
error
.
code
,
0
);
// Parse volume data layout
OpenVDS
::
ParseVolumeDataLayout
(
serializedVolumeDataLayoutReference
,
handle
.
layoutDescriptor
,
handle
.
axisDescriptors
,
handle
.
channelDescriptors
,
handle
.
descriptorStrings
,
handle
.
metadataContainer
,
layerMetadataContainer
,
error
);
EXPECT_EQ
(
error
.
code
,
0
);
// Create volume data layout from descriptors
CreateVolumeDataLayout
(
handle
);
...
...
tools/SEGYImport/SEGYImport.cpp
View file @
d61a4a09
...
...
@@ -3284,7 +3284,7 @@ main(int argc, char* argv[])
{
int
fileIndex
;
const
auto
&
representativeSegment
=
findRepresentativeSegment
(
fileInfo
,
primaryStep
,
fileIndex
);
assert
(
fileIndex
<
dataProviders
.
size
());
assert
(
fileIndex
<
int
(
dataProviders
.
size
())
)
;
switch
(
fileInfo
.
m_dataSampleFormatCode
)
{
case
SEGY
::
BinaryHeader
::
DataSampleFormatCode
::
IBMFloat
:
...
...
@@ -3682,7 +3682,7 @@ main(int argc, char* argv[])
for
(
size_t
fileIndex
=
0
;
fileIndex
<
segmentInfoListsSize
;
++
fileIndex
)
{
assert
(
fileInfo
.
IsOffsetSorted
()
?
chunkInfo
.
min
[
1
]
<
gatherOffsetValues
.
size
()
:
true
);
assert
(
fileInfo
.
IsOffsetSorted
()
?
chunkInfo
.
min
[
1
]
<
int
(
gatherOffsetValues
.
size
()
)
:
true
);
const
int
offsetSortedOffsetValue
=
fileInfo
.
IsOffsetSorted
()
?
gatherOffsetValues
[
chunkInfo
.
min
[
1
]]
:
0
;
...
...
@@ -3905,7 +3905,7 @@ main(int argc, char* argv[])
continue
;
}
assert
(
fileInfo
.
IsOffsetSorted
()
?
chunkInfo
.
min
[
1
]
<
gatherOffsetValues
.
size
()
:
true
);
assert
(
fileInfo
.
IsOffsetSorted
()
?
chunkInfo
.
min
[
1
]
<
int
(
gatherOffsetValues
.
size
()
)
:
true
);
const
int
offsetSortedOffsetValue
=
fileInfo
.
IsOffsetSorted
()
?
gatherOffsetValues
[
chunkInfo
.
min
[
1
]]
:
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment