Skip to content

Commit

Permalink
HPCC-32164 Minor improvements to new filename gathering code
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Jun 27, 2024
1 parent 3c70c0d commit d05ab65
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
23 changes: 16 additions & 7 deletions common/workunit/workunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8745,12 +8745,20 @@ static const char *summaryTypeName(SummaryType type)
bool CLocalWorkUnit::getSummary(SummaryType type, SummaryMap &map) const
{
VStringBuffer xpath("Summaries/%s", summaryTypeName(type));
CriticalBlock block(crit);
const char *list = p->queryProp(xpath);
if (!list)
return false;
StringArray s;
s.appendList(list, "\n");
{
CriticalBlock block(crit);
IPropertyTree * match = p->queryPropTree(xpath);
//If there is not entry then the information is not recorded in the workunit
if (!match)
return false;

const char *list = match->queryProp(nullptr);
//If the information was recorded return true, even if ther are no results
if (!list)
return true;
s.appendList(list, "\n");
}
ForEachItemIn(idx, s)
{
const char *name = s.item(idx);
Expand All @@ -8761,10 +8769,11 @@ bool CLocalWorkUnit::getSummary(SummaryType type, SummaryMap &map) const
if (*end!=':')
return false; // unrecognized format
name = end+1;
if (map.find(name) == map.end())
auto match = map.find(name);
if (match == map.end())
map[name] = flags;
else
map[name] = map[name] & flags;
match->second &= flags;
}
}
return true;
Expand Down
30 changes: 17 additions & 13 deletions ecl/hqlcpp/hqlcpp.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -2146,19 +2146,23 @@ protected:
SummaryMap summaries[(int) SummaryType::NumItems];
void noteSummaryInfo(const char *name, SummaryType type, bool isOpt, bool isSigned)
{
if (type != SummaryType::None)
{
SummaryMap &map = summaries[(int) type];
SummaryFlags flags = SummaryFlags::None;
if (isOpt)
flags |= SummaryFlags::IsOpt;
if (isSigned)
flags |= SummaryFlags::IsSigned;
if (map.find(name) == map.end())
map[name] = flags;
else
map[name] = map[name] & flags;
}
if (type == SummaryType::None)
return;
//Spill files are meaningless in roxie, and no current benefit in recording them for hthor/thor
if (type == SummaryType::SpillFile)
return;

SummaryMap &map = summaries[(int) type];
SummaryFlags flags = SummaryFlags::None;
if (isOpt)
flags |= SummaryFlags::IsOpt;
if (isSigned)
flags |= SummaryFlags::IsSigned;
auto match = map.find(name);
if (match == map.end())
map[name] = flags;
else
match->second &= flags;
}
};

Expand Down

0 comments on commit d05ab65

Please sign in to comment.