From a72b6ae83d35aeedca3cf77181640a90ed0c1034 Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Mon, 14 Aug 2023 12:14:18 +0100 Subject: [PATCH] HPCC-29817 Make IContextLogger pure virtual base class & rename associated derived classes Signed-off-by: Shamser Ahmed --- common/thorhelper/roxiehelper.cpp | 2 +- common/thorhelper/roxiehelper.ipp | 4 +-- roxie/ccd/ccd.hpp | 4 +-- roxie/ccd/ccdactivities.cpp | 2 +- roxie/ccd/ccdactivities.hpp | 2 +- roxie/ccd/ccdcontext.cpp | 34 ++++++++++---------- roxie/ccd/ccdcontext.hpp | 8 ++--- roxie/ccd/ccddebug.cpp | 2 +- roxie/ccd/ccddebug.hpp | 4 +-- roxie/ccd/ccdfile.cpp | 4 +-- roxie/ccd/ccdkey.cpp | 4 +-- roxie/ccd/ccdkey.hpp | 2 +- roxie/ccd/ccdlistener.cpp | 16 +++++----- roxie/ccd/ccdprotocol.cpp | 2 +- roxie/ccd/ccdquery.cpp | 18 +++++------ roxie/ccd/ccdquery.hpp | 20 ++++++------ roxie/ccd/ccdqueue.cpp | 28 ++++++++--------- roxie/ccd/ccdqueue.ipp | 2 +- roxie/ccd/ccdserver.cpp | 52 +++++++++++++++---------------- roxie/ccd/ccdserver.hpp | 8 ++--- roxie/ccd/ccdstate.cpp | 40 ++++++++++++------------ roxie/ccd/ccdstate.hpp | 18 +++++------ roxie/udplib/udplib.hpp | 12 +++---- system/jlib/jlog.cpp | 17 +++++----- system/jlib/jlog.hpp | 34 +++++++++++++++++--- 25 files changed, 180 insertions(+), 159 deletions(-) diff --git a/common/thorhelper/roxiehelper.cpp b/common/thorhelper/roxiehelper.cpp index 86a02a3fdf0..18f0058c66f 100644 --- a/common/thorhelper/roxiehelper.cpp +++ b/common/thorhelper/roxiehelper.cpp @@ -2821,7 +2821,7 @@ StringBuffer & expandLogicalFilename(StringBuffer & logicalName, const char * fn //---------------------------------------------------------------------------------- -void IRoxieContextLogger::CTXLOGae(IException *E, const char *file, unsigned line, const char *prefix, const char *format, ...) const +void CBaseRoxieContextLogger::CTXLOGae(IException *E, const char *file, unsigned line, const char *prefix, const char *format, ...) const { va_list args; va_start(args, format); diff --git a/common/thorhelper/roxiehelper.ipp b/common/thorhelper/roxiehelper.ipp index a801a1b3fd7..12e6acd6683 100644 --- a/common/thorhelper/roxiehelper.ipp +++ b/common/thorhelper/roxiehelper.ipp @@ -57,9 +57,9 @@ enum TracingCategory }; class LogItem; -interface IRoxieContextLogger : extends IContextLogger +interface CBaseRoxieContextLogger : extends CDefaultContextLogger { - IRoxieContextLogger(IPropertyTree *cfg) : IContextLogger(cfg) {} + CBaseRoxieContextLogger(IPropertyTree *cfg) : CDefaultContextLogger(cfg) {} // Override base interface with versions that add prefix // We could consider moving some or all of these down into IContextLogger virtual void CTXLOGva(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char *format, va_list args) const override __attribute__((format(printf,5,0))) diff --git a/roxie/ccd/ccd.hpp b/roxie/ccd/ccd.hpp index ff13c14f4cb..b2a76735dc7 100644 --- a/roxie/ccd/ccd.hpp +++ b/roxie/ccd/ccd.hpp @@ -572,7 +572,7 @@ extern void putStatsValue(StringBuffer &reply, const char *statName, const char extern const StatisticsMapping accumulatedStatistics; -class ContextLogger : implements IRoxieContextLogger, public CInterface +class ContextLogger : implements CBaseRoxieContextLogger { protected: mutable CriticalSection crit; @@ -591,7 +591,7 @@ class ContextLogger : implements IRoxieContextLogger, public CInterface public: IMPLEMENT_IINTERFACE; - ContextLogger() : IRoxieContextLogger(topology), stats(accumulatedStatistics, true) + ContextLogger() : CBaseRoxieContextLogger(topology), stats(accumulatedStatistics, true) { ctxTraceLevel = traceLevel; intercept = false; diff --git a/roxie/ccd/ccdactivities.cpp b/roxie/ccd/ccdactivities.cpp index 8cef4b7f969..7f54efb907b 100644 --- a/roxie/ccd/ccdactivities.cpp +++ b/roxie/ccd/ccdactivities.cpp @@ -221,7 +221,7 @@ class CAgentActivityFactory : public CActivityFactory, implements IAgentActivity { return queryFactory.createAgentContext(logctx, packet, childQueries.length()!=0); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { if (datafile) addXrefFileInfo(reply, datafile); diff --git a/roxie/ccd/ccdactivities.hpp b/roxie/ccd/ccdactivities.hpp index 4d929b735b7..4d40b1c832d 100644 --- a/roxie/ccd/ccdactivities.hpp +++ b/roxie/ccd/ccdactivities.hpp @@ -44,7 +44,7 @@ interface IActivityFactory : extends IInterface virtual ThorActivityKind getKind() const = 0; virtual void getActivityMetrics(StringBuffer &reply) const = 0; virtual void gatherStats(IStatisticGatherer &builder, int channel, bool reset) const = 0; - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const = 0; + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const = 0; virtual void mergeStats(const CRuntimeStatisticCollection &from) const = 0; }; diff --git a/roxie/ccd/ccdcontext.cpp b/roxie/ccd/ccdcontext.cpp index 12cbdd66e77..35344741d9f 100644 --- a/roxie/ccd/ccdcontext.cpp +++ b/roxie/ccd/ccdcontext.cpp @@ -73,10 +73,10 @@ class CAgentDebugContext : public CBaseDebugContext unsigned channel; int debugSequence; CriticalSection crit; - const IRoxieContextLogger &logctx; // hides base class definition with more derived class pointer + const CBaseRoxieContextLogger &logctx; // hides base class definition with more derived class pointer public: - CAgentDebugContext(IRoxieAgentContext *_ctx, const IRoxieContextLogger &_logctx, RoxiePacketHeader &_header) + CAgentDebugContext(IRoxieAgentContext *_ctx, const CBaseRoxieContextLogger &_logctx, RoxiePacketHeader &_header) : CBaseDebugContext(_logctx), header(_header), logctx(_logctx) { channel = header.channel; @@ -202,7 +202,7 @@ class CAgentDebugContext : public CBaseDebugContext class CRoxieWorkflowMachine : public WorkflowMachine { public: - CRoxieWorkflowMachine(IPropertyTree *_workflowInfo, IConstWorkUnit *_wu, bool _doOnce, bool _parallelWorkflow, unsigned _numWorkflowThreads, const IRoxieContextLogger &_logctx) + CRoxieWorkflowMachine(IPropertyTree *_workflowInfo, IConstWorkUnit *_wu, bool _doOnce, bool _parallelWorkflow, unsigned _numWorkflowThreads, const CBaseRoxieContextLogger &_logctx) : WorkflowMachine(_logctx) { workunit = _wu; @@ -800,7 +800,7 @@ class CRoxieWorkflowMachine : public WorkflowMachine unsigned numWorkflowThreads; }; -CRoxieWorkflowMachine *createRoxieWorkflowMachine(IPropertyTree *_workflowInfo, IConstWorkUnit *_wu, bool _doOnce, bool _parallelWorkflow, unsigned _numWorkflowThreads, const IRoxieContextLogger &_logctx) +CRoxieWorkflowMachine *createRoxieWorkflowMachine(IPropertyTree *_workflowInfo, IConstWorkUnit *_wu, bool _doOnce, bool _parallelWorkflow, unsigned _numWorkflowThreads, const CBaseRoxieContextLogger &_logctx) { return new CRoxieWorkflowMachine(_workflowInfo, _wu, _doOnce, _parallelWorkflow, _numWorkflowThreads, _logctx); } @@ -948,7 +948,7 @@ class WorkUnitRowReaderBase : implements IWorkUnitRowReader, public CInterface class RawDataReader : public WorkUnitRowReaderBase { protected: - const IRoxieContextLogger &logctx; + const CBaseRoxieContextLogger &logctx; byte *bufferBase; MemoryBuffer blockBuffer; Owned bufferStream; @@ -972,7 +972,7 @@ class RawDataReader : public WorkUnitRowReaderBase } public: - RawDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const IRoxieContextLogger &_logctx) + RawDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const CBaseRoxieContextLogger &_logctx) : WorkUnitRowReaderBase(_rowAllocator, _isGrouped), logctx(_logctx) { eof = false; @@ -1019,7 +1019,7 @@ class InlineRawDataReader : public RawDataReader { Linked xml; public: - InlineRawDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const IRoxieContextLogger &_logctx, IPropertyTree *_xml) + InlineRawDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const CBaseRoxieContextLogger &_logctx, IPropertyTree *_xml) : RawDataReader(codeContext, _rowAllocator, _isGrouped, _logctx), xml(_xml) { } @@ -1050,7 +1050,7 @@ class StreamedRawDataReader : public RawDataReader StringAttr id; offset_t offset; public: - StreamedRawDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const IRoxieContextLogger &_logctx, SafeSocket &_client, const char *_id) + StreamedRawDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const CBaseRoxieContextLogger &_logctx, SafeSocket &_client, const char *_id) : RawDataReader(codeContext, _rowAllocator, _isGrouped, _logctx), client(_client), id(_id) { offset = 0; @@ -1120,7 +1120,7 @@ class WuResultDataReader : public RawDataReader Owned result; IXmlToRowTransformer *rowTransformer; public: - WuResultDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const IRoxieContextLogger &_logctx, IConstWUResult *_result, IXmlToRowTransformer *_rowTransformer) + WuResultDataReader(ICodeContext *codeContext, IEngineRowAllocator *_rowAllocator, bool _isGrouped, const CBaseRoxieContextLogger &_logctx, IConstWUResult *_result, IXmlToRowTransformer *_rowTransformer) : RawDataReader(codeContext, _rowAllocator, _isGrouped, _logctx), result(_result), rowTransformer(_rowTransformer) { } @@ -1179,7 +1179,7 @@ class InlineXmlDataReader : public WorkUnitRowReaderBase //--------------------------------------------------------------------------------------- static const StatisticsMapping graphStatistics({}); -class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext, implements roxiemem::ITimeLimiter, implements IRowAllocatorMetaActIdCacheCallback, public CInterface +class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext, implements roxiemem::ITimeLimiter, implements IRowAllocatorMetaActIdCacheCallback { protected: Owned graphStats; // This needs to be destroyed very late (particularly, after the childgraphs) @@ -1205,7 +1205,7 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext Owned superfileTransaction; IArrayOf loadedLibraries; - const IRoxieContextLogger &logctx; + const CBaseRoxieContextLogger &logctx; protected: @@ -1264,7 +1264,7 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext public: IMPLEMENT_IINTERFACE; - CRoxieContextBase(const IQueryFactory *_factory, const IRoxieContextLogger &_logctx) + CRoxieContextBase(const IQueryFactory *_factory, const CBaseRoxieContextLogger &_logctx) : IRoxieAgentContext(topology), factory(_factory), options(factory->queryOptions()), logctx(_logctx), globalStats(graphStatistics) { startTime = lastWuAbortCheck = msTick(); @@ -1388,11 +1388,11 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext } virtual void setGlobalId(const char *id, SocketEndpoint &ep, unsigned pid) override { - const_cast(logctx).setGlobalId(id, ep, pid); + const_cast(logctx).setGlobalId(id, ep, pid); } virtual void setCallerId(const char *id) override { - const_cast(logctx).setCallerId(id); + const_cast(logctx).setCallerId(id); } virtual const char *queryGlobalId() const override { @@ -1408,7 +1408,7 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext } virtual void setHttpIdHeaderNames(const char *global, const char *caller) override { - const_cast(logctx).setHttpIdHeaderNames(global, caller); + const_cast(logctx).setHttpIdHeaderNames(global, caller); } virtual const char *queryGlobalIdHttpHeaderName() const override { @@ -2703,7 +2703,7 @@ class CRoxieServerContext : public CRoxieContextBase, implements IRoxieServerCon public: IMPLEMENT_IINTERFACE; - CRoxieServerContext(const IQueryFactory *_factory, const IRoxieContextLogger &_logctx) + CRoxieServerContext(const IQueryFactory *_factory, const CBaseRoxieContextLogger &_logctx) : CRoxieContextBase(_factory, _logctx), serverQueryFactory(_factory), results(NULL) { init(); @@ -4044,7 +4044,7 @@ IRoxieServerContext *createRoxieServerContext(IPropertyTree *context, IHpccProto return new CSoapRoxieServerContext(context, protocol, factory, flags, _logctx, readFlags, querySetName); } -IRoxieServerContext *createOnceServerContext(const IQueryFactory *factory, const IRoxieContextLogger &_logctx) +IRoxieServerContext *createOnceServerContext(const IQueryFactory *factory, const CBaseRoxieContextLogger &_logctx) { return new CRoxieServerContext(factory, _logctx); } diff --git a/roxie/ccd/ccdcontext.hpp b/roxie/ccd/ccdcontext.hpp index 8365dbbf7a0..6c5e1f640b3 100644 --- a/roxie/ccd/ccdcontext.hpp +++ b/roxie/ccd/ccdcontext.hpp @@ -43,9 +43,9 @@ interface IWorkUnitRowReader : public IInterface interface IRoxieServerContext; -interface IRoxieAgentContext : extends IRoxieContextLogger +interface IRoxieAgentContext : extends CBaseRoxieContextLogger { - IRoxieAgentContext(IPropertyTree *cfg) : IRoxieContextLogger(cfg) {} + IRoxieAgentContext(IPropertyTree *cfg) : CBaseRoxieContextLogger(cfg) {} virtual ICodeContext *queryCodeContext() = 0; virtual void checkAbort() = 0; virtual void notifyAbort(IException *E) = 0; @@ -117,8 +117,8 @@ class CRoxieWorkflowMachine; extern IDeserializedResultStore *createDeserializedResultStore(); extern IRoxieAgentContext *createAgentContext(const IQueryFactory *factory, const AgentContextLogger &logctx, IRoxieQueryPacket *packet, bool hasRemoteChildren); extern IRoxieServerContext *createRoxieServerContext(IPropertyTree *context, IHpccProtocolResponse *protocol, const IQueryFactory *factory, unsigned flags, const ContextLogger &logctx, PTreeReaderOptions xmlReadFlags, const char *querySetName); -extern IRoxieServerContext *createOnceServerContext(const IQueryFactory *factory, const IRoxieContextLogger &_logctx); +extern IRoxieServerContext *createOnceServerContext(const IQueryFactory *factory, const CBaseRoxieContextLogger &_logctx); extern IRoxieServerContext *createWorkUnitServerContext(IConstWorkUnit *wu, const IQueryFactory *factory, const ContextLogger &logctx); -extern CRoxieWorkflowMachine *createRoxieWorkflowMachine(IPropertyTree *_workflowInfo, IConstWorkUnit *wu, bool doOnce, bool _parallelWorkflow, unsigned _numWorkflowThreads, const IRoxieContextLogger &_logctx); +extern CRoxieWorkflowMachine *createRoxieWorkflowMachine(IPropertyTree *_workflowInfo, IConstWorkUnit *wu, bool doOnce, bool _parallelWorkflow, unsigned _numWorkflowThreads, const CBaseRoxieContextLogger &_logctx); #endif diff --git a/roxie/ccd/ccddebug.cpp b/roxie/ccd/ccddebug.cpp index 2ff7b317c0e..a51c1c47776 100644 --- a/roxie/ccd/ccddebug.cpp +++ b/roxie/ccd/ccddebug.cpp @@ -1138,7 +1138,7 @@ class DebugRequestGetResetGlobalCounts : public DebugRequestBase } }; -extern void doDebugRequest(IRoxieQueryPacket *packet, const IRoxieContextLogger &logctx) +extern void doDebugRequest(IRoxieQueryPacket *packet, const CBaseRoxieContextLogger &logctx) { RoxiePacketHeader newHeader(packet->queryHeader(), ROXIE_DEBUGREQUEST, 0); // subchannel not relevant Owned output = ROQ->createOutputStream(newHeader, true, logctx); diff --git a/roxie/ccd/ccddebug.hpp b/roxie/ccd/ccddebug.hpp index a7e3f245993..b961ed4d4ff 100644 --- a/roxie/ccd/ccddebug.hpp +++ b/roxie/ccd/ccddebug.hpp @@ -21,11 +21,11 @@ #include interface IRoxieQueryPacket; -interface IRoxieContextLogger; +interface CBaseRoxieContextLogger; interface IProbeManager; interface IDebuggableContext; -extern void doDebugRequest(IRoxieQueryPacket *packet, const IRoxieContextLogger &logctx); +extern void doDebugRequest(IRoxieQueryPacket *packet, const CBaseRoxieContextLogger &logctx); extern IProbeManager *createDebugManager(IDebuggableContext *debugContext, const char *graphName); #endif diff --git a/roxie/ccd/ccdfile.cpp b/roxie/ccd/ccdfile.cpp index d7762aafc86..dac3dc50088 100644 --- a/roxie/ccd/ccdfile.cpp +++ b/roxie/ccd/ccdfile.cpp @@ -3355,7 +3355,7 @@ class CAgentDynamicFile : public CResolvedFile ServerIdentifier serverId; public: - CAgentDynamicFile(const IRoxieContextLogger &logctx, const char *_lfn, RoxiePacketHeader *header, bool _isOpt, bool _isLocal) + CAgentDynamicFile(const CBaseRoxieContextLogger &logctx, const char *_lfn, RoxiePacketHeader *header, bool _isOpt, bool _isLocal) : CResolvedFile(_lfn, NULL, NULL, ROXIE_FILE, NULL, true, false, AccessMode::readRandom, false), isOpt(_isOpt), isLocal(_isLocal), channel(header->channel), serverId(header->serverId) { // call back to the server to get the info @@ -3490,7 +3490,7 @@ class CAgentDynamicFileCache : implements IAgentDynamicFileCache, public CInterf IMPLEMENT_IINTERFACE; CAgentDynamicFileCache(unsigned _limit) : tableSize(_limit) {} - virtual IResolvedFile *lookupDynamicFile(const IRoxieContextLogger &logctx, const char *lfn, CDateTime &cacheDate, unsigned checksum, RoxiePacketHeader *header, bool isOpt, bool isLocal) override + virtual IResolvedFile *lookupDynamicFile(const CBaseRoxieContextLogger &logctx, const char *lfn, CDateTime &cacheDate, unsigned checksum, RoxiePacketHeader *header, bool isOpt, bool isLocal) override { if (doTrace(traceRoxieFiles)) { diff --git a/roxie/ccd/ccdkey.cpp b/roxie/ccd/ccdkey.cpp index c24ad3e2b49..6737fd9ae74 100644 --- a/roxie/ccd/ccdkey.cpp +++ b/roxie/ccd/ccdkey.cpp @@ -921,7 +921,7 @@ class InMemoryIndexManager : implements IInMemoryIndexManager, public CInterface } virtual IDirectReader *selectKey(MemoryBuffer &sig, ScoredRowFilter &postFilters, const ITranslatorSet *translators) const override; - virtual IDirectReader *selectKey(ScoredRowFilter &filter, const ITranslatorSet *translators, IRoxieContextLogger &logctx) const override; + virtual IDirectReader *selectKey(ScoredRowFilter &filter, const ITranslatorSet *translators, CBaseRoxieContextLogger &logctx) const override; InMemoryIndex &findIndex(const char *indexSig) const { @@ -1253,7 +1253,7 @@ IDirectReader *InMemoryIndexManager::selectKey(MemoryBuffer &serializedInfo, Sco return new InMemoryIndexCursor(this, &thisIndex, baseMap, postFilters, recInfo, translators, &serializedInfo); } -IDirectReader *InMemoryIndexManager::selectKey(ScoredRowFilter &filter, const ITranslatorSet *translators, IRoxieContextLogger &logctx) const +IDirectReader *InMemoryIndexManager::selectKey(ScoredRowFilter &filter, const ITranslatorSet *translators, CBaseRoxieContextLogger &logctx) const { if (!inMemoryKeysEnabled) return nullptr; diff --git a/roxie/ccd/ccdkey.hpp b/roxie/ccd/ccdkey.hpp index d83bdcbbca6..cc4299094c1 100644 --- a/roxie/ccd/ccdkey.hpp +++ b/roxie/ccd/ccdkey.hpp @@ -65,7 +65,7 @@ interface IInMemoryIndexManager : extends IInterface { virtual void load(IFileIOArray *, IOutputMetaData *preloadLayout, bool preload) = 0; virtual bool IsShared() const = 0; - virtual IDirectReader *selectKey(ScoredRowFilter &filter, const ITranslatorSet *translators, IRoxieContextLogger &logctx) const = 0; + virtual IDirectReader *selectKey(ScoredRowFilter &filter, const ITranslatorSet *translators, CBaseRoxieContextLogger &logctx) const = 0; virtual IDirectReader *selectKey(MemoryBuffer &sig, ScoredRowFilter &filter, const ITranslatorSet *translators) const = 0; virtual IDirectReader *createReader(const RowFilter &postFilter, bool _grouped, offset_t readPos, unsigned partNo, unsigned numParts, const ITranslatorSet *translators) const = 0; virtual void setKeyInfo(IPropertyTree &indexInfo) = 0; diff --git a/roxie/ccd/ccdlistener.cpp b/roxie/ccd/ccdlistener.cpp index 27b10f94cd6..2f36c68104b 100644 --- a/roxie/ccd/ccdlistener.cpp +++ b/roxie/ccd/ccdlistener.cpp @@ -38,7 +38,7 @@ //====================================================================================================================== -static void controlException(StringBuffer &response, IException *E, const IRoxieContextLogger &logctx) +static void controlException(StringBuffer &response, IException *E, const CBaseRoxieContextLogger &logctx) { try { @@ -78,7 +78,7 @@ class CascadeManager : public CInterface bool isOriginal; CriticalSection revisionCrit; int myEndpoint; - const IRoxieContextLogger &logctx; + const CBaseRoxieContextLogger &logctx; IPropertyTree *tlsConfig = nullptr; void unlockChildren() @@ -309,7 +309,7 @@ class CascadeManager : public CInterface public: - CascadeManager(const IRoxieContextLogger &_logctx, const ITopologyServer *_topology) : topology(_topology), servers(_topology->queryServers(roxiePort)), logctx(_logctx), tlsConfig(roxiePortTlsClientConfig) + CascadeManager(const CBaseRoxieContextLogger &_logctx, const ITopologyServer *_topology) : topology(_topology), servers(_topology->queryServers(roxiePort)), logctx(_logctx), tlsConfig(roxiePortTlsClientConfig) { entered = false; connected = false; @@ -446,12 +446,12 @@ class CascadeManager : public CInterface CriticalSection crit; SocketEndpoint &ep; unsigned numChildren; - const IRoxieContextLogger &logctx; + const CBaseRoxieContextLogger &logctx; IPropertyTree *xml; public: casyncfor(IPropertyTree *_xml, const char *_queryText, CascadeManager *_parent, IPropertyTree *_mergedReply, CascadeMergeType _mergeType, - StringBuffer &_reply, SocketEndpoint &_ep, unsigned _numChildren, const IRoxieContextLogger &_logctx) + StringBuffer &_reply, SocketEndpoint &_ep, unsigned _numChildren, const CBaseRoxieContextLogger &_logctx) : queryText(_queryText), parent(_parent), mergedReply(_mergedReply), mergeType(_mergeType), reply(_reply), ep(_ep), numChildren(_numChildren), logctx(_logctx), xml(_xml) { } @@ -777,7 +777,7 @@ class RoxieListener : public Thread, implements IHpccProtocolListener, implement return pool->joinAll(false); } - void reportBadQuery(const char *name, const IRoxieContextLogger &logctx) + void reportBadQuery(const char *name, const CBaseRoxieContextLogger &logctx) { // MORE - may want to put in a mechanism to avoid swamping SNMP with bad query reports if someone kicks off a thor job with a typo.... logctx.logOperatorException(NULL, NULL, 0, "Unknown query %s", name); @@ -1329,13 +1329,13 @@ class RoxieWorkUnitWorker : public RoxieQueryWorker private: #ifndef _DEBUG - void reportUnknownException(IConstWorkUnit *wu, const IRoxieContextLogger &logctx) + void reportUnknownException(IConstWorkUnit *wu, const CBaseRoxieContextLogger &logctx) { Owned E = MakeStringException(ROXIE_INTERNAL_ERROR, "Unknown exception"); reportException(wu, E, logctx); } #endif - void reportException(IConstWorkUnit *wu, IException *E, const IRoxieContextLogger &logctx) + void reportException(IConstWorkUnit *wu, IException *E, const CBaseRoxieContextLogger &logctx) { logctx.CTXLOG("FAILED: %s", wuid.get()); StringBuffer error; diff --git a/roxie/ccd/ccdprotocol.cpp b/roxie/ccd/ccdprotocol.cpp index f0586bbf3eb..4804056f5de 100644 --- a/roxie/ccd/ccdprotocol.cpp +++ b/roxie/ccd/ccdprotocol.cpp @@ -1777,7 +1777,7 @@ class RoxieSocketWorker : public ProtocolQueryWorker } PerfTracer perf; - IRoxieContextLogger &logctx = static_cast(*msgctx->queryLogContext()); + CBaseRoxieContextLogger &logctx = static_cast(*msgctx->queryLogContext()); bool isHTTP = httpHelper.isHttp(); if (isHTTP) { diff --git a/roxie/ccd/ccdquery.cpp b/roxie/ccd/ccdquery.cpp index 70e039febfd..3afc13f6c75 100644 --- a/roxie/ccd/ccdquery.cpp +++ b/roxie/ccd/ccdquery.cpp @@ -259,14 +259,14 @@ class CSharedOnceContext : public CInterfaceOf return *onceResultStore; } - virtual IPropertyTree &queryOnceContext(const IQueryFactory *factory, const IRoxieContextLogger &logctx) const + virtual IPropertyTree &queryOnceContext(const IQueryFactory *factory, const CBaseRoxieContextLogger &logctx) const { checkOnceDone(factory, logctx); assertex(onceContext != NULL); return *onceContext; } - virtual void checkOnceDone(const IQueryFactory *factory, const IRoxieContextLogger &logctx) const + virtual void checkOnceDone(const IQueryFactory *factory, const CBaseRoxieContextLogger &logctx) const { if (calculatingOnce) // NOTE - this must be outside the critsec or you deadlock. It is still effectively protected by the critsec return; @@ -1228,7 +1228,7 @@ class CQueryFactory : implements IQueryFactory, implements IResourceContext, pub }; } - virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const IRoxieContextLogger &logctx) const override + virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const CBaseRoxieContextLogger &logctx) const override { return globalPackageSetManager->lookupLibrary(libraryName, expectedInterfaceHash, logctx); } @@ -1452,7 +1452,7 @@ static hash64_t getQueryHash(const char *id, const IQueryDll *dll, const IRoxieP return sharedOnceContext->queryOnceResultStore(); } - virtual IPropertyTree &queryOnceContext(const IRoxieContextLogger &logctx) const override + virtual IPropertyTree &queryOnceContext(const CBaseRoxieContextLogger &logctx) const override { assertex(sharedOnceContext); return sharedOnceContext->queryOnceContext(this, logctx); @@ -1468,7 +1468,7 @@ static hash64_t getQueryHash(const char *id, const IQueryDll *dll, const IRoxieP return *graphMap.getValue(name); } - virtual IActivityGraph *lookupGraph(IRoxieAgentContext *ctx, const char *name, IProbeManager *probeManager, const IRoxieContextLogger &logctx, IRoxieServerActivity *parentActivity) const override + virtual IActivityGraph *lookupGraph(IRoxieAgentContext *ctx, const char *name, IProbeManager *probeManager, const CBaseRoxieContextLogger &logctx, IRoxieServerActivity *parentActivity) const override { assertex(name && *name); ActivityArrayPtr *graph = graphMap.getValue(name); @@ -1558,11 +1558,11 @@ static hash64_t getQueryHash(const char *id, const IQueryDll *dll, const IRoxieP { stats.merge(from); } - virtual void mergeStats(const IRoxieContextLogger &from) const override + virtual void mergeStats(const CBaseRoxieContextLogger &from) const override { from.gatherStats(stats); } - virtual void getQueryInfo(StringBuffer &reply, bool full, IArrayOf *agentQueries, const IRoxieContextLogger &logctx) const override + virtual void getQueryInfo(StringBuffer &reply, bool full, IArrayOf *agentQueries, const CBaseRoxieContextLogger &logctx) const override { Owned xref = createPTree("Query", ipt_fast); xref->setProp("@id", id); @@ -1652,7 +1652,7 @@ static hash64_t getQueryHash(const char *id, const IQueryDll *dll, const IRoxieP { return package; } - virtual CRoxieWorkflowMachine *createWorkflowMachine(IConstWorkUnit *wu, bool isOnce, const IRoxieContextLogger &logctx, const QueryOptions & options) const override + virtual CRoxieWorkflowMachine *createWorkflowMachine(IConstWorkUnit *wu, bool isOnce, const CBaseRoxieContextLogger &logctx, const QueryOptions & options) const override { throwUnexpected(); // only on server... } @@ -1838,7 +1838,7 @@ class CRoxieServerQueryFactory : public CQueryFactory return createWorkUnitServerContext(wu, this, _logctx); } - virtual CRoxieWorkflowMachine *createWorkflowMachine(IConstWorkUnit *wu, bool isOnce, const IRoxieContextLogger &logctx, const QueryOptions & options) const + virtual CRoxieWorkflowMachine *createWorkflowMachine(IConstWorkUnit *wu, bool isOnce, const CBaseRoxieContextLogger &logctx, const QueryOptions & options) const { IPropertyTree *workflow = queryWorkflowTree(); if (workflow) diff --git a/roxie/ccd/ccdquery.hpp b/roxie/ccd/ccdquery.hpp index f4f45d12fd4..1986efdd1e4 100644 --- a/roxie/ccd/ccdquery.hpp +++ b/roxie/ccd/ccdquery.hpp @@ -47,7 +47,7 @@ interface IActivityGraph : extends IInterface virtual IThorChildGraph * queryChildGraph() = 0; virtual IEclGraphResults * queryLocalGraph() = 0; virtual IRoxieServerChildGraph * queryLoopGraph() = 0; - virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const IRoxieContextLogger &logctx) = 0; + virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const CBaseRoxieContextLogger &logctx) = 0; virtual const char *queryName() const = 0; virtual void gatherStatistics(IStatisticGatherer * statsBuilder) const = 0; virtual void setPrefix(const char *prefix) = 0; @@ -60,9 +60,9 @@ class CRoxieWorkflowMachine; interface ISharedOnceContext : extends IInterface { - virtual IPropertyTree &queryOnceContext(const IQueryFactory *queryFactory, const IRoxieContextLogger &_logctx) const = 0; + virtual IPropertyTree &queryOnceContext(const IQueryFactory *queryFactory, const CBaseRoxieContextLogger &_logctx) const = 0; virtual IDeserializedResultStore &queryOnceResultStore() const = 0; - virtual void checkOnceDone(const IQueryFactory *queryFactory, const IRoxieContextLogger &_logctx) const = 0; + virtual void checkOnceDone(const IQueryFactory *queryFactory, const CBaseRoxieContextLogger &_logctx) const = 0; }; //---------------------------------------------------------------------------------------------- @@ -134,7 +134,7 @@ class QueryOptions interface IQueryFactory : extends IInterface { virtual IRoxieAgentContext *createAgentContext(const AgentContextLogger &logctx, IRoxieQueryPacket *packet, bool hasChildren) const = 0; - virtual IActivityGraph *lookupGraph(IRoxieAgentContext *ctx, const char *name, IProbeManager *probeManager, const IRoxieContextLogger &logctx, IRoxieServerActivity *parentActivity) const = 0; + virtual IActivityGraph *lookupGraph(IRoxieAgentContext *ctx, const char *name, IProbeManager *probeManager, const CBaseRoxieContextLogger &logctx, IRoxieServerActivity *parentActivity) const = 0; virtual IAgentActivityFactory *getAgentActivityFactory(unsigned id) const = 0; virtual IRoxieServerActivityFactory *getRoxieServerActivityFactory(unsigned id) const = 0; virtual hash64_t queryHash() const = 0; @@ -153,16 +153,16 @@ interface IQueryFactory : extends IInterface virtual IConstWorkUnit *queryWorkUnit() const = 0; virtual ISharedOnceContext *querySharedOnceContext() const = 0; virtual IDeserializedResultStore &queryOnceResultStore() const = 0; - virtual IPropertyTree &queryOnceContext(const IRoxieContextLogger &logctx) const = 0; + virtual IPropertyTree &queryOnceContext(const CBaseRoxieContextLogger &logctx) const = 0; virtual const IRoxiePackage &queryPackage() const = 0; virtual void getActivityMetrics(StringBuffer &reply) const = 0; virtual void gatherStats(IConstWorkUnit* statsWu, const char *graphName, int channel, bool reset) const = 0; virtual void mergeStats(const CRuntimeStatisticCollection &from) const = 0; - virtual void mergeStats(const IRoxieContextLogger &from) const = 0; + virtual void mergeStats(const CBaseRoxieContextLogger &from) const = 0; virtual IPropertyTree *cloneQueryXGMML() const = 0; - virtual CRoxieWorkflowMachine *createWorkflowMachine(IConstWorkUnit *wu, bool isOnce, const IRoxieContextLogger &logctx, const QueryOptions & options) const = 0; + virtual CRoxieWorkflowMachine *createWorkflowMachine(IConstWorkUnit *wu, bool isOnce, const CBaseRoxieContextLogger &logctx, const QueryOptions & options) const = 0; virtual char *getEnv(const char *name, const char *defaultValue) const = 0; virtual IRoxieServerContext *createContext(IPropertyTree *xml, IHpccProtocolResponse *protocol, unsigned flags, const ContextLogger &_logctx, PTreeReaderOptions xmlReadFlags, const char *querySetName) const = 0; @@ -171,8 +171,8 @@ interface IQueryFactory : extends IInterface virtual IPropertyTree *getQueryStats(time_t from, time_t to) = 0; virtual void getGraphNames(StringArray &ret) const = 0; - virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const IRoxieContextLogger &logctx) const = 0; - virtual void getQueryInfo(StringBuffer &result, bool full, IArrayOf *agentQueries,const IRoxieContextLogger &logctx) const = 0; + virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const CBaseRoxieContextLogger &logctx) const = 0; + virtual void getQueryInfo(StringBuffer &result, bool full, IArrayOf *agentQueries,const CBaseRoxieContextLogger &logctx) const = 0; virtual bool isDynamic() const = 0; virtual unsigned getTimeActResetLastLogged() const = 0; virtual void setTimeActResetLastLogged(unsigned _ntime) const = 0; @@ -275,7 +275,7 @@ class CActivityFactory : public CInterface mystats.toStr(reply); myedgestats.toStr(reply); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { // Default is no additional information } diff --git a/roxie/ccd/ccdqueue.cpp b/roxie/ccd/ccdqueue.cpp index c0c7a091f26..91c2e6d1fd5 100644 --- a/roxie/ccd/ccdqueue.cpp +++ b/roxie/ccd/ccdqueue.cpp @@ -999,7 +999,7 @@ void AgentContextLogger::flush() static SpinLock onDemandQueriesCrit; static MapXToMyClass onDemandQueryCache; -void sendUnloadMessage(hash64_t hash, const char *id, const IRoxieContextLogger &logctx) +void sendUnloadMessage(hash64_t hash, const char *id, const CBaseRoxieContextLogger &logctx) { RemoteActivityId unloadId(ROXIE_UNLOAD, hash); RoxiePacketHeader header(unloadId, 0, 0, 0); @@ -1014,7 +1014,7 @@ void sendUnloadMessage(hash64_t hash, const char *id, const IRoxieContextLogger ROQ->sendPacket(packet, logctx); } -void doUnload(IRoxieQueryPacket *packet, const IRoxieContextLogger &logctx) +void doUnload(IRoxieQueryPacket *packet, const CBaseRoxieContextLogger &logctx) { const RoxiePacketHeader &header = packet->queryHeader(); unsigned channelNo = header.channel; @@ -1041,7 +1041,7 @@ struct PingRecord IpAddress senderIP; }; -void doPing(IRoxieQueryPacket *packet, const IRoxieContextLogger &logctx) +void doPing(IRoxieQueryPacket *packet, const CBaseRoxieContextLogger &logctx) { const RoxiePacketHeader &header = packet->queryHeader(); const IpAddress serverIP = header.serverId.getIpAddress(); @@ -2086,7 +2086,7 @@ class RoxieThrottledPacketSender : public Thread return 0; } - void sendPacket(IRoxieQueryPacket *x, const IRoxieContextLogger &logctx) + void sendPacket(IRoxieQueryPacket *x, const CBaseRoxieContextLogger &logctx) { RoxiePacketHeader &header = x->queryHeader(); @@ -2428,7 +2428,7 @@ class RoxieSocketQueueManager : public RoxieReceiverBase maxPacketSize = 65535; } - virtual void sendPacket(IRoxieQueryPacket *x, const IRoxieContextLogger &logctx) + virtual void sendPacket(IRoxieQueryPacket *x, const CBaseRoxieContextLogger &logctx) { if (throttledPacketSendManager) throttledPacketSendManager->sendPacket(x, logctx); @@ -2465,7 +2465,7 @@ class RoxieSocketQueueManager : public RoxieReceiverBase } } - virtual void sendIbyti(RoxiePacketHeader &header, const IRoxieContextLogger &logctx, unsigned subChannel) override + virtual void sendIbyti(RoxiePacketHeader &header, const CBaseRoxieContextLogger &logctx, unsigned subChannel) override { #ifdef SUBCHANNELS_IN_HEADER if (!header.hasBuddies()) @@ -2481,7 +2481,7 @@ class RoxieSocketQueueManager : public RoxieReceiverBase channelWrite(ibytiHeader, false); // don't send to self } - virtual void sendAbort(RoxiePacketHeader &header, const IRoxieContextLogger &logctx) override + virtual void sendAbort(RoxiePacketHeader &header, const CBaseRoxieContextLogger &logctx) override { MTIME_SECTION(queryActiveTimer(), "RoxieSocketQueueManager::sendAbort"); RoxiePacketHeader abortHeader(header, header.activityId & ROXIE_PRIORITY_MASK, 0); // subChannel irrelevant - we are about to overwrite retries anyway @@ -2502,7 +2502,7 @@ class RoxieSocketQueueManager : public RoxieReceiverBase } } - virtual void sendAbortCallback(const RoxiePacketHeader &header, const char *lfn, const IRoxieContextLogger &logctx) override + virtual void sendAbortCallback(const RoxiePacketHeader &header, const char *lfn, const CBaseRoxieContextLogger &logctx) override { MTIME_SECTION(queryActiveTimer(), "RoxieSocketQueueManager::sendAbortCallback"); RoxiePacketHeader abortHeader(header, ROXIE_FILECALLBACK, 0); // subChannel irrelevant - we are about to overwrite retries anyway @@ -2520,7 +2520,7 @@ class RoxieSocketQueueManager : public RoxieReceiverBase logctx.CTXLOG("sendAbortCallback wrote too little"); } - virtual IMessagePacker *createOutputStream(RoxiePacketHeader &header, bool outOfBand, const IRoxieContextLogger &logctx) + virtual IMessagePacker *createOutputStream(RoxiePacketHeader &header, bool outOfBand, const CBaseRoxieContextLogger &logctx) { unsigned qnum = outOfBand ? 0 : ((header.retries & ROXIE_FASTLANE) || !fastLaneQueue) ? 1 : 2; if (doTrace(traceRoxiePackets, TraceFlags::Max)) @@ -3283,7 +3283,7 @@ class RoxieLocalQueueManager : public RoxieReceiverBase receiveManager.setown(new RoxieLocalReceiveManager); } - virtual void sendPacket(IRoxieQueryPacket *packet, const IRoxieContextLogger &logctx) override + virtual void sendPacket(IRoxieQueryPacket *packet, const CBaseRoxieContextLogger &logctx) override { RoxiePacketHeader &header = packet->queryHeader(); unsigned retries = header.thisChannelRetries(0); @@ -3333,12 +3333,12 @@ class RoxieLocalQueueManager : public RoxieReceiverBase } } - virtual void sendIbyti(RoxiePacketHeader &header, const IRoxieContextLogger &logctx, unsigned subChannel) override + virtual void sendIbyti(RoxiePacketHeader &header, const CBaseRoxieContextLogger &logctx, unsigned subChannel) override { // Don't do IBYTI's when local agent - no buddy to talk to anyway } - virtual void sendAbort(RoxiePacketHeader &header, const IRoxieContextLogger &logctx) override + virtual void sendAbort(RoxiePacketHeader &header, const CBaseRoxieContextLogger &logctx) override { MTIME_SECTION(queryActiveTimer(), "RoxieLocalQueueManager::sendAbort"); RoxiePacketHeader abortHeader(header, header.activityId & ROXIE_PRIORITY_MASK, 0); @@ -3353,7 +3353,7 @@ class RoxieLocalQueueManager : public RoxieReceiverBase sendPacket(packet, logctx); } - virtual void sendAbortCallback(const RoxiePacketHeader &header, const char *lfn, const IRoxieContextLogger &logctx) override + virtual void sendAbortCallback(const RoxiePacketHeader &header, const char *lfn, const CBaseRoxieContextLogger &logctx) override { MTIME_SECTION(queryActiveTimer(), "RoxieLocalQueueManager::sendAbortCallback"); RoxiePacketHeader abortHeader(header, ROXIE_FILECALLBACK, 0); @@ -3368,7 +3368,7 @@ class RoxieLocalQueueManager : public RoxieReceiverBase sendPacket(packet, logctx); } - virtual IMessagePacker *createOutputStream(RoxiePacketHeader &header, bool outOfBand, const IRoxieContextLogger &logctx) override + virtual IMessagePacker *createOutputStream(RoxiePacketHeader &header, bool outOfBand, const CBaseRoxieContextLogger &logctx) override { return new LocalMessagePacker(header, outOfBand, receiveManager); } diff --git a/roxie/ccd/ccdqueue.ipp b/roxie/ccd/ccdqueue.ipp index a6254fbc4c7..c9a7557b26e 100644 --- a/roxie/ccd/ccdqueue.ipp +++ b/roxie/ccd/ccdqueue.ipp @@ -67,7 +67,7 @@ extern IPacketDiscarder *createPacketDiscarder(); extern void startPingTimer(); extern void stopPingTimer(); extern void closeMulticastSockets(); -extern void sendUnloadMessage(hash64_t hash, const char *id, const IRoxieContextLogger &logctx); +extern void sendUnloadMessage(hash64_t hash, const char *id, const CBaseRoxieContextLogger &logctx); extern unsigned getReplicationLevel(unsigned channel); diff --git a/roxie/ccd/ccdserver.cpp b/roxie/ccd/ccdserver.cpp index 2c675ad249c..e5867c698c1 100644 --- a/roxie/ccd/ccdserver.cpp +++ b/roxie/ccd/ccdserver.cpp @@ -168,7 +168,7 @@ class RestartableThread : public CInterface //The following don't link their arguments because that creates a circular reference //But I wish there was a better way -class IndirectAgentContext : implements IRoxieAgentContext, public CInterface +class IndirectAgentContext : implements IRoxieAgentContext { public: IndirectAgentContext(IRoxieAgentContext * _ctx) : IRoxieAgentContext(nullptr), ctx(_ctx) {} @@ -697,7 +697,7 @@ class CRoxieServerActivityFactoryBase : public CActivityFactory, implements IRox CActivityFactory::addChildQuery(id, childQuery); } - virtual void onCreateChildQueries(IRoxieAgentContext *ctx, IHThorArg *colocalArg, IArrayOf &childGraphs, IRoxieServerActivity *parentActivity, IProbeManager *_probeManager, const IRoxieContextLogger &_logctx, unsigned numParallel) const + virtual void onCreateChildQueries(IRoxieAgentContext *ctx, IHThorArg *colocalArg, IArrayOf &childGraphs, IRoxieServerActivity *parentActivity, IProbeManager *_probeManager, const CBaseRoxieContextLogger &_logctx, unsigned numParallel) const { ForEachItemIn(idx, childQueries) { @@ -707,7 +707,7 @@ class CRoxieServerActivityFactoryBase : public CActivityFactory, implements IRox } } - IActivityGraph * createChildGraph(IRoxieAgentContext * ctx, IHThorArg *colocalArg, unsigned childId, IRoxieServerActivity *parentActivity, IProbeManager * _probeManager, const IRoxieContextLogger &_logctx) const + IActivityGraph * createChildGraph(IRoxieAgentContext * ctx, IHThorArg *colocalArg, unsigned childId, IRoxieServerActivity *parentActivity, IProbeManager * _probeManager, const CBaseRoxieContextLogger &_logctx) const { unsigned match = childQueryIndexes.find(childId); assertex(match != NotFound); @@ -716,7 +716,7 @@ class CRoxieServerActivityFactoryBase : public CActivityFactory, implements IRox return graph.getClear(); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { // Most activities have nothing to say... } @@ -1030,7 +1030,7 @@ extern IEngineRowStream *connectSingleStream(IRoxieAgentContext *ctx, IFinalRoxi return result; } -class CRoxieServerActivity : implements CInterfaceOf, implements IFinalRoxieInput, implements IEngineRowStream, implements IRoxieContextLogger +class CRoxieServerActivity : implements CInterfaceOf, implements IFinalRoxieInput, implements IEngineRowStream, implements CBaseRoxieContextLogger { friend class StrandProcessor; protected: @@ -1090,7 +1090,7 @@ class CRoxieServerActivity : implements CInterfaceOf, impl IMPLEMENT_IINTERFACE_USING(CInterfaceOf) CRoxieServerActivity(IRoxieAgentContext *_ctx, const IRoxieServerActivityFactory *_factory, IProbeManager *_probeManager) - : IRoxieContextLogger(topology), basehelper(_factory->getHelper()), + : CBaseRoxieContextLogger(topology), basehelper(_factory->getHelper()), ctx(_ctx), interceptedCtx(*this), factory(_factory), @@ -1115,7 +1115,7 @@ class CRoxieServerActivity : implements CInterfaceOf, impl } CRoxieServerActivity(IRoxieAgentContext *_ctx, IHThorArg & _helper) - : IRoxieContextLogger(topology), basehelper(_helper), ctx(_ctx), + : CBaseRoxieContextLogger(topology), basehelper(_helper), ctx(_ctx), interceptedCtx(*this), factory(NULL), stats(allStatistics) { activityId = 0; @@ -1214,7 +1214,7 @@ class CRoxieServerActivity : implements CInterfaceOf, impl childGraphs.item(i).gatherStatistics(statsBuilder); } - virtual const IRoxieContextLogger &queryLogCtx()const + virtual const CBaseRoxieContextLogger &queryLogCtx()const { return *this; } @@ -17022,7 +17022,7 @@ class CRoxieServerLibraryCallActivityFactory : public CRoxieServerMultiOutputFac virtual unsigned numInputs() const { return inputs.ordinality(); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { addXrefLibraryInfo(reply, extra.libraryName); } @@ -17327,7 +17327,7 @@ class RoxieSteppedInput : implements ISteppedInput, public CInterface virtual const void * nextInputRow() { #ifdef TRACE_SEEK_REQUESTS - IRoxieContextLogger * logger = input->queryActivity(); + CBaseRoxieContextLogger * logger = input->queryActivity(); const void * ret = doNextInputRow(); { CommonXmlWriter xmlwrite(XWFtrim|XWFopt|XWFnoindent); @@ -17346,7 +17346,7 @@ class RoxieSteppedInput : implements ISteppedInput, public CInterface virtual const void * nextInputRowGE(const void * seek, unsigned numFields, bool & wasCompleteMatch, const SmartStepExtra & stepExtra) { #ifdef TRACE_SEEK_REQUESTS - IRoxieContextLogger * logger = input->queryActivity(); + CBaseRoxieContextLogger * logger = input->queryActivity(); { CommonXmlWriter xmlwrite(XWFtrim|XWFopt|XWFnoindent); if (input->queryOutputMeta()->hasXML()) @@ -23358,7 +23358,7 @@ class CRoxieServerDiskReadActivityFactory : public CRoxieServerActivityFactory throw MakeStringException(ROXIE_SET_INPUT, "Internal error: setInput() should not be called for %s activity", getActivityText(kind)); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { if (datafile) addXrefFileInfo(reply, datafile); @@ -23434,7 +23434,7 @@ class CRoxieServerBaseIndexActivityFactory : public CRoxieServerActivityFactory maxSeekLookahead = _graphNode.getPropInt("hint[@name='maxseeklookahead']/@value", 0); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { if (indexfile) addXrefFileInfo(reply, indexfile); @@ -25476,7 +25476,7 @@ class CRoxieServerFetchActivityFactory : public CRoxieServerActivityFactory return new CRoxieServerFetchActivity(_ctx, this, _probeManager, remoteId, map); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { if (datafile) addXrefFileInfo(reply, datafile); @@ -25555,7 +25555,7 @@ class CRoxieServerDummyActivityFactory : public CRoxieServerActivityFactory // virtual IRoxieServerActivity *createActivity(IRoxieAgentContext *_ctx, IProbeManager *_probeManager) const { throw MakeStringException(ROXIE_INTERNAL_ERROR, "%s query %s is suspended and cannot be executed - error occurred at %s(%d)", (queryFactory.isQueryLibrary()) ? "Library" : " ", queryFactory.queryQueryName(), sanitizeSourceFile(__FILE__), __LINE__); } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { if (!allFilesDynamic) { @@ -27224,7 +27224,7 @@ class CRoxieServerKeyedJoinActivityFactory : public CRoxieServerMultiInputFactor tailId, map, joinFlags, isLocal); // MORE - not sure local variant actually works - should be using files not map, for example? } - virtual void getXrefInfo(IPropertyTree &reply, const IRoxieContextLogger &logctx) const + virtual void getXrefInfo(IPropertyTree &reply, const CBaseRoxieContextLogger &logctx) const { if (datafile) addXrefFileInfo(reply, datafile); @@ -27825,7 +27825,7 @@ class CActivityGraph : implements IActivityGraph, implements IThorChildGraph, im std::atomic aborted; Owned exception; public: - ActivityGraphAgentContext(IRoxieAgentContext *_ctx, const IRoxieContextLogger &_logctx) : IndirectAgentContext(_ctx), logctx(_logctx), loopCounter(0), codeContext(NULL) + ActivityGraphAgentContext(IRoxieAgentContext *_ctx, const CBaseRoxieContextLogger &_logctx) : IndirectAgentContext(_ctx), logctx(_logctx), loopCounter(0), codeContext(NULL) { aborted = false; } @@ -27894,7 +27894,7 @@ class CActivityGraph : implements IActivityGraph, implements IThorChildGraph, im return ret; } protected: - const IRoxieContextLogger &logctx; + const CBaseRoxieContextLogger &logctx; unsigned loopCounter; StringAttr prefix; ICodeContext * codeContext; @@ -27991,7 +27991,7 @@ class CActivityGraph : implements IActivityGraph, implements IThorChildGraph, im public: IMPLEMENT_IINTERFACE; - CActivityGraph(IRoxieAgentContext *_ctx, const char *_graphName, unsigned _id, IRoxieServerActivity *_parentActivity, const ActivityArray &x, IProbeManager *_probeManager, const IRoxieContextLogger &_logctx) + CActivityGraph(IRoxieAgentContext *_ctx, const char *_graphName, unsigned _id, IRoxieServerActivity *_parentActivity, const ActivityArray &x, IProbeManager *_probeManager, const CBaseRoxieContextLogger &_logctx) : graphAgentContext(_ctx, _logctx), graphName(_graphName), graphDefinition(x), probeManager(_probeManager), parentActivity(_parentActivity) { id = x.getLibraryGraphId(); @@ -28437,7 +28437,7 @@ class CActivityGraph : implements IActivityGraph, implements IThorChildGraph, im probeManager->getProbeResponse(query); } - virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const IRoxieContextLogger &logctx) + virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const CBaseRoxieContextLogger &logctx) { throwUnexpected(); } @@ -28463,7 +28463,7 @@ class CProxyActivityGraph : implements IActivityGraph, implements IThorChildGrap public: IMPLEMENT_IINTERFACE; - CProxyActivityGraph(IRoxieAgentContext *_ctx, const char *_graphName, unsigned _id, IRoxieServerActivity *_parentActivity, ActivityArray &_graphDefinition, const IRoxieContextLogger &_logctx, unsigned _numParallel) + CProxyActivityGraph(IRoxieAgentContext *_ctx, const char *_graphName, unsigned _id, IRoxieServerActivity *_parentActivity, ActivityArray &_graphDefinition, const CBaseRoxieContextLogger &_logctx, unsigned _numParallel) : ctx(_ctx), parentActivity(_parentActivity), graphName(_graphName), id(_id), graphDefinition(_graphDefinition), logctx(_logctx), numParallel(_numParallel) { } @@ -28480,7 +28480,7 @@ class CProxyActivityGraph : implements IActivityGraph, implements IThorChildGrap virtual IThorChildGraph * queryChildGraph() override { return this; } virtual IEclGraphResults * queryLocalGraph() override { throwUnexpected(); } virtual IRoxieServerChildGraph * queryLoopGraph() override { throwUnexpected(); } - virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const IRoxieContextLogger &logctx) override { throwUnexpected(); } + virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const CBaseRoxieContextLogger &logctx) override { throwUnexpected(); } virtual const char *queryName() const override { throwUnexpected(); } virtual void gatherStatistics(IStatisticGatherer * statsBuilder) const override { @@ -28522,7 +28522,7 @@ class CProxyActivityGraph : implements IActivityGraph, implements IThorChildGrap StringAttr graphName; unsigned id; ActivityArray &graphDefinition; - const IRoxieContextLogger &logctx; + const CBaseRoxieContextLogger &logctx; unsigned numParallel; IHThorArg *colocalArg = nullptr; mutable CriticalSection graphCrit; @@ -28538,7 +28538,7 @@ class CIterationActivityGraph : public CActivityGraph public: CIterationActivityGraph(const char *_graphName, unsigned _id, IRoxieServerActivity *_parentActivity, ActivityArray &x, IProbeManager *_probeManager, - unsigned _loopCounter, IRoxieAgentContext *_ctx, IHThorArg * _colocalParent, unsigned parentExtractSize, const byte * parentExtract, const IRoxieContextLogger &_logctx) + unsigned _loopCounter, IRoxieAgentContext *_ctx, IHThorArg * _colocalParent, unsigned parentExtractSize, const byte * parentExtract, const CBaseRoxieContextLogger &_logctx) : CActivityGraph(_ctx, _graphName, _id, _parentActivity, x, _probeManager, _logctx) { graphOutputActivityIndex = 0; @@ -28731,7 +28731,7 @@ class CDelayedActivityGraph : implements IActivityGraph, public CInterface { return graphDefinition.queryWorkflowId(); } - virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const IRoxieContextLogger &logctx) override + virtual IRoxieServerChildGraph * createGraphLoopInstance(IRoxieAgentContext *ctx, unsigned loopCounter, unsigned parentExtractSize, const byte * parentExtract, const CBaseRoxieContextLogger &logctx) override { Owned ret = new CIterationActivityGraph(graphName, id, parentActivity, graphDefinition, probeManager, loopCounter, ctx, colocalParent, parentExtractSize, parentExtract, logctx); ret->createIterationGraph(ctx); @@ -28743,7 +28743,7 @@ class CDelayedActivityGraph : implements IActivityGraph, public CInterface -IActivityGraph *createActivityGraph(IRoxieAgentContext *ctx, const char *_graphName, unsigned id, ActivityArray &childFactories, IRoxieServerActivity *parentActivity, IProbeManager *_probeManager, const IRoxieContextLogger &_logctx, unsigned numParallel) +IActivityGraph *createActivityGraph(IRoxieAgentContext *ctx, const char *_graphName, unsigned id, ActivityArray &childFactories, IRoxieServerActivity *parentActivity, IProbeManager *_probeManager, const CBaseRoxieContextLogger &_logctx, unsigned numParallel) { if (childFactories.isDelayed()) { diff --git a/roxie/ccd/ccdserver.hpp b/roxie/ccd/ccdserver.hpp index 402436abdc2..ba00015dc49 100644 --- a/roxie/ccd/ccdserver.hpp +++ b/roxie/ccd/ccdserver.hpp @@ -196,7 +196,7 @@ interface IRoxieServerActivity : extends IActivityBase virtual IRoxieAgentContext *queryContext() = 0; virtual void serializeSkipInfo(MemoryBuffer &out, unsigned seekLen, const void *rawSeek, unsigned numFields, const void * seek, const SmartStepExtra &stepExtra) const = 0; virtual ThorActivityKind getKind() const = 0; - virtual const IRoxieContextLogger &queryLogCtx() const = 0; + virtual const CBaseRoxieContextLogger &queryLogCtx() const = 0; virtual void mergeStats(MemoryBuffer &stats) = 0; virtual void mergeStats(const CRuntimeStatisticCollection & childStats) = 0; virtual ISectionTimer * registerTimer(unsigned activityId, const char * name) = 0; @@ -225,11 +225,11 @@ interface IRoxieServerActivityFactory : extends IActivityFactory virtual IHThorArg &getHelper() const = 0; virtual IRoxieServerActivity *createFunction(IHThorArg &helper, IProbeManager *_probeManager) const = 0; virtual void noteProcessed(unsigned idx, unsigned processed) const = 0; - virtual void onCreateChildQueries(IRoxieAgentContext *ctx, IHThorArg *colocalArg, IArrayOf &childGraphs, IRoxieServerActivity *parentActivity, IProbeManager *_probeManager, const IRoxieContextLogger &_logctx, unsigned numParallel) const = 0; + virtual void onCreateChildQueries(IRoxieAgentContext *ctx, IHThorArg *colocalArg, IArrayOf &childGraphs, IRoxieServerActivity *parentActivity, IProbeManager *_probeManager, const CBaseRoxieContextLogger &_logctx, unsigned numParallel) const = 0; virtual void noteStarted() const = 0; virtual void noteStarted(unsigned idx) const = 0; virtual void noteDependent(unsigned target) = 0; - virtual IActivityGraph * createChildGraph(IRoxieAgentContext * ctx, IHThorArg *colocalArg, unsigned childId, IRoxieServerActivity *parentActivity, IProbeManager * _probeManager, const IRoxieContextLogger &_logctx) const = 0; + virtual IActivityGraph * createChildGraph(IRoxieAgentContext * ctx, IHThorArg *colocalArg, unsigned childId, IRoxieServerActivity *parentActivity, IProbeManager * _probeManager, const CBaseRoxieContextLogger &_logctx) const = 0; virtual unsigned __int64 queryLocalTimeNs() const = 0; virtual bool isGraphInvariant() const = 0; virtual unsigned numInputs() const = 0; @@ -289,7 +289,7 @@ interface IRoxieServerChildGraph : public IInterface interface IQueryFactory; -extern IActivityGraph *createActivityGraph(IRoxieAgentContext *ctx, const char *graphName, unsigned id, ActivityArray &x, IRoxieServerActivity *parent, IProbeManager *probeManager, const IRoxieContextLogger &logctx, unsigned numParallel); +extern IActivityGraph *createActivityGraph(IRoxieAgentContext *ctx, const char *graphName, unsigned id, ActivityArray &x, IRoxieServerActivity *parent, IProbeManager *probeManager, const CBaseRoxieContextLogger &logctx, unsigned numParallel); extern ruid_t getNextRuid(); extern void setStartRuid(unsigned restarts); diff --git a/roxie/ccd/ccdstate.cpp b/roxie/ccd/ccdstate.cpp index 0387f243b83..b0ee7bd319a 100644 --- a/roxie/ccd/ccdstate.cpp +++ b/roxie/ccd/ccdstate.cpp @@ -1071,7 +1071,7 @@ class CRoxieQuerySetManager : public CInterface, implements IRoxieQuerySetManage hash = rtlHash64VStr("active", hash); } - virtual void getStats(const char *queryName, const char *graphName, IConstWorkUnit *statsWu, unsigned channel, bool reset, const IRoxieContextLogger &logctx) const override + virtual void getStats(const char *queryName, const char *graphName, IConstWorkUnit *statsWu, unsigned channel, bool reset, const CBaseRoxieContextLogger &logctx) const override { Owned f = getQuery(queryName, NULL, logctx); if (f) @@ -1082,7 +1082,7 @@ class CRoxieQuerySetManager : public CInterface, implements IRoxieQuerySetManage throw MakeStringException(ROXIE_UNKNOWN_QUERY, "Unknown query %s", queryName); } - virtual void resetQueryTimings(const char *queryName, const IRoxieContextLogger &logctx) + virtual void resetQueryTimings(const char *queryName, const CBaseRoxieContextLogger &logctx) { Owned f = getQuery(queryName, NULL, logctx); if (f) @@ -1111,7 +1111,7 @@ class CRoxieQuerySetManager : public CInterface, implements IRoxieQuerySetManage } } - virtual void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieQuerySetManagerSet *agents, const IRoxieContextLogger &logctx) const + virtual void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieQuerySetManagerSet *agents, const CBaseRoxieContextLogger &logctx) const { HashIterator elems(queries); for (elems.first(); elems.isValid(); elems.next()) @@ -1141,7 +1141,7 @@ class CRoxieQuerySetManager : public CInterface, implements IRoxieQuerySetManage } } - virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, const IRoxieContextLogger &logctx) const + virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, const CBaseRoxieContextLogger &logctx) const { if (querySet && querySet->length() && !streq(querySet->str(), querySetName)) return NULL; @@ -1242,7 +1242,7 @@ class CRoxieAgentQuerySetManagerSet : public CInterface, implements IRoxieQueryS managers[channel]->preloadOnce(); } - virtual void getQueries(const char *id, IArrayOf &queries, const IRoxieContextLogger &logctx) const + virtual void getQueries(const char *id, IArrayOf &queries, const CBaseRoxieContextLogger &logctx) const { for (unsigned channel = 0; channel < numChannels; channel++) if (managers[channel]) @@ -1419,7 +1419,7 @@ class CRoxieQueryPackageManager : public CRoxieQueryPackageManagerBase return _xmlHash == xmlHash && _active==packages->isActive(); } - void getInfo(StringBuffer &reply, const IRoxieContextLogger &logctx) const + void getInfo(StringBuffer &reply, const CBaseRoxieContextLogger &logctx) const { reply.appendf(" getPartIds().ordinality()) @@ -1434,7 +1434,7 @@ class CRoxieQueryPackageManager : public CRoxieQueryPackageManagerBase reply.append(" \n"); } - bool resetStats(const char *queryId, const IRoxieContextLogger &logctx) + bool resetStats(const char *queryId, const CBaseRoxieContextLogger &logctx) { Owned serverManager; Owned agentManagers; @@ -1462,7 +1462,7 @@ class CRoxieQueryPackageManager : public CRoxieQueryPackageManagerBase return true; } - bool getStats(const char *queryId, const char *graphName, StringBuffer &reply, const char *wuid, const IRoxieContextLogger &logctx) const + bool getStats(const char *queryId, const char *graphName, StringBuffer &reply, const char *wuid, const CBaseRoxieContextLogger &logctx) const { Owned serverManager; Owned agentManagers; @@ -1533,7 +1533,7 @@ class CRoxieQueryPackageManager : public CRoxieQueryPackageManagerBase } } } - void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieContextLogger &logctx) const + void getAllQueryInfo(StringBuffer &reply, bool full, const CBaseRoxieContextLogger &logctx) const { Owned serverManager; Owned agentManagers; @@ -1689,7 +1689,7 @@ class CRoxiePackageSetWatcher : public CInterface allQueryPackages.append(*qpm.getClear()); } - IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const IRoxieContextLogger &logctx) const + IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const CBaseRoxieContextLogger &logctx) const { ForEachItemIn(idx, allQueryPackages) { @@ -1715,7 +1715,7 @@ class CRoxiePackageSetWatcher : public CInterface throw MakeStringException(ROXIE_LIBRARY_ERROR, "No library available for %s", libraryName); } - IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf *agentQueries, const IRoxieContextLogger &logctx) const + IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf *agentQueries, const CBaseRoxieContextLogger &logctx) const { if (querySet && querySet->length() && !allQuerySetNames.contains(querySet->str())) throw MakeStringException(ROXIE_INVALID_TARGET, "Target %s not found", querySet->str()); @@ -1757,7 +1757,7 @@ class CRoxiePackageSetWatcher : public CInterface return stateHash; } - void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieContextLogger &logctx) const + void getAllQueryInfo(StringBuffer &reply, bool full, const CBaseRoxieContextLogger &logctx) const { ForEachItemIn(idx, allQueryPackages) { @@ -1793,7 +1793,7 @@ class CRoxiePackageSetWatcher : public CInterface } } - void getInfo(StringBuffer &reply, const IRoxieContextLogger &logctx) const + void getInfo(StringBuffer &reply, const CBaseRoxieContextLogger &logctx) const { reply.append("\n"); ForEachItemIn(idx, allQueryPackages) @@ -1803,7 +1803,7 @@ class CRoxiePackageSetWatcher : public CInterface reply.append("\n"); } - void getStats(StringBuffer &reply, const char *id, const char *graphName, const char *wuid, const IRoxieContextLogger &logctx) const + void getStats(StringBuffer &reply, const char *id, const char *graphName, const char *wuid, const CBaseRoxieContextLogger &logctx) const { ForEachItemIn(idx, allQueryPackages) { @@ -1812,7 +1812,7 @@ class CRoxiePackageSetWatcher : public CInterface } } - void resetStats(const char *target, const char *id, const IRoxieContextLogger &logctx) const + void resetStats(const char *target, const char *id, const CBaseRoxieContextLogger &logctx) const { bool matched = false; ForEachItemIn(idx, allQueryPackages) @@ -2012,7 +2012,7 @@ class CRoxiePackageSetManager : implements IRoxieQueryPackageManagerSet, impleme } } - virtual void doControlMessage(IPropertyTree *xml, StringBuffer &reply, const IRoxieContextLogger &logctx) + virtual void doControlMessage(IPropertyTree *xml, StringBuffer &reply, const CBaseRoxieContextLogger &logctx) { if (!controlSem.wait(20000)) throw MakeStringException(ROXIE_TIMEOUT, "Timed out waiting for current control query to complete"); @@ -2035,13 +2035,13 @@ class CRoxiePackageSetManager : implements IRoxieQueryPackageManagerSet, impleme controlSem.signal(); } - virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const IRoxieContextLogger &logctx) const + virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const CBaseRoxieContextLogger &logctx) const { ReadLockBlock b(packageCrit); return allQueryPackages->lookupLibrary(libraryName, expectedInterfaceHash, logctx); } - virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf *agentQueries, const IRoxieContextLogger &logctx) const + virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf *agentQueries, const CBaseRoxieContextLogger &logctx) const { ReadLockBlock b(packageCrit); return allQueryPackages->getQuery(id, querySet, agentQueries, logctx); @@ -2254,7 +2254,7 @@ class CRoxiePackageSetManager : implements IRoxieQueryPackageManagerSet, impleme // Common code used by control:queries and control:getQueryXrefInfo - void getQueryInfo(IPropertyTree *control, StringBuffer &reply, bool full, const IRoxieContextLogger &logctx) const + void getQueryInfo(IPropertyTree *control, StringBuffer &reply, bool full, const CBaseRoxieContextLogger &logctx) const { Owned ids = control->getElements("Query"); reply.append("\n"); @@ -2282,7 +2282,7 @@ class CRoxiePackageSetManager : implements IRoxieQueryPackageManagerSet, impleme reply.append("\n"); } - void _doControlMessage(IPropertyTree *control, StringBuffer &reply, const IRoxieContextLogger &logctx) + void _doControlMessage(IPropertyTree *control, StringBuffer &reply, const CBaseRoxieContextLogger &logctx) { const char *queryName = control->queryName(); logctx.CTXLOG("doControlMessage - %s", queryName); diff --git a/roxie/ccd/ccdstate.hpp b/roxie/ccd/ccdstate.hpp index 44340aa9e70..6415bcf9d2b 100644 --- a/roxie/ccd/ccdstate.hpp +++ b/roxie/ccd/ccdstate.hpp @@ -77,7 +77,7 @@ extern IRoxiePackage *createRoxiePackage(IPropertyTree *p, IRoxiePackageMap *pac interface IAgentDynamicFileCache : extends IInterface { - virtual IResolvedFile *lookupDynamicFile(const IRoxieContextLogger &logctx, const char *lfn, CDateTime &cacheDate, unsigned checksum, RoxiePacketHeader *header, bool isOpt, bool isLocal) = 0; + virtual IResolvedFile *lookupDynamicFile(const CBaseRoxieContextLogger &logctx, const char *lfn, CDateTime &cacheDate, unsigned checksum, RoxiePacketHeader *header, bool isOpt, bool isLocal) = 0; virtual void releaseAll() = 0; }; extern IAgentDynamicFileCache *queryAgentDynamicFileCache(); @@ -116,20 +116,20 @@ interface ITranslatorSet : extends IInterface interface IRoxieQuerySetManagerSet : extends IInterface { virtual void load(const IPropertyTree *querySets, const IRoxiePackageMap &packages, hash64_t &hash, bool forceRetry) = 0; - virtual void getQueries(const char *id, IArrayOf &queries, const IRoxieContextLogger &logctx) const = 0; + virtual void getQueries(const char *id, IArrayOf &queries, const CBaseRoxieContextLogger &logctx) const = 0; virtual void preloadOnce() = 0; }; interface IRoxieQuerySetManager : extends IInterface { virtual bool isActive() const = 0; - virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, const IRoxieContextLogger &ctx) const = 0; + virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, const CBaseRoxieContextLogger &ctx) const = 0; virtual void load(const IPropertyTree *querySet, const IRoxiePackageMap &packages, hash64_t &hash, bool forceRetry) = 0; - virtual void getStats(const char *queryName, const char *graphName, IConstWorkUnit *statsWu, unsigned channel, bool reset, const IRoxieContextLogger &logctx) const = 0; - virtual void resetQueryTimings(const char *queryName, const IRoxieContextLogger &logctx) = 0; + virtual void getStats(const char *queryName, const char *graphName, IConstWorkUnit *statsWu, unsigned channel, bool reset, const CBaseRoxieContextLogger &logctx) const = 0; + virtual void resetQueryTimings(const char *queryName, const CBaseRoxieContextLogger &logctx) = 0; virtual void resetAllQueryTimings() = 0; virtual void getActivityMetrics(StringBuffer &reply) const = 0; - virtual void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieQuerySetManagerSet *agents, const IRoxieContextLogger &logctx) const = 0; + virtual void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieQuerySetManagerSet *agents, const CBaseRoxieContextLogger &logctx) const = 0; virtual void preloadOnce() const = 0; }; @@ -144,9 +144,9 @@ interface IRoxieQueryPackageManagerSet : extends IInterface { virtual void requestReload(bool waitUntilComplete, bool forceRetry, bool incremental) = 0; virtual void load() = 0; - virtual void doControlMessage(IPropertyTree *xml, StringBuffer &reply, const IRoxieContextLogger &ctx) = 0; - virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf *agents, const IRoxieContextLogger &logctx) const = 0; - virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const IRoxieContextLogger &logctx) const = 0; + virtual void doControlMessage(IPropertyTree *xml, StringBuffer &reply, const CBaseRoxieContextLogger &ctx) = 0; + virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf *agents, const CBaseRoxieContextLogger &logctx) const = 0; + virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const CBaseRoxieContextLogger &logctx) const = 0; virtual int getActivePackageCount() const = 0; }; diff --git a/roxie/udplib/udplib.hpp b/roxie/udplib/udplib.hpp index 2e1f7ad5af2..4862a659e56 100644 --- a/roxie/udplib/udplib.hpp +++ b/roxie/udplib/udplib.hpp @@ -165,15 +165,15 @@ extern UDPLIB_API void stopAeronDriver(); interface IRoxieQueryPacket; class RoxiePacketHeader; interface IPendingCallback; -interface IRoxieContextLogger; +interface CBaseRoxieContextLogger; interface IRoxieOutputQueueManager : public IInterface { - virtual void sendPacket(IRoxieQueryPacket *x, const IRoxieContextLogger &logctx) = 0; - virtual void sendIbyti(RoxiePacketHeader &header, const IRoxieContextLogger &logctx, unsigned subChannel) = 0; - virtual void sendAbort(RoxiePacketHeader &header, const IRoxieContextLogger &logctx) = 0; - virtual void sendAbortCallback(const RoxiePacketHeader &header, const char *lfn, const IRoxieContextLogger &logctx) = 0; - virtual IMessagePacker *createOutputStream(RoxiePacketHeader &x, bool outOfBand, const IRoxieContextLogger &logctx) = 0; + virtual void sendPacket(IRoxieQueryPacket *x, const CBaseRoxieContextLogger &logctx) = 0; + virtual void sendIbyti(RoxiePacketHeader &header, const CBaseRoxieContextLogger &logctx, unsigned subChannel) = 0; + virtual void sendAbort(RoxiePacketHeader &header, const CBaseRoxieContextLogger &logctx) = 0; + virtual void sendAbortCallback(const RoxiePacketHeader &header, const char *lfn, const CBaseRoxieContextLogger &logctx) = 0; + virtual IMessagePacker *createOutputStream(RoxiePacketHeader &x, bool outOfBand, const CBaseRoxieContextLogger &logctx) = 0; virtual bool replyPending(RoxiePacketHeader &x) = 0; virtual bool abortCompleted(RoxiePacketHeader &x) = 0; diff --git a/system/jlib/jlog.cpp b/system/jlib/jlog.cpp index d8c090d4759..84c8fc8d5bc 100644 --- a/system/jlib/jlog.cpp +++ b/system/jlib/jlog.cpp @@ -2770,18 +2770,18 @@ void SysLogMsgHandler::addToPTree(IPropertyTree * tree) const tree->addPropTree("handler", handlerTree); } -void IContextLogger::CTXLOG(const char *format, ...) const +void CDefaultContextLogger::CTXLOG(const char *format, ...) const { va_list args; va_start(args, format); CTXLOGva(MCdebugInfo, logMsgJobInfo, NoLogMsgCode, format, args); va_end(args); } -void IContextLogger::CTXLOGva(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char *format, va_list args) const +void CDefaultContextLogger::CTXLOGva(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char *format, va_list args) const { VALOG(cat, job, code, format, args); } -void IContextLogger::mCTXLOG(const char *format, ...) const +void CDefaultContextLogger::mCTXLOG(const char *format, ...) const { va_list args; va_start(args, format); @@ -2813,14 +2813,14 @@ void IContextLogger::mCTXLOG(const char *format, ...) const ++cursor; } } -void IContextLogger::logOperatorException(IException *E, const char *file, unsigned line, const char *format, ...) const +void CDefaultContextLogger::logOperatorException(IException *E, const char *file, unsigned line, const char *format, ...) const { va_list args; va_start(args, format); logOperatorExceptionVA(E, file, line, format, args); va_end(args); } -void IContextLogger::logOperatorExceptionVA(IException *E, const char *file, unsigned line, const char *format, va_list args) const +void CDefaultContextLogger::logOperatorExceptionVA(IException *E, const char *file, unsigned line, const char *format, va_list args) const { StringBuffer ss; ss.append("ERROR"); @@ -2836,13 +2836,10 @@ void IContextLogger::logOperatorExceptionVA(IException *E, const char *file, uns } class CRuntimeStatisticCollection; -class DummyLogCtx : implements IContextLogger, public CInterface +class DummyLogCtx : extends CDefaultContextLogger { public: - DummyLogCtx(): IContextLogger(nullptr) {} - // It's a static object - we don't want to actually link-count it... - virtual void Link() const {} - virtual bool Release() const { return false; } + DummyLogCtx(): CDefaultContextLogger(nullptr) {} virtual void CTXLOG(const char *format, ...) const __attribute__((format(printf, 2, 3))) {} virtual void mCTXLOG(const char *format, ...) const __attribute__((format(printf, 2, 3))) {} void logOperatorException(IException *E, const char *file, unsigned line, const char *format, ...) const __attribute__((format(printf, 5, 6))) {} diff --git a/system/jlib/jlog.hpp b/system/jlib/jlog.hpp index 7eeaf87250a..9d4027fc1e0 100644 --- a/system/jlib/jlog.hpp +++ b/system/jlib/jlog.hpp @@ -1240,13 +1240,38 @@ extern jlib_decl void UseSysLogForOperatorMessages(bool use=true); extern jlib_decl void AuditSystemAccess(const char *userid, bool success, char const * msg,...) __attribute__((format(printf, 3, 4))); - interface jlib_decl IContextLogger : extends IInterface +{ +public: + virtual void setGlobalId(const char *id, SocketEndpoint &ep, unsigned pid) = 0; + virtual void setCallerId(const char *id) = 0; + virtual const char *queryGlobalId() const = 0; + virtual const char *queryLocalId() const = 0; + virtual const char *queryCallerId() const = 0; + virtual void setHttpIdHeaderNames(const char *global, const char *caller) = 0; + virtual const char *queryGlobalIdHttpHeaderName() const = 0; + virtual const char *queryCallerIdHttpHeaderName() const = 0; + virtual void CTXLOG(const char *format, ...) const __attribute__((format(printf, 2, 3))) = 0; + virtual void mCTXLOG(const char *format, ...) const __attribute__((format(printf, 2, 3))) = 0; + virtual void CTXLOGva(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char *format, va_list args) const __attribute__((format(printf,5,0))) = 0; + virtual void logOperatorException(IException *E, const char *file, unsigned line, const char *format, ...) const __attribute__((format(printf, 5, 6))) = 0; + virtual void logOperatorExceptionVA(IException *E, const char *file, unsigned line, const char *format, va_list args) const __attribute__((format(printf,5,0))) = 0; + virtual void noteStatistic(StatisticKind kind, unsigned __int64 value) const = 0; + virtual void setStatistic(StatisticKind kind, unsigned __int64 value) const = 0; + virtual void mergeStats(const CRuntimeStatisticCollection &from) const = 0; + virtual unsigned queryTraceLevel() const = 0; + virtual const CRuntimeStatisticCollection & queryStats() const = 0; + virtual void recordStatistics(IStatisticGatherer &progress) const = 0; + virtual void updateStatsDeltaTo(CRuntimeStatisticCollection &to, CRuntimeStatisticCollection &previous) const = 0; +}; + +class jlib_decl CDefaultContextLogger : public CInterface, implements IContextLogger { const LogMsgJobInfo & logMsgJobInfo; LogTrace logTrace; public: - IContextLogger(const IPropertyTree *cfg, const LogMsgJobInfo & _logMsgJobInfo=unknownJob) : logMsgJobInfo(_logMsgJobInfo) + IMPLEMENT_IINTERFACE; + CDefaultContextLogger(const IPropertyTree *cfg, const LogMsgJobInfo & _logMsgJobInfo=unknownJob) : logMsgJobInfo(_logMsgJobInfo) { if (cfg && cfg->hasProp("@httpGlobalIdHeader")) logTrace.setHttpIdHeaderNames(cfg->queryProp("@httpGlobalIdHeader"), cfg->queryProp("@httpCallerIdHeader")); @@ -1299,15 +1324,14 @@ interface jlib_decl IContextLogger : extends IInterface virtual void updateStatsDeltaTo(CRuntimeStatisticCollection &to, CRuntimeStatisticCollection &previous) const = 0; }; -class CStatsContextLogger : implements IContextLogger, public CInterface +class CStatsContextLogger : public CDefaultContextLogger { protected: unsigned traceLevel = 1; mutable CRuntimeStatisticCollection stats; public: - IMPLEMENT_IINTERFACE; - CStatsContextLogger(const IPropertyTree *cfg, const StatisticsMapping & mapping, const LogMsgJobInfo & _logMsgJobInfo=unknownJob) : IContextLogger(cfg, _logMsgJobInfo), stats(mapping) + CStatsContextLogger(const IPropertyTree *cfg, const StatisticsMapping & mapping, const LogMsgJobInfo & _logMsgJobInfo=unknownJob) : CDefaultContextLogger(cfg, _logMsgJobInfo), stats(mapping) { } virtual unsigned queryTraceLevel() const override