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-13036 Add support for embed activities #11042
Conversation
https://track.hpccsystems.com/browse/HPCC-13036 |
@jakesmith @richardkchapman please review. |
@ghalliday Why the failures? |
@AttilaVamos It wasn't very obvious from the smoke test results that I forgot to check in the key files. |
@ghalliday It is a bug in Regression Test Engine. I raised a JIRA to fix it. |
@jakesmith @richardkchapman for review |
@@ -790,6 +790,7 @@ const char * cppSystemText[] = { | |||
" boolean newMemorySpillSplitArg(unsigned4 usageCount, const varstring name, boolean meta) : include, pseudoentrypoint='new CLibraryMemorySpillSplitArg';", | |||
" boolean newWorkUnitReadArg(const varstring _name, boolean _meta) : include, pseudoentrypoint='new CLibraryWorkUnitReadArg';", | |||
" boolean newWorkUnitWriteArg(const varstring _name, unsigned4 _flags, boolean _meta) : include, pseudoentrypoint='new CLibraryWorkUnitWriteArg';", | |||
" CThorExternalArg(unsigned4 _numInputs) : include;", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nor do I. Is it for a forward declaration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the declaration of the constructor for the helper class - so it can be called as a fake external function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a comment?
rtl/include/eclhelper.hpp
Outdated
virtual unsigned queryStrand() const = 0; // 0 based 0..numStrands-1 | ||
}; | ||
|
||
//MORE: How does is this extended to support onStart/onCReate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo onCReate
Minor comments - but not sure I would have spotted anything. |
@@ -790,6 +790,7 @@ const char * cppSystemText[] = { | |||
" boolean newMemorySpillSplitArg(unsigned4 usageCount, const varstring name, boolean meta) : include, pseudoentrypoint='new CLibraryMemorySpillSplitArg';", | |||
" boolean newWorkUnitReadArg(const varstring _name, boolean _meta) : include, pseudoentrypoint='new CLibraryWorkUnitReadArg';", | |||
" boolean newWorkUnitWriteArg(const varstring _name, unsigned4 _flags, boolean _meta) : include, pseudoentrypoint='new CLibraryWorkUnitWriteArg';", | |||
" CThorExternalArg(unsigned4 _numInputs) : include;", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nor do I. Is it for a forward declaration?
ecl/hthor/hthor.ipp
Outdated
virtual unsigned numSlaves() const { return 1; } | ||
virtual unsigned numStrands() const { return strands; } | ||
virtual unsigned querySlave() const { return 0; } | ||
virtual unsigned queryStrand() const { return curStrand; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above method could have 'override'
ecl/regress/embedactivity1err.ecl
Outdated
} | ||
RTLIMPLEMENT_IINTERFACE | ||
|
||
virtual const void *nextRow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could have override
ecl/regress/embedactivity1err.ecl
Outdated
memcpy(row+sizeof(__uint64)+sizeof(size32_t), name, lenName); | ||
return rowBuilder.finalizeRowClear(len); | ||
} | ||
virtual void stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could have override
roxie/ccd/ccdserver.cpp
Outdated
virtual unsigned numSlaves() const { return 1; } | ||
virtual unsigned numStrands() const { return strands; } | ||
virtual unsigned querySlave() const { return 0; } | ||
virtual unsigned queryStrand() const { return curStrand; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above could be declared with 'override'
// ExternalSlaveActivity | ||
// | ||
|
||
class NodeActivityContext : public IThorActivityContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should agree and try to be consistent, and I don't mind changing style, but all Thor classes begin with C, so e.g. CNodeActivityContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change.
I think I use CX for a class that is the only concrete implementation of an interface. If there is more than one, then I often don't have a C prefix.
virtual unsigned numSlaves() const { return slaves; } | ||
virtual unsigned numStrands() const { return 1; } | ||
virtual unsigned querySlave() const { return curSlave; } | ||
virtual unsigned queryStrand() const { return 0; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above could be 'override'
virtual void process() override | ||
{ | ||
start(); | ||
processed = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no point in this line
@@ -0,0 +1,34 @@ | |||
/*############################################################################## | |||
|
|||
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018
|
||
|
||
activityslaves_decl CActivityBase *createExternalSlave(CGraphElementBase *container); | ||
activityslaves_decl CActivityBase *createExternalSinkSlave(CGraphElementBase *container); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because no one likes .ipp's and only here to include these factory methods and these are internal to this dll (activityslaves), I tend not to add a activity .ipp for activities and instead these declarations appear near top of slave.cpp (around line 244 onward)
@ghalliday - some minor comments. |
@jakesmith please check revisions. |
bool local; | ||
}; | ||
|
||
class ExternalSlaveActivity : public CSlaveActivity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
picky: you changed NodeActivityContext to CNodeActivityContext, would be good to change this and ExternalSinkSlaveActivity further down.
@ghalliday - 1 picky comment, but otherwise looks good. |
@jakesmith renamed class and squashed. |
@ghalliday - Looks good to merge |
ecl/hql/hqlattr.cpp
Outdated
if (callIsActivity(expr)) | ||
{ | ||
//Can only be deduced by substituting the parameters into the body and seeing if the local attribute has a constant value | ||
//currently assume false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something that needs improving?
@@ -8079,6 +8079,8 @@ class Vs6CppNameMangler | |||
mangled.append("PVIGlobalCodeContext@@"); | |||
else if (body->hasAttribute(userMatchFunctionAtom)) | |||
mangled.append("PVIMatchWalker@@"); | |||
if (functionBodyIsActivity(body)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with the mangling schemes, but is it correct that this one is an if while the others are "else if" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the others seem to be exclusive options - e.g., see generateFunctionPrototype(). I was missing an entry for gcc name mangling.
if (!implementationClassName && constructorArgs) | ||
{ | ||
StringBuffer baseClassName; | ||
baseClassName.append("CThor").append(activityArgName).append("Arg"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this calling the constructor mentioned in comments above? If so not sure how it would work unless activityArgName was "External".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would only work if an entry was added for any other based class that required it.
ecl/hqlcpp/hqlhtcpp.cpp
Outdated
if (value->isConstant()) | ||
instance->isLocal = getBoolValue(value, false); | ||
else | ||
reportError(queryLocation(expr), ECODETEXT(HQLERR_AttributeXMustBeConstant), "LOCAL"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be done in the semantic check phase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved it, although I'm not convinced it is better.
@ghalliday Some questions. And you don't seem to have addressed Jake's comment about an incorrect copyright date. |
@richardkchapman see changes. |
854299f
to
b66afcb
Compare
@ghalliday Do you know why failing? |
@AttilaVamos I think this is smoke test failure. The branch runs fine on my machine. |
Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HqlExprArray actuals; | ||
ForEachChild(i, formals) | ||
{ | ||
if (i < bound.ordinality()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghalliday Would this work as expected in the case where the dataset input was not first? Something like the following:
test(boolean testValue, streamed dataset(r) ds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works as expected - only leading streamed datasets are treated as input activities.
That should be documented - I added a comment on the documentation jira.
Automated Smoketest: ✅ Unit tests result:
Regression test result:
HPCC Stop: OK
|
Signed-off-by: Gavin Halliday gavin.halliday@lexisnexis.com
Type of change:
Checklist:
Testing: