Browse Source

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

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 years ago
parent
commit
8e2c73250b

+ 4 - 4
common/workunit/workunit.cpp

@@ -640,7 +640,7 @@ public:
     virtual unsigned __int64 getHash() const;
     virtual IStringIterator *getLogs(const char *type, const char *component) const;
     virtual IStringIterator *getProcesses(const char *type) const;
-    virtual IPropertyTreeIterator& getProcesses(const char *type, const char *instance) const;
+    virtual IPropertyTreeIterator* getProcesses(const char *type, const char *instance) const;
 
     virtual bool getWuDate(unsigned & year, unsigned & month, unsigned& day);
     virtual IStringVal & getSnapshot(IStringVal & str) const;
@@ -1103,7 +1103,7 @@ public:
             { return c->getLogs(type, instance); }
     virtual IStringIterator *getProcesses(const char *type) const
             { return c->getProcesses(type); }
-    virtual IPropertyTreeIterator& getProcesses(const char *type, const char *instance) const
+    virtual IPropertyTreeIterator* getProcesses(const char *type, const char *instance) const
             { return c->getProcesses(type, instance); }
 
     virtual void clearExceptions()
@@ -5232,7 +5232,7 @@ IStringIterator *CLocalWorkUnit::getLogs(const char *type, const char *instance)
         return new CStringPTreeAttrIterator(p->getElements(xpath.str()), "@log");
 }
 
-IPropertyTreeIterator& CLocalWorkUnit::getProcesses(const char *type, const char *instance) const
+IPropertyTreeIterator* CLocalWorkUnit::getProcesses(const char *type, const char *instance) const
 {
     VStringBuffer xpath("Process/%s/", type);
     if (instance)
@@ -5240,7 +5240,7 @@ IPropertyTreeIterator& CLocalWorkUnit::getProcesses(const char *type, const char
     else
         xpath.append("*");
     CriticalBlock block(crit);
-    return * p->getElements(xpath.str());
+    return p->getElements(xpath.str());
 }
 
 IStringIterator *CLocalWorkUnit::getProcesses(const char *type) const

+ 1 - 1
common/workunit/workunit.hpp

@@ -925,7 +925,7 @@ interface IConstWorkUnit : extends IInterface
     virtual unsigned __int64 getHash() const = 0;
     virtual IStringIterator *getLogs(const char *type, const char *instance=NULL) const = 0;
     virtual IStringIterator *getProcesses(const char *type) const = 0;
-    virtual IPropertyTreeIterator& getProcesses(const char *type, const char *instance) const = 0;
+    virtual IPropertyTreeIterator* getProcesses(const char *type, const char *instance) const = 0;
 };
 
 

+ 11 - 3
docs/ECLLanguageReference/ECLR-includer.xml

@@ -138,9 +138,17 @@
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
   </chapter>
 
-  <chapter id="Value_Types_Chapter">
+  <chapter id="Value_Types">
     <title><emphasis role="bold">Value Types</emphasis></title>
 
+    <para>Value types<indexterm>
+        <primary>Value Types</primary>
+      </indexterm> declare an Attribute's type when placed left of the
+    Attribute name in the definition. They also declare a passed parameter's
+    type when placed left of the parameter name in the definition. Value types
+    also explicitly cast from type to another when placed in parentheses left
+    of the expression to cast.</para>
+
     <xi:include href="ECLLanguageReference/ECLR_mods/Value-Boolean.xml"
                 xpointer="element(/1)"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
@@ -866,9 +874,9 @@
     <xi:include href="ECLLanguageReference/ECLR_mods/BltInFunc-TOUNICODE.xml"
                 xpointer="element(/1)"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
-   
+
     <xi:include href="ECLLanguageReference/ECLR_mods/BltInFunc-TOXML.xml"
-                   xpointer="element(/1)"
+                xpointer="element(/1)"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
 
     <xi:include href="ECLLanguageReference/ECLR_mods/BltInFunc-TRANSFER.xml"

+ 5 - 2
docs/ECLLanguageReference/ECLR_mods/BltInFunc-EVENTEXTRA.xml

@@ -19,7 +19,7 @@
           <row>
             <entry>Return:</entry>
 
-            <entry>EVENTNAME returns a single string value.</entry>
+            <entry>EVENTEXTRA returns a single string value.</entry>
           </row>
         </tbody>
       </tgroup>
@@ -49,5 +49,8 @@ WAIT('MyServiceComplete');
 OUTPUT('WORKUNIT DONE')
 </programlisting>
 
-  <para>See Also: <link linkend="EVENT">EVENT</link>, <link linkend="EVENTNAME">EVENTNAME</link>, <link linkend="CRON">CRON</link>, <link linkend="WHEN">WHEN</link>, <link linkend="WAIT">WAIT</link>, <link linkend="NOTIFY">NOTIFY</link></para>
+  <para>See Also: <link linkend="EVENT">EVENT</link>, <link
+  linkend="EVENTNAME">EVENTNAME</link>, <link linkend="CRON">CRON</link>,
+  <link linkend="WHEN">WHEN</link>, <link linkend="WAIT">WAIT</link>, <link
+  linkend="NOTIFY">NOTIFY</link></para>
 </sect1>

