Kaynağa Gözat

Merge pull request #10782 from wangkx/h18696

HPCC-18696 Add new integer fields for WsDFU size, etc.

Reviewed-By: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Reviewed-By: Gordon Smith <gordon.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 yıl önce
ebeveyn
işleme
fec752892f
2 değiştirilmiş dosya ile 62 ekleme ve 11 silme
  1. 11 0
      esp/scm/ws_dfu.ecm
  2. 51 11
      esp/services/ws_dfu/ws_dfuService.cpp

+ 11 - 0
esp/scm/ws_dfu.ecm

@@ -81,12 +81,15 @@ ESPStruct DFUPart
     [depr_ver("1.23")] string ActualSize;
     string Ip;
     string Partsize;
+    [min_ver("1.38")] int64 PartSizeInt64;
 };
 
 ESPStruct DFUFileStat
 {
     string MinSkew;
     string MaxSkew;
+    [min_ver("1.38")] int64 MinSkewInt64;
+    [min_ver("1.38")] int64 MaxSkewInt64;
 };
 
 ESPStruct [nil_remove] DFUFilePartsOnCluster
@@ -117,9 +120,12 @@ ESPStruct [nil_remove] DFUFileDetail
     string Dir;
     string PathMask;
     string Filesize;
+    [min_ver("1.38")] int64 FileSizeInt64;
     [depr_ver("1.23")] string ActualSize;
     string RecordSize;
     string RecordCount;
+    [min_ver("1.38")] int64 RecordSizeInt64;
+    [min_ver("1.38")] int64 RecordCountInt64;
     string Wuid;
     string Owner;
     [depr_ver("1.25")] string Cluster;
@@ -165,6 +171,11 @@ ESPStruct DFUSpaceItem
     string LargestSize;
     string SmallestFile;
     string SmallestSize;
+    [min_ver("1.38")] int64 NumOfFilesInt64;
+    [min_ver("1.38")] int64 NumOfFilesUnknownInt64;
+    [min_ver("1.38")] int64 TotalSizeInt64;
+    [min_ver("1.38")] int64 LargestSizeInt64;
+    [min_ver("1.38")] int64 SmallestSizeInt64;
 };
 
 ESPStruct DFUActionInfo

+ 51 - 11
esp/services/ws_dfu/ws_dfuService.cpp

@@ -566,6 +566,7 @@ bool CWsDfuEx::onDFUSpace(IEspContext &context, IEspDFUSpaceRequest & req, IEspD
             i++;
         }
 
