فهرست منبع

Merge branch 'candidate-4.2.6' into closedown-4.2.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 سال پیش
والد
کامیت
eb0d14f277
5فایلهای تغییر یافته به همراه32 افزوده شده و 5 حذف شده
  1. 1 1
      common/workunit/package.cpp
  2. 1 0
      ecl/hql/hqlmeta.cpp
  3. 2 0
      ecl/hqlcpp/hqlhtcpp.cpp
  4. 26 4
      roxie/ccd/ccdstate.cpp
  5. 2 0
      roxie/ccd/ccdstate.hpp

+ 1 - 1
common/workunit/package.cpp

@@ -41,7 +41,7 @@ CPackageNode::CPackageNode(IPropertyTree *p)
     else
         node.setown(createPTree("HpccPackages"));
     StringBuffer xml;
-    toXML(node, xml);
+    toXML(node, xml, 0, XML_SortTags);
     hash = rtlHash64Data(xml.length(), xml.str(), 9994410);
 }
 

+ 1 - 0
ecl/hql/hqlmeta.cpp

@@ -2826,6 +2826,7 @@ void calculateDatasetMeta(CHqlMetaInfo & meta, IHqlExpression * expr)
             meta.setUnknownGrouping();
         break;
     case no_externalcall:
+    case no_external:
         if (isGrouped(expr))
             meta.setUnknownGrouping();
         //No support for grouping?

+ 2 - 0
ecl/hqlcpp/hqlhtcpp.cpp

@@ -6549,6 +6549,8 @@ ABoundActivity * HqlCppTranslator::buildActivity(BuildCtx & ctx, IHqlExpression
             case no_executewhen:
                 result = doBuildActivityExecuteWhen(ctx, expr, isRoot);
                 break;
+            case no_param:
+                throwUnexpectedX("Create Parameter as an activity");
             case no_thor:
                 UNIMPLEMENTED;
                 break;

+ 26 - 4
roxie/ccd/ccdstate.cpp

@@ -458,6 +458,11 @@ public:
         // we could set the cache field to null here for any objects still in cache but there would be a race condition
     }
 
+    virtual void setHash(hash64_t newhash)
+    {
+        hash = newhash;
+    }
+
     virtual IPropertyTreeIterator *getInMemoryIndexInfo(const IPropertyTree &graphNode) const 
     {
         StringBuffer xpath;
@@ -620,6 +625,7 @@ extern const IRoxiePackage &queryRootRoxiePackage()
     {
         // Set up the root package. This contains global settings from topology file
         rootPackage = new CRoxiePackage(topology); // attributes become control: environment settings. Rest of topology ignored.
+        rootPackage->setHash(0);  // we don't include the topology in the package hashes...
         rootPackage->resolveBases(NULL);
     }
     return *rootPackage;
@@ -2148,8 +2154,13 @@ private:
                     reply.appendf("<Dali connected='1'/>");
                 else
                     reply.appendf("<Dali connected='0'/>");
-                ReadLockBlock readBlock(packageCrit);
-                reply.appendf("<State hash='%"I64F"u'/>", (unsigned __int64) allQueryPackages->queryHash());
+                unsigned __int64 thash = getTopologyHash();
+                unsigned __int64 shash;
+                {
+                    ReadLockBlock readBlock(packageCrit);
+                    shash = allQueryPackages->queryHash();
+                }
+                reply.appendf("<State hash='%"I64F"u' topologyHash='%"I64F"u'/>", shash, thash);
             }
             else if (stricmp(queryName, "control:resetindexmetrics")==0)
             {
@@ -2234,8 +2245,13 @@ private:
                     reply.appendf("<Dali connected='1'/>");
                 else
                     reply.appendf("<Dali connected='0'/>");
-                ReadLockBlock readBlock(packageCrit);
-                reply.appendf("<State hash='%"I64F"u'/>", (unsigned __int64) allQueryPackages->queryHash());
+                unsigned __int64 thash = getTopologyHash();
+                unsigned __int64 shash;
+                {
+                    ReadLockBlock readBlock(packageCrit);
+                    shash = allQueryPackages->queryHash();
+                }
+                reply.appendf("<State hash='%"I64F"u' topologyHash='%"I64F"u'/>", shash, thash);
             }
             else if (stricmp(queryName, "control:steppingEnabled")==0)
             {
@@ -2450,6 +2466,12 @@ private:
         throw MakeStringException(ROXIE_INVALID_INPUT, "Badly formated control query");
     }
 
+    hash64_t getTopologyHash()
+    {
+        StringBuffer xml;
+        toXML(topology, xml, 0, XML_SortTags);
+        return rtlHash64Data(xml.length(), xml.str(), 707018);
+    }
 };
 
 extern IRoxieQueryPackageManagerSet *createRoxiePackageSetManager(const IQueryDll *standAloneDll)

+ 2 - 0
roxie/ccd/ccdstate.hpp

@@ -60,6 +60,8 @@ interface IRoxiePackage : public IHpccPackage
     virtual IRoxieWriteHandler *createFileName(const char *fileName, bool overwrite, bool extend, const StringArray &clusters, IConstWorkUnit *wu) const = 0;
     // Lookup information in package about what in-memory indexes should be built for file
     virtual IPropertyTreeIterator *getInMemoryIndexInfo(const IPropertyTree &graphNode) const = 0;
+    // Set the hash to be used for this package
+    virtual void setHash(hash64_t newhash)  = 0;
 };
 
 interface IResolvedFileCache