+ 23 - 35
docs/ECLLanguageReference/ECLR_mods/Value-Boolean.xml

@@ -1,39 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<sect1 id="Value_Types" role="nobrk">
-  <title>Value Types<indexterm>
-      <primary>Value Types</primary>
-    </indexterm></title>
-
-  <para>Value types declare an Attribute's type when placed left of the
-  Attribute name in the definition. They also declare a passed parameter's
-  type when placed left of the parameter name in the definition. Value types
-  also explicitly cast from type to another when placed in parentheses left of
-  the expression to cast.</para>
-
-  <sect2 id="BOOLEAN">
-    <title>BOOLEAN</title>
-
-    <para><emphasis role="bold">BOOLEAN<indexterm>
-        <primary>BOOLEAN</primary>
-      </indexterm><indexterm>
-        <primary>BOOLEAN value type</primary>
-      </indexterm></emphasis></para>
-
-    <para>A Boolean true/false value. <emphasis
-    role="bold">TRUE</emphasis><indexterm>
-        <primary>TRUE</primary>
-      </indexterm> and <emphasis role="bold">FALSE<indexterm>
-        <primary>FALSE</primary>
-      </indexterm></emphasis> are reserved ECL keywords; they are Boolean
-    constants that may be used to compare against a BOOLEAN type. When BOOLEAN
-    is used in a RECORD structure, a single-byte integer containing one (1) or
-    zero (0) is output.</para>
-
-    <para>Example:</para>
-
-    <programlisting>BOOLEAN MyBoolean := SomeAttribute &gt; 10;
+<sect1 id="BOOLEAN" role="nobrk">
+  <title>BOOLEAN</title>
+
+  <para><emphasis role="bold">BOOLEAN<indexterm>
+      <primary>BOOLEAN</primary>
+    </indexterm><indexterm>
+      <primary>BOOLEAN value type</primary>
+    </indexterm></emphasis></para>
+
+  <para>A Boolean true/false value. <emphasis
+  role="bold">TRUE</emphasis><indexterm>
+      <primary>TRUE</primary>
+    </indexterm> and <emphasis role="bold">FALSE<indexterm>
+      <primary>FALSE</primary>
+    </indexterm></emphasis> are reserved ECL keywords; they are Boolean
+  constants that may be used to compare against a BOOLEAN type. When BOOLEAN
+  is used in a RECORD structure, a single-byte integer containing one (1) or
+  zero (0) is output.</para>
+
+  <para>Example:</para>
+
+  <programlisting>BOOLEAN MyBoolean := SomeAttribute &gt; 10;
         // declares MyBoolean a BOOLEAN Attribute
      
 BOOLEAN MyBoolean(INTEGER p) := p &gt; 10;
@@ -42,6 +31,5 @@ BOOLEAN MyBoolean(INTEGER p) := p &gt; 10;
 BOOLEAN Typtrd := trades.trd_type = 'R';
         // Typtrd is a Boolean attribute, likely to be used as a filter</programlisting>
 
-    <para>See Also: <link linkend="TRUE_FALSE">TRUE/FALSE</link></para>
-  </sect2>
+  <para>See Also: <link linkend="TRUE_FALSE">TRUE/FALSE</link></para>
 </sect1>

+ 1 - 1
docs/ECLStandardLibraryReference/SLR-Mods/AddSuperFile.xml

@@ -34,7 +34,7 @@
           <entry><emphasis>subfile</emphasis></entry>
 
           <entry>A null-terminated string containing the logical name of the
-          sub-file. Ths may be another superfile.</entry>
+          sub-file. This may be another superfile.</entry>
         </row>
 
         <row>

+ 53 - 0
docs/ECLStandardLibraryReference/SLR-Mods/RemoveOwnedSubFiles.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<sect1 id="RemoveOwnedSubFiles">
+  <title>RemoveOwnedSubFiles</title>
+
+  <para><emphasis role="bold">STD.File.RemoveOwnedSubFiles<indexterm>
+      <primary>STD.File.RemoveOwnedSubFiles</primary>
+    </indexterm><indexterm>
+      <primary>File.RemoveOwnedSubFiles</primary>
+    </indexterm><indexterm>
+      <primary>RemoveOwnedSubFiles</primary>
+    </indexterm>(</emphasis> <emphasis> superfile</emphasis><emphasis
+  role="bold">)</emphasis></para>
+
+  <informaltable colsep="1" frame="all" rowsep="1">
+    <tgroup cols="2">
+      <colspec colwidth="80.50pt" />
+
+      <colspec />
+
+      <tbody>
+        <row>
+          <entry><emphasis>superfile</emphasis></entry>
+
+          <entry>A null-terminated string containing the logical name of the
+          superfile.</entry>
+        </row>
+
+        <row>
+          <entry>Return:<emphasis> </emphasis></entry>
+
+          <entry>Null.</entry>
+        </row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
+  <para>The <emphasis role="bold">RemoveOwnedSubFiles </emphasis>function
+  removes all owned sub-files from the specified superfile. These are only
+  removed if they are soley owned by the superfile. If a subfile is co-owned,
+  (i.e.,a member of any other superfile), then the removal is ignored.</para>
+
+  <para>This function may be included in a superfile transaction.</para>
+
+  <para>Example:</para>
+
+  <programlisting format="linespecific">SEQUENTIAL(
+ STD.File.StartSuperFileTransaction(),
+ STD.File.RemoveOwnedSubFiles('MySuperFile'),
+ STD.File.FinishSuperFileTransaction()
+);</programlisting>
+</sect1>

