Skip to content

Commit

Permalink
HPCC-33057 Allow attributes for implicit storage planes to be merged
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Del Vecchio <[email protected]>
  • Loading branch information
jackdelv committed Dec 16, 2024
1 parent 61189d3 commit 33f766d
Showing 1 changed file with 39 additions and 26 deletions.
65 changes: 39 additions & 26 deletions dali/base/dafdesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3572,10 +3572,13 @@ void GroupInformation::createStoragePlane(IPropertyTree * storage, unsigned copy
{
// Check that storage plane does not already have a definition
VStringBuffer xpath("planes[@name='%s']", name.str());
if (storage->hasProp(xpath))
return;
IPropertyTree * plane = storage->queryPropTree(xpath);
if (!plane || (copy != 0))
{
plane = storage->addPropTree("planes");
plane->setPropBool("@fromGroup", true);
}

IPropertyTree * plane = storage->addPropTree("planes");
StringBuffer mirrorname;
const char * planeName = name;
if (copy != 0)
Expand All @@ -3586,37 +3589,47 @@ void GroupInformation::createStoragePlane(IPropertyTree * storage, unsigned copy
//URL style drop zones don't generate a host entry, and will have a single device
if (ordinality() != 0)
{
if (container)
{
const char * containerName = container->name;
if (copy != 0)
containerName = mirrorname.clear().append(containerName).append("_mirror");
//hosts will be expanded by normalizeHostGroups
plane->setProp("@hostGroup", containerName);
}
else
if (!plane->hasProp("@hostGroup"))
{
//Host group has been created that matches the name of the storage plane
plane->setProp("@hostGroup", planeName);
if (container)
{
const char * containerName = container->name;
if (copy != 0)
containerName = mirrorname.clear().append(containerName).append("_mirror");
//hosts will be expanded by normalizeHostGroups
plane->setProp("@hostGroup", containerName);
}
else
{
//Host group has been created that matches the name of the storage plane
plane->setProp("@hostGroup", planeName);
}
}

if (ordinality() > 1)
if (!plane->hasProp("@numDevices"))
{
plane->setPropInt("@numDevices", ordinality());
if (dropZoneIndex == 0)
plane->setPropInt("@defaultSprayParts", ordinality());
if (ordinality() > 1)
{
plane->setPropInt("@numDevices", ordinality());
if (dropZoneIndex == 0)
plane->setPropInt("@defaultSprayParts", ordinality());
}
}
}

if (dir.length())
plane->setProp("@prefix", dir);
else
plane->setProp("@prefix", queryBaseDirectory(groupType, copy));

const char * category = (dropZoneIndex != 0) ? "lz" : "data";
plane->setProp("@category", category);
if (!plane->hasProp("@prefix"))
{
if (dir.length())
plane->setProp("@prefix", dir);
else
plane->setProp("@prefix", queryBaseDirectory(groupType, copy));
}

plane->setPropBool("@fromGroup", true);
if (!plane->hasProp("@category"))
{
const char * category = (dropZoneIndex != 0) ? "lz" : "data";
plane->setProp("@category", category);
}

//MORE: If container is identical to this except for the name we could generate an information tag @alias
}
Expand Down

0 comments on commit 33f766d

Please sign in to comment.