|
@@ -997,14 +997,16 @@ public:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- virtual void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieContextLogger &logctx) const
|
|
|
+ virtual void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieQuerySetManagerSet *slaves, const IRoxieContextLogger &logctx) const
|
|
|
{
|
|
|
HashIterator elems(queries);
|
|
|
for (elems.first(); elems.isValid(); elems.next())
|
|
|
{
|
|
|
IMapping &cur = elems.query();
|
|
|
IQueryFactory *query = queries.mapToValue(&cur);
|
|
|
- query->getQueryInfo(reply, full, logctx);
|
|
|
+ IArrayOf<IQueryFactory> slaveQueries;
|
|
|
+ slaves->getQueries(query->queryQueryName(), slaveQueries, logctx);
|
|
|
+ query->getQueryInfo(reply, full, &slaveQueries, logctx);
|
|
|
}
|
|
|
HashIterator aliasIterator(aliases);
|
|
|
for (aliasIterator.first(); aliasIterator.isValid(); aliasIterator.next())
|
|
@@ -1112,6 +1114,17 @@ public:
|
|
|
managers[channel]->load(querySets, packages, hash, forceRetry); // MORE - this means the hash depends on the number of channels. Is that desirable?
|
|
|
}
|
|
|
|
|
|
+ virtual void getQueries(const char *id, IArrayOf<IQueryFactory> &queries, const IRoxieContextLogger &logctx) const
|
|
|
+ {
|
|
|
+ for (unsigned channel = 0; channel < numChannels; channel++)
|
|
|
+ if (managers[channel])
|
|
|
+ {
|
|
|
+ IQueryFactory *query = managers[channel]->getQuery(id, NULL, logctx);
|
|
|
+ if (query)
|
|
|
+ queries.append(*query);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private:
|
|
|
unsigned numChannels;
|
|
|
CRoxieSlaveQuerySetManager **managers;
|
|
@@ -1221,6 +1234,12 @@ public:
|
|
|
return serverManager.getLink();
|
|
|
}
|
|
|
|
|
|
+ IRoxieQuerySetManagerSet* getRoxieSlaveManagers()
|
|
|
+ {
|
|
|
+ CriticalBlock b2(updateCrit);
|
|
|
+ return slaveManagers.getLink();
|
|
|
+ }
|
|
|
+
|
|
|
void getInfo(StringBuffer &reply, const IRoxieContextLogger &logctx) const
|
|
|
{
|
|
|
reply.appendf(" <PackageSet id=\"%s\" querySet=\"%s\"/>\n", queryPackageId(), querySet.get());
|
|
@@ -1284,10 +1303,10 @@ public:
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieContextLogger &logctx) const
|
|
|
+ void getAllQueryInfo(StringBuffer &reply, bool full, const IRoxieContextLogger &logctx) const
|
|
|
{
|
|
|
CriticalBlock b2(updateCrit);
|
|
|
- serverManager->getAllQueryInfo(reply, full, logctx);
|
|
|
+ serverManager->getAllQueryInfo(reply, full, slaveManagers, logctx);
|
|
|
}
|
|
|
protected:
|
|
|
void reloadQueryManagers(CRoxieSlaveQuerySetManagerSet *newSlaveManagers, IRoxieQuerySetManager *newServerManager, hash64_t newHash)
|
|
@@ -1487,7 +1506,7 @@ public:
|
|
|
throw MakeStringException(ROXIE_LIBRARY_ERROR, "No library available for %s", libraryName);
|
|
|
}
|
|
|
|
|
|
- IQueryFactory *getQuery(const char *id, StringBuffer *querySet, const IRoxieContextLogger &logctx) const
|
|
|
+ IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf<IQueryFactory> *slaveQueries, const IRoxieContextLogger &logctx) const
|
|
|
{
|
|
|
ForEachItemIn(idx, allQueryPackages)
|
|
|
{
|
|
@@ -1496,7 +1515,14 @@ public:
|
|
|
{
|
|
|
IQueryFactory *query = sm->getQuery(id, querySet, logctx);
|
|
|
if (query)
|
|
|
+ {
|
|
|
+ if (slaveQueries)
|
|
|
+ {
|
|
|
+ Owned<IRoxieQuerySetManagerSet> slaveManagers = allQueryPackages.item(idx).getRoxieSlaveManagers();
|
|
|
+ slaveManagers->getQueries(id, *slaveQueries, logctx);
|
|
|
+ }
|
|
|
return query;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return NULL;
|
|
@@ -1524,8 +1550,9 @@ public:
|
|
|
{
|
|
|
ForEachItemIn(idx, allQueryPackages)
|
|
|
{
|
|
|
- Owned<IRoxieQuerySetManager> sm = allQueryPackages.item(idx).getRoxieServerManager();
|
|
|
- sm->getAllQueryInfo(reply, full, logctx);
|
|
|
+ Owned<IRoxieQuerySetManager> serverManager = allQueryPackages.item(idx).getRoxieServerManager();
|
|
|
+ Owned<IRoxieQuerySetManagerSet> slaveManagers = allQueryPackages.item(idx).getRoxieSlaveManagers();
|
|
|
+ serverManager->getAllQueryInfo(reply, full, slaveManagers, logctx);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1718,10 +1745,10 @@ public:
|
|
|
return allQueryPackages->lookupLibrary(libraryName, expectedInterfaceHash, logctx);
|
|
|
}
|
|
|
|
|
|
- virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, const IRoxieContextLogger &logctx) const
|
|
|
+ virtual IQueryFactory *getQuery(const char *id, StringBuffer *querySet, IArrayOf<IQueryFactory> *slaveQueries, const IRoxieContextLogger &logctx) const
|
|
|
{
|
|
|
ReadLockBlock b(packageCrit);
|
|
|
- return allQueryPackages->getQuery(id, querySet, logctx);
|
|
|
+ return allQueryPackages->getQuery(id, querySet, slaveQueries, logctx);
|
|
|
}
|
|
|
|
|
|
virtual int getActivePackageCount() const
|
|
@@ -1830,9 +1857,10 @@ private:
|
|
|
const char *id = ids->query().queryProp("@id");
|
|
|
if (id)
|
|
|
{
|
|
|
- Owned<IQueryFactory> query = getQuery(id, NULL, logctx);
|
|
|
+ IArrayOf<IQueryFactory> slaveQueries;
|
|
|
+ Owned<IQueryFactory> query = getQuery(id, NULL, &slaveQueries, logctx);
|
|
|
if (query)
|
|
|
- query->getQueryInfo(reply, full, logctx);
|
|
|
+ query->getQueryInfo(reply, full, &slaveQueries, logctx);
|
|
|
else
|
|
|
reply.appendf(" <Query id=\"%s\" error=\"Query not found\"/>\n", id);
|
|
|
}
|
|
@@ -2051,7 +2079,7 @@ private:
|
|
|
if (!id)
|
|
|
throw MakeStringException(ROXIE_MISSING_PARAMS, "No query name specified");
|
|
|
|
|
|
- Owned<IQueryFactory> q = getQuery(id, NULL, logctx);
|
|
|
+ Owned<IQueryFactory> q = getQuery(id, NULL, NULL, logctx);
|
|
|
if (q)
|
|
|
{
|
|
|
Owned<IPropertyTree> tempTree = q->cloneQueryXGMML();
|
|
@@ -2066,7 +2094,7 @@ private:
|
|
|
const char *id = control->queryProp("Query/@id");
|
|
|
if (!id)
|
|
|
badFormat();
|
|
|
- Owned<IQueryFactory> f = getQuery(id, NULL, logctx);
|
|
|
+ Owned<IQueryFactory> f = getQuery(id, NULL, NULL, logctx);
|
|
|
if (f)
|
|
|
{
|
|
|
unsigned warnLimit = f->getWarnTimeLimit();
|
|
@@ -2270,7 +2298,7 @@ private:
|
|
|
const char *id = control->queryProp("Query/@id");
|
|
|
if (id)
|
|
|
{
|
|
|
- Owned<IQueryFactory> f = getQuery(id, NULL, logctx);
|
|
|
+ Owned<IQueryFactory> f = getQuery(id, NULL, NULL, logctx); // MORE - slave too?
|
|
|
if (f)
|
|
|
{
|
|
|
Owned<const IPropertyTree> stats = f->getQueryStats(from, to);
|
|
@@ -2302,7 +2330,7 @@ private:
|
|
|
{
|
|
|
if (stricmp(action, "listGraphNames") == 0)
|
|
|
{
|
|
|
- Owned<IQueryFactory> query = getQuery(id, NULL, logctx);
|
|
|
+ Owned<IQueryFactory> query = getQuery(id, NULL, NULL, logctx); // MORE - slave too?
|
|
|
if (query)
|
|
|
{
|
|
|
reply.appendf("<Query id='%s'>\n", id);
|
|
@@ -2440,7 +2468,7 @@ private:
|
|
|
if (!id.length())
|
|
|
badFormat();
|
|
|
{
|
|
|
- Owned<IQueryFactory> f = getQuery(id, NULL, logctx);
|
|
|
+ Owned<IQueryFactory> f = getQuery(id, NULL, NULL, logctx); // MORE - slave too?
|
|
|
if (f)
|
|
|
id.clear().append(f->queryQueryName()); // use the spelling of the query stored with the query factory
|
|
|
}
|