+ 3 - 0
docs/ECLStandardLibraryReference/SLR-includer.xml

@@ -137,6 +137,9 @@
     <xi:include href="ECLStandardLibraryReference/SLR-Mods/ClearSuperFile.xml"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
 
+    <xi:include href="ECLStandardLibraryReference/SLR-Mods/RemoveOwnedSubFiles.xml"
+                xmlns:xi="http://www.w3.org/2001/XInclude" />
+
     <xi:include href="ECLStandardLibraryReference/SLR-Mods/SwapSuperFile.xml"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
 

+ 2 - 2
docs/HPCCClientTools/CT_Mods/CT_ECL_CLI.xml

@@ -2315,7 +2315,7 @@ ecl packagemap validate roxie --active</programlisting>
       <sect2 role="brk">
         <title>ecl roxie detach</title>
 
-        <para><emphasis role="bold">ecl roxie attach
+        <para><emphasis role="bold">ecl roxie detach
         &lt;processName&gt;</emphasis></para>
 
         <para>Examples:</para>
@@ -2333,7 +2333,7 @@ ecl packagemap validate roxie --active</programlisting>
 
               <tbody>
                 <row>
-                  <entry>ecl roxie attach</entry>
+                  <entry>ecl roxie detach</entry>
 
                   <entry>Detach the roxie from Dali</entry>
                 </row>

+ 12 - 7
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -512,11 +512,12 @@ void WsWuInfo::getHelpers(IEspECLWorkunit &info, unsigned flags)
 
         if (cw->getWuidVersion() > 0)
         {
-            IPropertyTreeIterator& eclAgents = cw->getProcesses("EclAgent", NULL);
-            ForEach (eclAgents)
+            Owned<IPropertyTreeIterator> eclAgents = cw->getProcesses("EclAgent", NULL);
+            ForEach (*eclAgents)
             {
-                StringBuffer logName, agentPID;
-                eclAgents.query().getProp("@log",logName);
+                StringBuffer logName;
+                IPropertyTree& eclAgent = eclAgents->query();
+                eclAgent.getProp("@log",logName);
                 if (!logName.length())
                     continue;
 
@@ -530,8 +531,8 @@ void WsWuInfo::getHelpers(IEspECLWorkunit &info, unsigned flags)
                         h->setFileSize(fileSize);
                     if (version >= 1.44)
                     {
-                        if (eclAgents.query().hasProp("@pid"))
-                            h->setPID(eclAgents.query().getPropInt("@pid"));
+                        if (eclAgent.hasProp("@pid"))
+                            h->setPID(eclAgent.getPropInt("@pid"));
                         else
                             h->setPID(cw->getAgentPID());
                     }
@@ -940,7 +941,11 @@ unsigned WsWuInfo::getWorkunitThorLogInfo(IArrayOf<IEspECLHelpFile>& helpers, IE
     if (cw->getWuidVersion() > 0)
     {
         SCMStringBuffer clusterName;
-        Owned<IConstWUClusterInfo> clusterInfo = getTargetClusterInfo(cw->getClusterName(clusterName).str());
+        cw->getClusterName(clusterName);
+        if (!clusterName.length()) //Cluster name may not be set yet
+            return countThorLog;
+
+        Owned<IConstWUClusterInfo> clusterInfo = getTargetClusterInfo(clusterName.str());
         if (!clusterInfo)
         {
             SCMStringBuffer wuid;

+ 5 - 4
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -3898,15 +3898,16 @@ bool CWsWorkunitsEx::onWUDeployWorkunit(IEspContext &context, IEspWUDeployWorkun
 
 void CWsWorkunitsEx::addProcessLogfile(IZZIPor* zipper, Owned<IConstWorkUnit> &cwu, WsWuInfo &winfo, const char * process, PointerArray &mbArr)
 {
-    IPropertyTreeIterator& proc = cwu->getProcesses(process, NULL);
-    ForEach (proc)
+    Owned<IPropertyTreeIterator> procs = cwu->getProcesses(process, NULL);
+    ForEach (*procs)
     {
         StringBuffer logSpec;
-        proc.query().getProp("@log",logSpec);
+        IPropertyTree& proc = procs->query();
+        proc.getProp("@log",logSpec);
         if (!logSpec.length())
             continue;
         StringBuffer pid;
-        pid.appendf("%d",proc.query().getPropInt("@pid"));
+        pid.appendf("%d",proc.getPropInt("@pid"));
         MemoryBuffer * pMB = NULL;
         try
         {