|
@@ -2077,6 +2077,7 @@ class CRoxieServerContext : public CSlaveContext, implements IRoxieServerContext
|
|
|
{
|
|
|
const IQueryFactory *serverQueryFactory;
|
|
|
CriticalSection daliUpdateCrit;
|
|
|
+ StringAttr querySetName;
|
|
|
|
|
|
TextMarkupFormat mlFmt;
|
|
|
bool isRaw;
|
|
@@ -2236,8 +2237,8 @@ public:
|
|
|
startWorkUnit();
|
|
|
}
|
|
|
|
|
|
- CRoxieServerContext(IPropertyTree *_context, const IQueryFactory *_factory, SafeSocket &_client, TextMarkupFormat _mlFmt, bool _isRaw, bool _isBlocked, HttpHelper &httpHelper, bool _trim, unsigned _priority, const ContextLogger &_logctx, PTreeReaderOptions _xmlReadFlags)
|
|
|
- : CSlaveContext(_factory, _logctx, 0, 0, NULL, false, false, false), serverQueryFactory(_factory)
|
|
|
+ CRoxieServerContext(IPropertyTree *_context, const IQueryFactory *_factory, SafeSocket &_client, TextMarkupFormat _mlFmt, bool _isRaw, bool _isBlocked, HttpHelper &httpHelper, bool _trim, unsigned _priority, const ContextLogger &_logctx, PTreeReaderOptions _xmlReadFlags, const char *_querySetName)
|
|
|
+ : CSlaveContext(_factory, _logctx, 0, 0, NULL, false, false, false), serverQueryFactory(_factory), querySetName(_querySetName)
|
|
|
{
|
|
|
init();
|
|
|
context.set(_context);
|
|
@@ -3114,9 +3115,22 @@ public:
|
|
|
return useContext(sequence).hasProp(name);
|
|
|
}
|
|
|
|
|
|
- virtual char *getClusterName() { throwUnexpected(); }
|
|
|
+ virtual char *getClusterName()
|
|
|
+ {
|
|
|
+ if (workUnit)
|
|
|
+ {
|
|
|
+ SCMStringBuffer out;
|
|
|
+ workUnit->getClusterName(out);
|
|
|
+ return out.s.detach(); // detach will return "" rather than NULL
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // predeployed queries with no workunit should return the querySet name
|
|
|
+ return strdup(querySetName.sget()); // sget will return "" rather than NULL
|
|
|
+ }
|
|
|
+ }
|
|
|
virtual char *getGroupName() { throwUnexpected(); }
|
|
|
- virtual char * queryIndexMetaData(char const * lfn, char const * xpath) { throwUnexpected(); }
|
|
|
+ virtual char *queryIndexMetaData(char const * lfn, char const * xpath) { throwUnexpected(); }
|
|
|
virtual char *getEnv(const char *name, const char *defaultValue) const
|
|
|
{
|
|
|
return serverQueryFactory->getEnv(name, defaultValue);
|
|
@@ -3199,8 +3213,8 @@ private:
|
|
|
StringAttr queryName;
|
|
|
|
|
|
public:
|
|
|
- CSoapRoxieServerContext(IPropertyTree *_context, const IQueryFactory *_factory, SafeSocket &_client, HttpHelper &httpHelper, unsigned _priority, const ContextLogger &_logctx, PTreeReaderOptions xmlReadFlags)
|
|
|
- : CRoxieServerContext(_context, _factory, _client, MarkupFmt_XML, false, false, httpHelper, true, _priority, _logctx, xmlReadFlags)
|
|
|
+ CSoapRoxieServerContext(IPropertyTree *_context, const IQueryFactory *_factory, SafeSocket &_client, HttpHelper &httpHelper, unsigned _priority, const ContextLogger &_logctx, PTreeReaderOptions xmlReadFlags, const char *_querySetName)
|
|
|
+ : CRoxieServerContext(_context, _factory, _client, MarkupFmt_XML, false, false, httpHelper, true, _priority, _logctx, xmlReadFlags, _querySetName)
|
|
|
{
|
|
|
queryName.set(_context->queryName());
|
|
|
}
|
|
@@ -3258,8 +3272,8 @@ private:
|
|
|
StringAttr queryName;
|
|
|
|
|
|
public:
|
|
|
- CJsonRoxieServerContext(IPropertyTree *_context, const IQueryFactory *_factory, SafeSocket &_client, HttpHelper &httpHelper, unsigned _priority, const ContextLogger &_logctx, PTreeReaderOptions xmlReadFlags)
|
|
|
- : CRoxieServerContext(_context, _factory, _client, MarkupFmt_JSON, false, false, httpHelper, true, _priority, _logctx, xmlReadFlags)
|
|
|
+ CJsonRoxieServerContext(IPropertyTree *_context, const IQueryFactory *_factory, SafeSocket &_client, HttpHelper &httpHelper, unsigned _priority, const ContextLogger &_logctx, PTreeReaderOptions xmlReadFlags, const char *_querySetName)
|
|
|
+ : CRoxieServerContext(_context, _factory, _client, MarkupFmt_JSON, false, false, httpHelper, true, _priority, _logctx, xmlReadFlags, _querySetName)
|
|
|
{
|
|
|
queryName.set(_context->queryName());
|
|
|
}
|
|
@@ -3337,16 +3351,16 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-IRoxieServerContext *createRoxieServerContext(IPropertyTree *context, const IQueryFactory *factory, SafeSocket &client, bool isXml, bool isRaw, bool isBlocked, HttpHelper &httpHelper, bool trim, unsigned priority, const ContextLogger &_logctx, PTreeReaderOptions readFlags)
|
|
|
+IRoxieServerContext *createRoxieServerContext(IPropertyTree *context, const IQueryFactory *factory, SafeSocket &client, bool isXml, bool isRaw, bool isBlocked, HttpHelper &httpHelper, bool trim, unsigned priority, const ContextLogger &_logctx, PTreeReaderOptions readFlags, const char *querySetName)
|
|
|
{
|
|
|
if (httpHelper.isHttp())
|
|
|
{
|
|
|
if (httpHelper.queryContentFormat()==MarkupFmt_JSON)
|
|
|
- return new CJsonRoxieServerContext(context, factory, client, httpHelper, priority, _logctx, readFlags);
|
|
|
- return new CSoapRoxieServerContext(context, factory, client, httpHelper, priority, _logctx, readFlags);
|
|
|
+ return new CJsonRoxieServerContext(context, factory, client, httpHelper, priority, _logctx, readFlags, querySetName);
|
|
|
+ return new CSoapRoxieServerContext(context, factory, client, httpHelper, priority, _logctx, readFlags, querySetName);
|
|
|
}
|
|
|
else
|
|
|
- return new CRoxieServerContext(context, factory, client, isXml ? MarkupFmt_XML : MarkupFmt_Unknown, isRaw, isBlocked, httpHelper, trim, priority, _logctx, readFlags);
|
|
|
+ return new CRoxieServerContext(context, factory, client, isXml ? MarkupFmt_XML : MarkupFmt_Unknown, isRaw, isBlocked, httpHelper, trim, priority, _logctx, readFlags, querySetName);
|
|
|
}
|
|
|
|
|
|
IRoxieServerContext *createOnceServerContext(const IQueryFactory *factory, const ContextLogger &_logctx)
|