Переглянути джерело

Merge branch 'candidate-8.4.x' into candidate-8.6.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 роки тому
батько
коміт
28a5500311

+ 1 - 1
dali/ft/fttransform.cpp

@@ -827,7 +827,7 @@ processedProgress:
             }
 
             const RemoteFilename & outputFilename = curPartition.outputName;
-            auto fsProperties = outputFilename.queryFileSystemProperties();
+            const auto & fsProperties = outputFilename.queryFileSystemProperties();
             RemoteFilename localTempFilename;
             if (!fsProperties.canRename)
                 localTempFilename.set(outputFilename);

+ 1 - 1
esp/bindings/SOAP/Platform/soapparam.hpp

@@ -598,7 +598,7 @@ public:
     void copy(SoapArrayParam<arraytype,itemtype> &from)
     {
         arr.kill();
-        arraytype fromArray = from.getValue();
+        const arraytype & fromArray = from.getValue();
         ForEachItemIn(idx, fromArray)
           arr.append(fromArray.item(idx));
     }

+ 3 - 3
esp/services/ws_sql/SQL2ECL/ECLEngine.cpp

@@ -204,7 +204,7 @@ void ECLEngine::generateSelectECL(HPCCSQLTreeWalker * selectsqlobj, StringBuffer
 
     ForEachItemIn(tableidx, *tables)
     {
-        SQLTable table = tables->item(tableidx);
+        SQLTable & table = tables->item(tableidx);
         const char * tname = table.getName();
 
         HPCCFilePtr file = selectsqlobj->queryHPCCFileCache()->getHpccFileByName(tname);
@@ -710,7 +710,7 @@ bool ECLEngine::processIndex(HPCCFile * indexfiletouse, StringBuffer & keyedandw
     {
         for (int indexfilecolumnindex = 0; indexfilecolumnindex < indexfilecolumns->length(); indexfilecolumnindex++)
         {
-            HPCCColumnMetaData currcol = indexfilecolumns->item(indexfilecolumnindex);
+            HPCCColumnMetaData & currcol = indexfilecolumns->item(indexfilecolumnindex);
             const char * currindexfilecolname = currcol.getColumnName();
             if (currcol.isKeyedField())
             {
@@ -927,7 +927,7 @@ bool ECLEngine::appendTranslatedHavingClause(HPCCSQLTreeWalker * sqlobj, StringB
             const IArrayOf<SQLTable> * tables = sqlobj->getTableList();
             ForEachItemIn(tableidx, *tables)
             {
-                SQLTable table = tables->item(tableidx);
+                SQLTable & table = tables->item(tableidx);
                 translator->appendProp(table.getName(), "LEFT");
             }
 

+ 2 - 2
esp/services/ws_sql/SQL2ECL/HPCCFile.cpp

@@ -234,7 +234,7 @@ void HPCCFile::getFieldsAsDelmitedString(char delim, const char * prefix, String
     bool isFirst = true;
     ForEachItemIn(colidx, columns)
     {
-        HPCCColumnMetaData currcol = columns.item(colidx);
+        HPCCColumnMetaData & currcol = columns.item(colidx);
         if ((onlykeyed && currcol.isKeyedField()) || (!onlykeyed && !currcol.isKeyedField()))
         {
             if (!isFirst)
@@ -276,7 +276,7 @@ void HPCCFile::setKeyCounts()
     keyedCount = 0;
     ForEachItemIn(colidx, columns)
     {
-        HPCCColumnMetaData currcol = columns.item(colidx);
+        HPCCColumnMetaData & currcol = columns.item(colidx);
         if (!currcol.isKeyedField())
             nonKeyedCount++;
         else

+ 1 - 1
esp/services/ws_sql/SQL2ECL/HPCCFileCache.cpp

@@ -110,7 +110,7 @@ bool HPCCFileCache::fetchHpccFilesByTableName(IArrayOf<SQLTable> * sqltables)
 
     ForEachItemIn(tableindex, *sqltables)
     {
-       SQLTable table = sqltables->item(tableindex);
+       SQLTable & table = sqltables->item(tableindex);
        const char * cachedKey = cacheHpccFileByName(table.getName());
        allFound &= (cachedKey && *cachedKey);
     }

+ 3 - 3
esp/services/ws_sql/SQL2ECL/HPCCSQLTreeWalker.cpp

@@ -1201,7 +1201,7 @@ void HPCCSQLTreeWalker::expandWildCardColumn()
             {
                 ForEachItemIn(tableidx, tableList)
                 {
-                    SQLTable tab = (SQLTable)tableList.item(tableidx);
+                    SQLTable & tab = tableList.item(tableidx);
 
                     HPCCFilePtr file = tmpHPCCFileCache->getHpccFileByName(tab.getName());
                     if (file)
@@ -1233,7 +1233,7 @@ void HPCCSQLTreeWalker::expandWildCardColumn()
                     IArrayOf<HPCCColumnMetaData> * cols = file->getColumns();
                     ForEachItemIn(colidx, *cols)
                     {
-                        HPCCColumnMetaData col = cols->item(colidx);
+                        HPCCColumnMetaData & col = cols->item(colidx);
                         Owned<ISQLExpression> fve = new SQLFieldValueExpression(tablename, col.getColumnName());
                         if (colidx == 0)
                         {
@@ -1431,7 +1431,7 @@ bool HPCCSQLTreeWalker::normalizeSQL()
                     if (idxt > 0)
                         normalizedSQL.append(", ");
 
-                    SQLTable tab = (SQLTable)tableList.item(idxt);
+                    SQLTable & tab = tableList.item(idxt);
                     normalizedSQL.append(tab.getName());
 
                     if (tab.hasIndexHint())

+ 2 - 1
esp/services/ws_sql/SQL2ECL/SQLExpression.cpp

@@ -747,7 +747,8 @@ SQLFunctionExpression::SQLFunctionExpression(const char* funcname)
 SQLFunctionExpression::SQLFunctionExpression(const char* funcname, const IArrayOf<ISQLExpression> &params)
 {
     setFunction(funcname);
-    this->params = params;
+    ForEachItemIn(i, params)
+        this->params.append(OLINK(params.item(i)));
     this->alias = "";
     distinct = false;
 }

+ 1 - 1
roxie/ccd/ccdactivities.cpp

@@ -212,7 +212,7 @@ public:
         }
         ForEachItemIn(i, childQueries)
         {
-            auto child = childQueries.item(i);
+            ActivityArray &child = childQueries.item(i);
             StatsChildGraphScope cc(builder, childQueryIndexes.item(i));
             child.gatherStats(builder, channel, reset);
         }

+ 2 - 0
roxie/ccd/ccdquery.hpp

@@ -188,6 +188,8 @@ class ActivityArray : public CInterface
     unsigned libraryGraphId;
     unsigned wfid;
 
+    ActivityArray() = delete;
+
 public:
     ActivityArray(bool _multiInstance, bool _delayed, bool _library, bool _sequential, unsigned _wfid)
      : multiInstance(_multiInstance), delayed(_delayed), library(_library), sequential(_sequential), wfid(_wfid)

+ 1 - 1
roxie/ccd/ccdserver.cpp

@@ -592,7 +592,7 @@ public:
             mystats.recordStatistics(builder, reset);
             ForEachItemIn(i, childQueries)
             {
-                auto child = childQueries.item(i);
+                ActivityArray &child = childQueries.item(i);
                 StatsChildGraphScope cc(builder, childQueryIndexes.item(i));
                 child.gatherStats(builder, channel, reset);
             }

+ 7 - 7
roxie/ccd/ccdsnmp.cpp

@@ -622,7 +622,7 @@ class CQueryStatsAggregator : public CInterface, implements IQueryStatsAggregato
             unsigned *times = (unsigned *) alloca(useStats.size() * sizeof(unsigned));
             QueryStatsAggregateRecord aggregator(from, to);
             unsigned i = 0;
-            for (auto r : useStats)
+            for (auto &r : useStats)
             {
                 aggregator.noteQuery(r.failed, r.elapsedTimeMs, r.memUsed, r.agentsReplyLen, r.bytesOut);
                 times[i++] = r.elapsedTimeMs;
@@ -641,7 +641,7 @@ class CQueryStatsAggregator : public CInterface, implements IQueryStatsAggregato
 
         static void getRawStats(IPropertyTree &result, std::deque<QueryStatsRecord> &useStats)
         {
-            for (auto r : useStats)
+            for (auto &r : useStats)
             {
                 Owned<IPropertyTree> queryStatsRecord = createPTree("QueryStatsRecord", ipt_fast);
                 CDateTime dt;
@@ -834,7 +834,7 @@ class CQueryStatsAggregator : public CInterface, implements IQueryStatsAggregato
 
         static void getRawStats(IPropertyTree &result, std::deque<QueryStatsAggregateRecord> &useStats, time_t from, time_t to)
         {
-            for (auto r : useStats)
+            for (auto &r : useStats)
             {
                 Owned<IPropertyTree> queryStatsAggregateRecord = createPTree("QueryStatsAggregateRecord", ipt_fast);
                 r.getStats(*queryStatsAggregateRecord, true);
@@ -1007,7 +1007,7 @@ public:
             std::deque<QueryStatsRecord> useStats;
             {
                 CriticalBlock b(statsLock);
-                for (auto rec : recent)
+                for (auto &rec : recent)
                 {
                     if (rec.inRange(from, to))
                         useStats.push_back(rec);
@@ -1021,7 +1021,7 @@ public:
             QueryStatsAggregateRecord aggregator(from, to);
             {
                 CriticalBlock b(statsLock);
-                for (auto thisSlot: aggregated)
+                for (auto &thisSlot: aggregated)
                 {
                     if (thisSlot.timeOverlap(from, to))
                         aggregator.mergeStats(thisSlot);
@@ -1042,7 +1042,7 @@ public:
         std::deque<QueryStatsRecord> useStats;
         {
             CriticalBlock b(statsLock);
-            for (auto rec : recent)
+            for (auto &rec : recent)
             {
                 if (rec.inRange(from, to))
                     useStats.push_back(rec);
@@ -1054,7 +1054,7 @@ public:
         std::deque<QueryStatsAggregateRecord> aggregatedStats;
         {
             CriticalBlock b(statsLock);
-            for (auto thisSlot: aggregated)
+            for (auto &thisSlot: aggregated)
             {
                 if (thisSlot.timeOverlap(from, to))
                     aggregatedStats.push_back(thisSlot);

+ 4 - 0
system/jlib/jarray.hpp

@@ -66,6 +66,10 @@ typedef int (* StdCompare)(const void *_e1, const void *_e2);
 class jlib_decl Allocator
 {
 public:
+    Allocator() = default;
+    Allocator(const Allocator & ) = delete;
+    Allocator & operator = (const Allocator & ) = delete;
+
     void  kill();
     inline bool isItem(aindex_t pos = 0) const    { return pos < used; }      /* Is there an item at pos */
     inline aindex_t length() const                 { return used; } /* Return number of items  */

+ 3 - 3
system/jlib/jiface.hpp

@@ -88,9 +88,9 @@ public:
     }
 
 private:
-    CSimpleInterfaceOf(const CSimpleInterfaceOf &) : xxcount(1) {};
-    CSimpleInterfaceOf(CSimpleInterfaceOf &&) = delete;
-    CSimpleInterfaceOf & operator = (const CSimpleInterfaceOf &) = delete;
+    CSimpleInterfaceOf<INTERFACE>(const CSimpleInterfaceOf<INTERFACE>&) = delete;
+    CSimpleInterfaceOf<INTERFACE>(CSimpleInterfaceOf<INTERFACE> &&) = delete;
+    CSimpleInterfaceOf<INTERFACE> & operator = (const CSimpleInterfaceOf<INTERFACE> &) = delete;
     mutable std::atomic<unsigned> xxcount;
 };
 

+ 1 - 1
system/metrics/sinks/file/fileSink.cpp

@@ -58,7 +58,7 @@ void FileMetricSink::collectingHasStopped()
 void FileMetricSink::writeMeasurementToFile(const std::shared_ptr<IMetric> &pMetric) const
 {
     std::string name = pMetric->queryName();
-    auto metaData = pMetric->queryMetaData();
+    const auto & metaData = pMetric->queryMetaData();
     for (auto &metaDataIt: metaData)
     {
         name.append(".").append(metaDataIt.value);

+ 1 - 1
system/metrics/sinks/log/logSink.cpp

@@ -42,7 +42,7 @@ void LogMetricSink::doCollection()
 void LogMetricSink::writeLogEntry(const std::shared_ptr<IMetric> &pMetric)
 {
     std::string name = pMetric->queryName();
-    auto metaData = pMetric->queryMetaData();
+    const auto & metaData = pMetric->queryMetaData();
     for (auto &metaDataIt: metaData)
     {
         name.append(".").append(metaDataIt.value);

+ 1 - 1
system/metrics/sinks/prometheus/prometheusSink.cpp

@@ -125,7 +125,7 @@ void PrometheusMetricSink::toPrometheusMetrics(const std::vector<std::shared_ptr
         }
 
         out.append(name.c_str());
-        auto metaData = pMetric->queryMetaData();
+        const auto & metaData = pMetric->queryMetaData();
         if (metaData.size()>0)
         {
             out.append(" {");