Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-33057 Allow attributes for implicit storage planes to be merged #19364

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading