Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chapman <[email protected]>
  • Loading branch information
richardkchapman committed Jan 8, 2025
1 parent d7e928b commit 1a3af3e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
18 changes: 11 additions & 7 deletions roxie/ccd/ccdactivities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2509,15 +2509,19 @@ class CRoxieKeyedActivity : public CRoxieAgentActivity
else
{
IKeyIndexBase *kib = keyArray->queryKeyPart(lastPartNo.partNo);
assertex(kib != NULL);
IKeyIndex *k = kib->queryPart(lastPartNo.fileNo);
if (filechanged)
if (!kib)
tlk.clear();
else
{
tlk.setown(createLocalKeyManager(*keyRecInfo, k, &logctx, hasNewSegmentMonitors(), !logctx.isBlind()));
createSegmentMonitorsPending = true;
IKeyIndex *k = kib->queryPart(lastPartNo.fileNo);
if (filechanged || !tlk)
{
tlk.setown(createLocalKeyManager(*keyRecInfo, k, &logctx, hasNewSegmentMonitors(), !logctx.isBlind()));
createSegmentMonitorsPending = true;
}
else
tlk->setKey(k);
}
else
tlk->setKey(k);
}
}

Expand Down
25 changes: 23 additions & 2 deletions roxie/ccd/ccdserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,11 @@ class CRoxieServerActivity : implements CInterfaceOf<IRoxieServerActivity>, impl
virtual IEngineRowStream *queryConcreteOutputStream(unsigned whichInput) { assertex(whichInput==0); return this; }
virtual IStrandJunction *queryConcreteOutputJunction(unsigned idx) const { assertex(idx==0); return junction; }
virtual IRoxieServerActivity *queryActivity() { return this; }
virtual IIndexReadActivityInfo *queryIndexReadActivity() { return NULL; }
virtual IIndexReadActivityInfo *queryIndexReadActivity()
{
CTXLOG("Activity does not implement queryIndexReadActivity");
return NULL;
}

virtual bool needsAllocator() const { return false; }

Expand Down Expand Up @@ -5527,6 +5531,19 @@ IRoxieServerActivityFactory *createRoxieServerApplyActivityFactory(unsigned _id,

//=================================================================================

static class CDummyIndexReadInfo : public CInterfaceOf<IIndexReadActivityInfo>
{
RemoteActivityId dummyRemoteId{0,0};
public:
virtual IKeyArray *getKeySet() const { return nullptr; }
virtual const IResolvedFile *getVarFileInfo() const { return nullptr; }
virtual ITranslatorSet *getTranslators() const { return nullptr; }

virtual void mergeSegmentMonitors(IIndexReadContext *irc) const { }
virtual IRoxieServerActivity *queryActivity() { return nullptr; };
virtual const RemoteActivityId &queryRemoteId() const { return dummyRemoteId; }
} dummyIndexReadInfo;

class CRoxieServerNullActivity : public CRoxieServerActivity
{
public:
Expand All @@ -5540,6 +5557,10 @@ class CRoxieServerNullActivity : public CRoxieServerActivity
return NULL;
}

virtual IIndexReadActivityInfo *queryIndexReadActivity()
{
return &dummyIndexReadInfo;
}
};

IRoxieServerActivity * createRoxieServerNullActivity(IRoxieAgentContext *_ctx, const IRoxieServerActivityFactory *_factory, IProbeManager *_probeManager)
Expand Down Expand Up @@ -21211,7 +21232,7 @@ class CRoxieServerIfActivity : public CRoxieServerActivity
IFinalRoxieInput *in = cond ? inputTrue : inputFalse;
if (in)
return in->queryIndexReadActivity();
return NULL;
return &dummyIndexReadInfo;
}

virtual void reset()
Expand Down
16 changes: 8 additions & 8 deletions testing/regress/ecl/stresstext_if.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
//nothor
//nohthor

//version multiPart=false
//version multiPart=true
//version multiPart=true,variant='inplace'
//version multiPart=true,variant='default'
//version multiPart=true,variant='inplace',conditionVersion=2
//version multiPart=true,variant='inplace',conditionVersion=3
//version multiPart=true,variant='',conditionVersion=2
//xversion multiPart=false
//xversion multiPart=true
//xversion multiPart=true,variant='inplace'
//xversion multiPart=true,variant='default'
//xversion multiPart=true,variant='inplace',conditionVersion=2
//xversion multiPart=true,variant='inplace',conditionVersion=3
//xversion multiPart=true,variant='',conditionVersion=2

//The following is processed correctly by the code generator, but not yet supported by roxie
//enable the test once the necessary changes are made in the roxie engine.
//noversion multiPart=true,variant='',conditionVersion=4
//version multiPart=true,variant='',conditionVersion=4

// The settings below may be useful when trying to analyse Roxie keyed join behaviour, as they will
// eliminate some wait time for an agent queue to become available
Expand Down

0 comments on commit 1a3af3e

Please sign in to comment.