Commit d838be7f authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Don't use captial first letter on public member variables

parent e4680798
......@@ -44,8 +44,8 @@ IOManager* IOManager::CreateIOManager(const OpenOptions& options, Error &error)
case OpenOptions::AWS:
return new IOManagerAWS(static_cast<const AWSOpenOptions &>(options), error);
default:
error.Code = -1;
error.String = "Unknwon type for OpenOptions";
error.code = -1;
error.string = "Unknwon type for OpenOptions";
return nullptr;
}
}
......
......@@ -130,8 +130,8 @@ namespace OpenVDS
{
lock.lock();
auto s3error = getObjectOutcome.GetError();
objReq->m_error.Code = int(s3error.GetResponseCode());
objReq->m_error.String = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
objReq->m_error.code = int(s3error.GetResponseCode());
objReq->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
}
objReq->m_done = true;
......@@ -185,12 +185,12 @@ namespace OpenVDS
std::unique_lock<std::mutex> lock(m_mutex);
if (!m_done)
{
error.Code = -1;
error.String = "Download not done.";
error.code = -1;
error.string = "Download not done.";
return false;
}
error = m_error;
return m_error.Code == 0;
return m_error.code == 0;
}
void DownloadRequestAWS::Cancel()
......@@ -208,8 +208,8 @@ namespace OpenVDS
if (!outcome.IsSuccess())
{
auto s3error = outcome.GetError();
objReq->m_error.Code = int(s3error.GetResponseCode());
objReq->m_error.String = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
objReq->m_error.code = int(s3error.GetResponseCode());
objReq->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
}
objReq->m_done = true;
......@@ -265,12 +265,12 @@ namespace OpenVDS
std::unique_lock<std::mutex> lock(m_mutex);
if (!m_done)
{
error.Code = -1;
error.String = "Download not done.";
error.code = -1;
error.string = "Download not done.";
return false;
}
error = m_error;
return m_error.Code == 0;
return m_error.code == 0;
}
void UploadRequestAWS::Cancel()
{
......@@ -278,14 +278,14 @@ namespace OpenVDS
}
IOManagerAWS::IOManagerAWS(const AWSOpenOptions& openOptions, Error &error)
: m_region(openOptions.Region)
, m_bucket(openOptions.Bucket)
, m_objectId(openOptions.Key)
: m_region(openOptions.region)
, m_bucket(openOptions.bucket)
, m_objectId(openOptions.key)
{
if (m_region.empty() || m_bucket.empty())
{
error.Code = -1;
error.String = "AWS Config error. Empty bucket or region";
error.code = -1;
error.string = "AWS Config error. Empty bucket or region";
return;
}
......
......@@ -44,8 +44,8 @@ VDS* Open(IOManager *ioManager, Error& error)
{
return nullptr;
}
ret->DataAccessManager.reset(new VolumeDataAccessManagerImpl(*ret.get()));
ret->RequestProcessor.reset(new VolumeDataRequestProcessor(*ret->DataAccessManager.get()));
ret->dataAccessManager.reset(new VolumeDataAccessManagerImpl(*ret.get()));
ret->requestProcessor.reset(new VolumeDataRequestProcessor(*ret->dataAccessManager.get()));
return ret.release();
}
......@@ -53,7 +53,7 @@ VDS *Open(const OpenOptions &options, Error &error)
{
error = Error();
IOManager* ioManager = IOManager::CreateIOManager(options, error);
if (error.Code)
if (error.code)
return nullptr;
return Open(ioManager, error);
......@@ -63,14 +63,14 @@ VolumeDataLayout *GetLayout(VDS *vds)
{
if (!vds)
return nullptr;
return vds->VolumeDataLayout.get();
return vds->volumeDataLayout.get();
}
VolumeDataAccessManager *GetDataAccessManager(VDS *vds)
{
if (!vds)
return nullptr;
return vds->DataAccessManager.get();
return vds->dataAccessManager.get();
}
const char *AddDescriptorString(std::string const &descriptorString, VDS &vds)
......@@ -78,7 +78,7 @@ const char *AddDescriptorString(std::string const &descriptorString, VDS &vds)
char *data = new char[descriptorString.size() + 1];
memcpy(data, descriptorString.data(), descriptorString.size());
data[descriptorString.size()] = 0;
vds.DescriptorStrings.emplace_back(data);
vds.descriptorStrings.emplace_back(data);
return data;
}
......@@ -121,30 +121,30 @@ MetadataManager *FindMetadataManager(LayerMetadataContainer const &layerMetadata
MetadataManager *CreateMetadataManager(VDS &vds, std::string const &layerName, MetadataStatus const &metadataStatus)
{
std::unique_lock<std::mutex> metadataManagersMutexLock(vds.LayerMetadataContainer.mutex);
std::unique_lock<std::mutex> metadataManagersMutexLock(vds.layerMetadataContainer.mutex);
assert(vds.LayerMetadataContainer.managers.find(layerName) == vds.LayerMetadataContainer.managers.end());
int pageLimit = vds.AxisDescriptors.size() <= 3 ? 64 : 1024;
return vds.LayerMetadataContainer.managers.insert(std::make_pair(layerName, std::unique_ptr<MetadataManager>(new MetadataManager(vds.IoManager.get(), layerName, metadataStatus, pageLimit)))).first->second.get();
assert(vds.layerMetadataContainer.managers.find(layerName) == vds.layerMetadataContainer.managers.end());
int pageLimit = vds.axisDescriptors.size() <= 3 ? 64 : 1024;
return vds.layerMetadataContainer.managers.insert(std::make_pair(layerName, std::unique_ptr<MetadataManager>(new MetadataManager(vds.ioManager.get(), layerName, metadataStatus, pageLimit)))).first->second.get();
}
void CreateVolumeDataLayout(VDS &vds)
{
int32_t dimensionality = int32_t(vds.AxisDescriptors.size());
int32_t dimensionality = int32_t(vds.axisDescriptors.size());
// Check if input layouts are valid so we can create a new layout
if (dimensionality < 2)
{
vds.VolumeDataLayout.reset();
vds.volumeDataLayout.reset();
return;
}
vds.VolumeDataLayout.reset(
vds.volumeDataLayout.reset(
new VolumeDataLayoutImpl(
vds,
vds.LayoutDescriptor,
vds.AxisDescriptors,
vds.ChannelDescriptors,
vds.layoutDescriptor,
vds.axisDescriptors,
vds.channelDescriptors,
0, //MIA for now
{ 1, 0 }, //MIA for now
VolumeDataHash::GetUniqueHash(),
......@@ -168,10 +168,10 @@ void CreateVolumeDataLayout(VDS &vds)
assert(nChunkDimensionality == 2 || nChunkDimensionality == 3);
int32_t physicalLODLevels = (nChunkDimensionality == 3 || vds.LayoutDescriptor.IsCreate2DLODs()) ? GetLODCount(vds.LayoutDescriptor) : 1;
int32_t brickSize = GetInternalCubeSizeLOD0(vds.LayoutDescriptor) * (nChunkDimensionality == 2 ? vds.LayoutDescriptor.GetBrickSizeMultiplier2D() : 1);
int32_t physicalLODLevels = (nChunkDimensionality == 3 || vds.layoutDescriptor.IsCreate2DLODs()) ? GetLODCount(vds.layoutDescriptor) : 1;
int32_t brickSize = GetInternalCubeSizeLOD0(vds.layoutDescriptor) * (nChunkDimensionality == 2 ? vds.layoutDescriptor.GetBrickSizeMultiplier2D() : 1);
vds.VolumeDataLayout->CreateLayers(dimensionGroup, brickSize, physicalLODLevels, vds.ProduceStatuses[DimensionGroupUtil::GetDimensionsNDFromDimensionGroup(dimensionGroup)]);
vds.volumeDataLayout->CreateLayers(dimensionGroup, brickSize, physicalLODLevels, vds.produceStatuses[DimensionGroupUtil::GetDimensionsNDFromDimensionGroup(dimensionGroup)]);
}
}
......@@ -180,11 +180,11 @@ VDS* Create(IOManager *ioManager, VolumeDataLayoutDescriptor const &layoutDescri
error = Error();
std::unique_ptr<VDS> vds(new VDS(ioManager));
vds->LayoutDescriptor = layoutDescriptor;
vds->layoutDescriptor = layoutDescriptor;
for(auto axisDescriptor : axisDescriptors)
{
vds->AxisDescriptors.push_back(VolumeDataAxisDescriptor(axisDescriptor.GetNumSamples(), AddDescriptorString(axisDescriptor.GetName(), *vds), AddDescriptorString(axisDescriptor.GetUnit(), *vds), axisDescriptor.GetCoordinateMin(), axisDescriptor.GetCoordinateMax()));
vds->axisDescriptors.push_back(VolumeDataAxisDescriptor(axisDescriptor.GetNumSamples(), AddDescriptorString(axisDescriptor.GetName(), *vds), AddDescriptorString(axisDescriptor.GetUnit(), *vds), axisDescriptor.GetCoordinateMin(), axisDescriptor.GetCoordinateMax()));
}
for(auto channelDescriptor : channelDescriptors)
......@@ -198,29 +198,29 @@ VDS* Create(IOManager *ioManager, VolumeDataLayoutDescriptor const &layoutDescri
if(channelDescriptor.IsUseNoValue())
{
vds->ChannelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.GetFormat(), channelDescriptor.GetComponents(), AddDescriptorString(channelDescriptor.GetName(), *vds), AddDescriptorString(channelDescriptor.GetUnit(), *vds), channelDescriptor.GetValueRangeMin(), channelDescriptor.GetValueRangeMax(), channelDescriptor.GetMapping(), channelDescriptor.GetMappedValueCount(), flags, channelDescriptor.GetNoValue(), channelDescriptor.GetIntegerScale(), channelDescriptor.GetIntegerOffset()));
vds->channelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.GetFormat(), channelDescriptor.GetComponents(), AddDescriptorString(channelDescriptor.GetName(), *vds), AddDescriptorString(channelDescriptor.GetUnit(), *vds), channelDescriptor.GetValueRangeMin(), channelDescriptor.GetValueRangeMax(), channelDescriptor.GetMapping(), channelDescriptor.GetMappedValueCount(), flags, channelDescriptor.GetNoValue(), channelDescriptor.GetIntegerScale(), channelDescriptor.GetIntegerOffset()));
}
else
{
vds->ChannelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.GetFormat(), channelDescriptor.GetComponents(), AddDescriptorString(channelDescriptor.GetName(), *vds), AddDescriptorString(channelDescriptor.GetUnit(), *vds), channelDescriptor.GetValueRangeMin(), channelDescriptor.GetValueRangeMax(), channelDescriptor.GetMapping(), channelDescriptor.GetMappedValueCount(), flags, channelDescriptor.GetIntegerScale(), channelDescriptor.GetIntegerOffset()));
vds->channelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.GetFormat(), channelDescriptor.GetComponents(), AddDescriptorString(channelDescriptor.GetName(), *vds), AddDescriptorString(channelDescriptor.GetUnit(), *vds), channelDescriptor.GetValueRangeMin(), channelDescriptor.GetValueRangeMax(), channelDescriptor.GetMapping(), channelDescriptor.GetMappedValueCount(), flags, channelDescriptor.GetIntegerScale(), channelDescriptor.GetIntegerOffset()));
}
}
vds->MetadataContainer = metadataContainer;
vds->metadataContainer = metadataContainer;
vds->ProduceStatuses.clear();
vds->ProduceStatuses.resize(int(Dimensions_45) + 1, VolumeDataLayer::ProduceStatus_Unavailable);
vds->produceStatuses.clear();
vds->produceStatuses.resize(int(Dimensions_45) + 1, VolumeDataLayer::ProduceStatus_Unavailable);
CreateVolumeDataLayout(*vds);
if (error.Code)
if (error.code)
return nullptr;
if (!SerializeAndUploadVolumeDataLayout(*vds, error))
return nullptr;
vds->DataAccessManager.reset(new VolumeDataAccessManagerImpl(*vds.get()));
vds->RequestProcessor.reset(new VolumeDataRequestProcessor(*vds->DataAccessManager.get()));
vds->dataAccessManager.reset(new VolumeDataAccessManagerImpl(*vds.get()));
vds->requestProcessor.reset(new VolumeDataRequestProcessor(*vds->dataAccessManager.get()));
return vds.release();
}
......@@ -229,7 +229,7 @@ VDS* Create(const OpenOptions& options, VolumeDataLayoutDescriptor const& layout
{
error = Error();
IOManager* ioManager = IOManager::CreateIOManager(options, error);
if (error.Code)
if (error.code)
return nullptr;
return Create(ioManager, layoutDescriptor, axisDescriptors, channelDescriptors, metadataContainer, error);
......
......@@ -50,18 +50,18 @@ protected:
struct AWSOpenOptions : OpenOptions
{
std::string Bucket;
std::string Key;
std::string Region;
std::string bucket;
std::string key;
std::string region;
AWSOpenOptions() : OpenOptions(AWS) {}
AWSOpenOptions(std::string const & bucket, std::string const & key, std::string const & region) : OpenOptions(AWS), Bucket(bucket), Key(key), Region(region) {}
AWSOpenOptions(std::string const & bucket, std::string const & key, std::string const & region) : OpenOptions(AWS), bucket(bucket), key(key), region(region) {}
};
struct Error
{
int Code = 0;
std::string String;
int code = 0;
std::string string;
};
typedef struct VDS *VDSHandle;
......
......@@ -238,12 +238,12 @@ ReadFieldFromHeader(const void *header, HeaderField const &headerField, Endianne
}
// NOTE: SEG-Y byte locations start at 1
int index = headerField.ByteLocation - 1;
int index = headerField.byteLocation - 1;
auto signed_header = reinterpret_cast<const signed char *>(header);
auto unsigned_header = reinterpret_cast<const unsigned char *>(header);
if(headerField.FieldWidth == FieldWidth::FourByte)
if(headerField.fieldWidth == FieldWidth::FourByte)
{
if(endianness == Endianness::BigEndian)
{
......@@ -257,7 +257,7 @@ ReadFieldFromHeader(const void *header, HeaderField const &headerField, Endianne
}
else
{
assert(headerField.FieldWidth == FieldWidth::TwoByte);
assert(headerField.fieldWidth == FieldWidth::TwoByte);
if(endianness == Endianness::BigEndian)
{
return (int16_t)(signed_header[index + 0] << 8 | unsigned_header[index + 1]);
......
......@@ -43,13 +43,13 @@ enum class Endianness
struct HeaderField
{
int ByteLocation;
enum FieldWidth FieldWidth;
int byteLocation;
enum FieldWidth fieldWidth;
HeaderField() = default;
HeaderField(int byteLocation, enum FieldWidth fieldWidth) : ByteLocation(byteLocation), FieldWidth(fieldWidth) {}
HeaderField(int byteLocation, FieldWidth fieldWidth) : byteLocation(byteLocation), fieldWidth(fieldWidth) {}
bool Defined() const { return ByteLocation != 0; }
bool Defined() const { return byteLocation != 0; }
};
namespace BinaryHeader
......
......@@ -81,9 +81,9 @@ main(int argc, char *argv[])
std::unique_ptr<OpenVDS::VDS, decltype(&OpenVDS::Close)> vds(OpenVDS::Open(OpenVDS::AWSOpenOptions(bucket, key, region), openError), &OpenVDS::Close);
if(openError.Code != 0)
if(openError.code != 0)
{
fmt::print(stderr, "Could not open VDS: {}", openError.String);
fmt::print(stderr, "Could not open VDS: {}", openError.string);
return EXIT_FAILURE;
}
......
......@@ -86,8 +86,8 @@ SerializeSEGYHeaderField(SEGY::HeaderField const &headerField)
Json::Value
jsonHeaderField(Json::ValueType::arrayValue);
jsonHeaderField.append(headerField.ByteLocation);
jsonHeaderField.append(ToString(headerField.FieldWidth));
jsonHeaderField.append(headerField.byteLocation);
jsonHeaderField.append(ToString(headerField.fieldWidth));
return jsonHeaderField;
}
......
......@@ -859,9 +859,9 @@ main(int argc, char *argv[])
std::unique_ptr<OpenVDS::VDS, decltype(&OpenVDS::Close)> vds(OpenVDS::Create(OpenVDS::AWSOpenOptions(bucket, key, region), layoutDescriptor, axisDescriptors, channelDescriptors, metadataContainer, createError), &OpenVDS::Close);
if(createError.Code != 0)
if(createError.code != 0)
{
std::cerr << std::string("Create error: " + createError.String);
std::cerr << std::string("Create error: " + createError.string);
return EXIT_FAILURE;
}
......
......@@ -56,8 +56,8 @@ bool InitializeDataBlock(VolumeDataChannelDescriptor::Format format, VolumeDataC
dataBlock.Size[3] = 1;
break;
default:
error.String = "Serialized datablock has illegal dimensionality";
error.Code = -1;
error.string = "Serialized datablock has illegal dimensionality";
error.code = -1;
return false;
}
......@@ -82,8 +82,8 @@ bool InitializeDataBlock(VolumeDataChannelDescriptor::Format format, VolumeDataC
{
char buffer[4096];
snprintf(buffer, sizeof(buffer), "Datablock is too big (%d x %d x %d x %d x %d bytes)", dataBlock.AllocatedSize[0], dataBlock.AllocatedSize[1], dataBlock.AllocatedSize[2], dataBlock.AllocatedSize[3], GetElementSize(dataBlock.Format, dataBlock.Components));
error.String = buffer;
error.Code = -1;
error.string = buffer;
error.code = -1;
return false;
}
return true;
......
......@@ -422,14 +422,14 @@ bool ParseJSONFromBuffer(const std::vector<uint8_t> &json, Json::Value &root, Er
std::unique_ptr<Json::CharReader> reader(rbuilder.newCharReader());
const char *json_begin = reinterpret_cast<const char *>(json.data());
reader->parse(json_begin, json_begin + json.size(), &root, &error.String);
reader->parse(json_begin, json_begin + json.size(), &root, &error.string);
return true;
}
catch(Json::Exception e)
{
error.Code = -1;
error.String = e.what() + std::string(" : ") + error.String;
error.code = -1;
error.string = e.what() + std::string(" : ") + error.string;
}
return false;
......@@ -450,7 +450,7 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VDS &vds, Error &er
Json::Value
layoutDescriptor = root["layoutDescriptor"];
vds.LayoutDescriptor = VolumeDataLayoutDescriptor(BrickSizeFromJson(layoutDescriptor["brickSize"]),
vds.layoutDescriptor = VolumeDataLayoutDescriptor(BrickSizeFromJson(layoutDescriptor["brickSize"]),
layoutDescriptor["negativeMargin"].asInt(),
layoutDescriptor["positiveMargin"].asInt(),
layoutDescriptor["brickSize2DMultiplier"].asInt(),
......@@ -468,14 +468,14 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VDS &vds, Error &er
axisDescriptor["coordinateMin"].asFloat(),
axisDescriptor["coordinateMax"].asFloat());
vds.AxisDescriptors.push_back(volumeDataAxisDescriptor);
vds.axisDescriptors.push_back(volumeDataAxisDescriptor);
}
for (const Json::Value &channelDescriptor : root["channelDescriptors"])
{
if (channelDescriptor["useNoValue"].asBool())
{
vds.ChannelDescriptors.push_back(VolumeDataChannelDescriptor(
vds.channelDescriptors.push_back(VolumeDataChannelDescriptor(
VoxelFormatFromJson(channelDescriptor["format"]),
VoxelComponentsFromJson(channelDescriptor["components"]),
AddDescriptorString(channelDescriptor["name"].asString(), vds),
......@@ -493,7 +493,7 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VDS &vds, Error &er
}
else
{
vds.ChannelDescriptors.push_back(VolumeDataChannelDescriptor(
vds.channelDescriptors.push_back(VolumeDataChannelDescriptor(
VoxelFormatFromJson(channelDescriptor["format"]),
VoxelComponentsFromJson(channelDescriptor["components"]),
AddDescriptorString(channelDescriptor["name"].asString(), vds),
......@@ -514,59 +514,59 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VDS &vds, Error &er
{
MetadataKey key = { MetadataTypeFromJson(metadata["type"]), metadata["category"].asString(), metadata["name"].asString() };
vds.MetadataContainer.keys.push_back(key);
vds.metadataContainer.keys.push_back(key);
if (metadata["type"].asString() == "Int")
{
vds.MetadataContainer.intData[key] = metadata["value"].asInt();
vds.metadataContainer.intData[key] = metadata["value"].asInt();
}
else if (metadata["type"].asString() == "IntVector2")
{
vds.MetadataContainer.intVector2Data[key] = { metadata["value"][0].asInt(), metadata["value"][1].asInt()};
vds.metadataContainer.intVector2Data[key] = { metadata["value"][0].asInt(), metadata["value"][1].asInt()};
}
else if (metadata["type"].asString() == "IntVector3")
{
vds.MetadataContainer.intVector3Data[key] = { metadata["value"][0].asInt(), metadata["value"][1].asInt(), metadata["value"][2].asInt() };
vds.metadataContainer.intVector3Data[key] = { metadata["value"][0].asInt(), metadata["value"][1].asInt(), metadata["value"][2].asInt() };
}
else if (metadata["type"].asString() == "IntVector4")
{
vds.MetadataContainer.intVector4Data[key] = { metadata["value"][0].asInt(), metadata["value"][1].asInt(), metadata["value"][2].asInt(), metadata["value"][3].asInt() };
vds.metadataContainer.intVector4Data[key] = { metadata["value"][0].asInt(), metadata["value"][1].asInt(), metadata["value"][2].asInt(), metadata["value"][3].asInt() };
}
else if (metadata["type"].asString() == "Float")
{
vds.MetadataContainer.floatData[key] = metadata["value"].asFloat();
vds.metadataContainer.floatData[key] = metadata["value"].asFloat();
}
else if (metadata["type"].asString() == "FloatVector2")
{
vds.MetadataContainer.floatVector2Data[key] = { metadata["value"][0].asFloat(), metadata["value"][1].asFloat() };
vds.metadataContainer.floatVector2Data[key] = { metadata["value"][0].asFloat(), metadata["value"][1].asFloat() };
}
else if (metadata["type"].asString() == "FloatVector3")
{
vds.MetadataContainer.floatVector3Data[key] = { metadata["value"][0].asFloat(), metadata["value"][1].asFloat(), metadata["value"][2].asFloat() };
vds.metadataContainer.floatVector3Data[key] = { metadata["value"][0].asFloat(), metadata["value"][1].asFloat(), metadata["value"][2].asFloat() };
}
else if (metadata["type"].asString() == "FloatVector4")
{
vds.MetadataContainer.floatVector4Data[key] = { metadata["value"][0].asFloat(), metadata["value"][1].asFloat(), metadata["value"][2].asFloat(), metadata["value"][3].asFloat() };
vds.metadataContainer.floatVector4Data[key] = { metadata["value"][0].asFloat(), metadata["value"][1].asFloat(), metadata["value"][2].asFloat(), metadata["value"][3].asFloat() };
}
else if (metadata["type"].asString() == "Double")
{
vds.MetadataContainer.doubleData[key] = metadata["value"].asDouble();
vds.metadataContainer.doubleData[key] = metadata["value"].asDouble();
}
else if (metadata["type"].asString() == "DoubleVector2")
{
vds.MetadataContainer.doubleVector2Data[key] = { metadata["value"][0].asDouble(), metadata["value"][1].asDouble() };
vds.metadataContainer.doubleVector2Data[key] = { metadata["value"][0].asDouble(), metadata["value"][1].asDouble() };
}
else if (metadata["type"].asString() == "DoubleVector3")
{
vds.MetadataContainer.doubleVector3Data[key] = { metadata["value"][0].asDouble(), metadata["value"][1].asDouble(), metadata["value"][2].asDouble() };
vds.metadataContainer.doubleVector3Data[key] = { metadata["value"][0].asDouble(), metadata["value"][1].asDouble(), metadata["value"][2].asDouble() };
}
else if (metadata["type"].asString() == "DoubleVector4")
{
vds.MetadataContainer.doubleVector4Data[key] = { metadata["value"][0].asDouble(), metadata["value"][1].asDouble(), metadata["value"][2].asDouble(), metadata["value"][3].asDouble() };
vds.metadataContainer.doubleVector4Data[key] = { metadata["value"][0].asDouble(), metadata["value"][1].asDouble(), metadata["value"][2].asDouble(), metadata["value"][3].asDouble() };
}
else if (metadata["type"].asString() == "String")
{
vds.MetadataContainer.stringData[key] = metadata["value"].asString();
vds.metadataContainer.stringData[key] = metadata["value"].asString();
}
else if (metadata["type"].asString() == "BLOB")
{
......@@ -574,7 +574,7 @@ bool ParseVolumeDataLayout(const std::vector<uint8_t> &json, VDS &vds, Error &er
int len = (int)strlen(value);
std::vector<uint8_t> &data = vds.MetadataContainer.blobData[key];
std::vector<uint8_t> &data = vds.metadataContainer.blobData[key];
data.clear();
bool success = Base64Decode(value, len, data);
......@@ -681,8 +681,8 @@ static MetadataStatus MetadataStatusFromJSON(Json::Value const &metadataStatusJs
bool ParseLayerStatus(const std::vector<uint8_t> &json, VDS &vds, Error &error)
{
vds.ProduceStatuses.clear();
vds.ProduceStatuses.resize(int(Dimensions_45) + 1, VolumeDataLayer::ProduceStatus_Unavailable);
vds.produceStatuses.clear();
vds.produceStatuses.resize(int(Dimensions_45) + 1, VolumeDataLayer::ProduceStatus_Unavailable);
Json::Value root;
if (!ParseJSONFromBuffer(json, root, error))
......@@ -709,9 +709,9 @@ bool ParseLayerStatus(const std::vector<uint8_t> &json, VDS &vds, Error &error)
int
lod = layerStatus["lod"].asInt();
if (lod == 0 && vds.ProduceStatuses[dimensionsND] == VolumeDataLayer::ProduceStatus_Unavailable)
if (lod == 0 && vds.produceStatuses[dimensionsND] == VolumeDataLayer::ProduceStatus_Unavailable)
{
vds.ProduceStatuses[dimensionsND] = produceStatus;
vds.produceStatuses[dimensionsND] = produceStatus;
}
MetadataStatus
......@@ -740,22 +740,22 @@ bool ParseLayerStatus(const std::vector<uint8_t> &json, VDS &vds, Error &error)
if (hasChunkMetadataPages)
{
std::unique_lock<std::mutex> metadataManagersMutexLock(vds.LayerMetadataContainer.mutex);
auto &managers = vds.LayerMetadataContainer.managers;
std::unique_lock<std::mutex> metadataManagersMutexLock(vds.layerMetadataContainer.mutex);
auto &managers = vds.layerMetadataContainer.managers;
if (managers.find(layerName) == vds.LayerMetadataContainer.managers.end())
if (managers.find(layerName) == vds.layerMetadataContainer.managers.end())
{
int pageLimit = vds.AxisDescriptors.size() <= 3 ? 64 : 1024;
int pageLimit = vds.axisDescriptors.size() <= 3 ? 64 : 1024;
vds.LayerMetadataContainer.managers.insert(std::make_pair(layerName, std::unique_ptr<MetadataManager>(new MetadataManager(vds.IoManager.get(), layerName, metadataStatus, pageLimit))));
vds.layerMetadataContainer.managers.insert(std::make_pair(layerName, std::unique_ptr<MetadataManager>(new MetadataManager(vds.ioManager.get(), layerName, metadataStatus, pageLimit))));
}
}
}
}
catch(Json::Exception e)
{
error.String = e.what();
error.Code = -1;
error.string = e.what();
error.code = -1;
return false;
}
......@@ -1150,20 +1150,20 @@ bool DownloadAndParseVolumeDataLayoutAndLayerStatus(VDS& vds, Error& error)
std::shared_ptr<SyncTransferHandler> syncTransferHandler = std::make_shared<SyncTransferHandler>();
syncTransferHandler->error = &error;
syncTransferHandler->data = &volumedatalayout_json;
auto request = vds.IoManager->Download("VolumeDataLayout", syncTransferHandler);
auto request = vds.ioManager->Download("VolumeDataLayout", syncTransferHandler);
request->WaitForFinish();
if (!request->IsSuccess(error) || volumedatalayout_json.empty())
{
error.String = "S3 Error on downloading VolumeDataLayout object: " + error.String;
error.string = "S3 Error on downloading VolumeDataLayout object: " + error.string;
return false;
}
std::vector<uint8_t> layerstatus_json;
syncTransferHandler->data = &layerstatus_json;
request = vds.IoManager->Download("LayerStatus", syncTransferHandler);
request = vds.ioManager->Download("LayerStatus", syncTransferHandler);
request->WaitForFinish();
if (!request->IsSuccess(error) || layerstatus_json.empty())
{
error.String = "S3 Error on downloading LayerStatus object: " + error.String;
e