+        double version = context.getClientVersion();
         IArrayOf<IEspDFUSpaceItem> SpaceItems;
         for(; i < SpaceItems64.length();i++)
         {
@@ -575,20 +576,35 @@ bool CWsDfuEx::onDFUSpace(IEspContext &context, IEspDFUSpaceRequest & req, IEspD
 
             StringBuffer buf;
             Owned<IEspDFUSpaceItem> item1 = createDFUSpaceItem("","");
+
+            __int64 numOfFiles = item64.getNumOfFilesInt();
+            __int64 numOfFilesIntUnknown = item64.getNumOfFilesIntUnknown();
+            __int64 totalSize = item64.getTotalSizeInt();
+            __int64 largestSize = item64.getLargestSizeInt();
+            __int64 smallestSize = item64.getSmallestSizeInt();
+            if (version >= 1.38)
+            {
+                item1->setNumOfFilesInt64(numOfFiles);
+                item1->setNumOfFilesUnknownInt64(numOfFilesIntUnknown);
+                item1->setTotalSizeInt64(totalSize);
+                item1->setLargestSizeInt64(largestSize);
+                item1->setSmallestSizeInt64(smallestSize);
+            }
+
             item1->setName(item64.getName());
-            buf << comma(item64.getNumOfFilesInt());
+            buf << comma(numOfFiles);
             item1->setNumOfFiles(buf.str());
             buf.clear();
-            buf << comma(item64.getNumOfFilesIntUnknown());
+            buf << comma(numOfFilesIntUnknown);
             item1->setNumOfFilesUnknown(buf.str());
             buf.clear();
-            buf << comma(item64.getTotalSizeInt());
+            buf << comma(totalSize);
             item1->setTotalSize(buf.str());
             buf.clear();
-            buf << comma(item64.getLargestSizeInt());
+            buf << comma(largestSize);
             item1->setLargestSize(buf.str());
             buf.clear();
-            buf << comma(item64.getSmallestSizeInt());
+            buf << comma(smallestSize);
             item1->setSmallestSize(buf.str());
             item1->setLargestFile(item64.getLargestFile());
             item1->setSmallestFile(item64.getSmallestFile());
@@ -1849,13 +1865,14 @@ void CWsDfuEx::getFilePartsOnClusters(IEspContext &context, const char* clusterR
             IPartDescriptor& part = pi->query();
             unsigned partIndex = part.queryPartIndex();
 
+            __int64 size = -1;
             StringBuffer partSizeStr;
             IPropertyTree* partPropertyTree = &part.queryProperties();
             if (!partPropertyTree)
                 partSizeStr.set("<N/A>");
             else
             {
-                __uint64 size = partPropertyTree->getPropInt64("@size");
+                size = partPropertyTree->getPropInt64("@size", -1);
                 comma c4(size);
                 partSizeStr<<c4;
 
@@ -1873,6 +1890,8 @@ void CWsDfuEx::getFilePartsOnClusters(IEspContext &context, const char* clusterR
                 Owned<IEspDFUPart> FilePart = createDFUPart("","");
                 FilePart->setId(partIndex+1);
                 FilePart->setPartsize(partSizeStr.str());
+                if (version >= 1.38)
+                    FilePart->setPartSizeInt64(size);
                 FilePart->setIp(b.str());
                 FilePart->setCopy(i+1);
 
@@ -1968,6 +1987,8 @@ void CWsDfuEx::doGetFileDetails(IEspContext &context, IUserDescriptor* udesc, co
 
     FileDetails.setDescription(strDesc);
 
+    if (version >= 1.38)
+        FileDetails.setFileSizeInt64(size);
     comma c1(size);
     StringBuffer tmpstr;
     tmpstr<<c1;
@@ -1997,20 +2018,29 @@ void CWsDfuEx::doGetFileDetails(IEspContext &context, IUserDescriptor* udesc, co
         }
     }
 
+    if (version >= 1.38)
+        FileDetails.setRecordSizeInt64(recordSize);
     comma c2(recordSize);
     tmpstr.clear();
     tmpstr<<c2;
     FileDetails.setRecordSize(tmpstr.str());
 
     tmpstr.clear();
+    __int64 recordCount = -1;
     if (df->queryAttributes().hasProp("@recordCount"))
     {
-        comma c3(df->queryAttributes().getPropInt64("@recordCount"));
-        tmpstr<<c3;
+        recordCount = df->queryAttributes().getPropInt64("@recordCount");
     }
     else if (recordSize)
     {
-        comma c3(size/recordSize);
+        recordCount = size/recordSize;
+    }
+    if (version >= 1.38)
+        FileDetails.setRecordCountInt64(recordCount);
+
+    if (recordCount != -1)
+    {
+        comma c3(recordCount);
         tmpstr<<c3;
     }
     FileDetails.setRecordCount(tmpstr.str());
@@ -2171,6 +2201,9 @@ void CWsDfuEx::doGetFileDetails(IEspContext &context, IUserDescriptor* udesc, co
                try
                 {
                     offset_t size=queryDistributedFileSystem().getSize(part);
+                    if (version >= 1.38)
+                        FilePart->setPartSizeInt64(size);
+
                     comma c4(size);
                     tmpstr.clear();
                     tmpstr<<c4;
@@ -2203,13 +2236,20 @@ void CWsDfuEx::doGetFileDetails(IEspContext &context, IUserDescriptor* udesc, co
     {
         IEspDFUFileStat& Stat = FileDetails.updateStat();
         offset_t avg=sum/count;
+        offset_t minSkew = avg-mn;
+        offset_t maxSkew = mx-avg;
+        if (version >= 1.38)
+        {
+            Stat.setMinSkewInt64(minSkew);
+            Stat.setMaxSkewInt64(maxSkew);
+        }
 
-        comma c5(avg-mn);
+        comma c5(minSkew);
         tmpstr.clear();
         tmpstr<<c5;
         Stat.setMinSkew(tmpstr.str());
 
-        comma c6(mx-avg);
+        comma c6(maxSkew);
         tmpstr.clear();
         tmpstr<<c6;
         Stat.setMaxSkew(tmpstr.str());