Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Shamser Ahmed <[email protected]>
  • Loading branch information
shamser committed Jan 26, 2024
1 parent 63ccd6c commit 016ec58
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions common/thorhelper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ set ( SRCS

hpccconfig.cpp
hpccconfig.hpp
wfcontext.hpp
)

include_directories (
Expand Down
13 changes: 6 additions & 7 deletions rtl/eclrtl/wfcontext.hpp → common/thorhelper/wfcontext.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef WFCONTEXT_HPP
#define WFCONTEXT_HPP

#include "eclrtl.hpp"
#include "thorhelper.hpp"
#include "eclhelper.hpp"

class ECLRTL_API IndirectCodeContext : implements ICodeContext
class THORHELPER_API IndirectCodeContext : implements ICodeContext
{
public:
IndirectCodeContext(ICodeContext * _ctx = NULL) : ctx(_ctx) {}
Expand Down Expand Up @@ -307,7 +307,8 @@ class ECLRTL_API IndirectCodeContext : implements ICodeContext
protected:
ICodeContext * ctx;
};
class ECLRTL_API GlobalCodeContextExtra : implements IGlobalCodeContext

class THORHELPER_API GlobalCodeContextExtra : implements IGlobalCodeContext
{
private:
// Wraps ICodeContext and overrides getWorkflowId() method
Expand All @@ -316,17 +317,15 @@ class ECLRTL_API GlobalCodeContextExtra : implements IGlobalCodeContext
unsigned wfid;
public:
CodeContextEx(ICodeContext * _ctx, unsigned _wfid) : IndirectCodeContext(_ctx), wfid(_wfid) {}
virtual ~CodeContextEx() {};
virtual unsigned getWorkflowId() const override { return wfid; }
};
} codeContextEx;
IGlobalCodeContext * gctx;
CodeContextEx codeContextEx;
public:
GlobalCodeContextExtra(IGlobalCodeContext * _gctx, unsigned _wfid) : gctx(_gctx), codeContextEx(_gctx->queryCodeContext(), _wfid) {}
virtual ICodeContext * queryCodeContext() override { return &codeContextEx; }
virtual void fail(int, const char *) override { gctx->fail(0, NULL); }
virtual bool isResult(const char * name, unsigned sequence) override { return gctx->isResult(name, sequence); }
virtual unsigned getWorkflowIdDeprecated() override { return gctx->getWorkflowIdDeprecated(); }
virtual unsigned getWorkflowIdDeprecated() { return gctx->getWorkflowIdDeprecated(); };
virtual void doNotify(char const * name, char const * text) override { gctx->doNotify(name, text); }
virtual int queryLastFailCode() override { return gctx->queryLastFailCode(); }
virtual void getLastFailMessage(size32_t & outLen, char * & outStr, const char * tag) override { gctx->getLastFailMessage(outLen, outStr, tag); }
Expand Down
1 change: 1 addition & 0 deletions common/workunit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ if(NOT PLUGIN)
nbcd
eclrtl
deftype
thorhelper
)
if (USE_OPENSSL)
target_link_libraries(workunit securesocket)
Expand Down
2 changes: 1 addition & 1 deletion roxie/ccd/ccdcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext
virtual IEngineContext *queryEngineContext() { return NULL; }
virtual char *getDaliServers() { throwUnexpected(); }
// The following method isn't used. Renaming and leaving here to avoid changing interface
// (Note, this getWorkflowId doesn't implement virtual from any derived classess.)
// (Note, this getWorkflowId isn't the same as the one in IGlobalCodeContext)
virtual unsigned getWorkflowIdDeprecated() { throwUnexpected(); }
// The following from ICodeContext should never be executed in agent activity. If we are on Roxie server, they will be implemented by more derived CRoxieServerContext class
virtual void setResultBool(const char *name, unsigned sequence, bool value) { throwUnexpected(); }
Expand Down
1 change: 0 additions & 1 deletion rtl/eclrtl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ set ( SRCS
rtlsize.hpp
rtltype.hpp
rtlbcdtest.cpp
wfcontext.hpp
)

include_directories (
Expand Down
2 changes: 1 addition & 1 deletion rtl/include/eclhelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,7 @@ struct IRemoteConnection;
struct IGlobalCodeContext
{
virtual ICodeContext * queryCodeContext() = 0;
virtual void fail(int, const char *) = 0;
virtual void fail(int, const char *) = 0;

virtual bool isResult(const char * name, unsigned sequence) = 0;
virtual unsigned getWorkflowIdDeprecated() = 0; // Workflows are not associated with global context. Deprecated. Left here to avoid changing interface.
Expand Down

0 comments on commit 016ec58

Please sign in to comment.