Browse Source

Merge branch 'candidate-6.4.10'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 years ago
parent
commit
5ab6f5064a

+ 1 - 0
docs/BuildTools/fo.xsl.in

@@ -136,6 +136,7 @@
   </fo:block>
 </xsl:template>
 
+
 <!--para-syntax-role-elim-hyph-17-->
 <xsl:template match="para[@role='syntax']">
   <fo:block>

+ 130 - 61
docs/EN_US/ConfiguringHPCC/ConfiguringHPCC.xml

@@ -2330,8 +2330,7 @@ sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/envi
         <sect3 id="ThorClusterAttributesTab">
           <title>ThorCluster Attributes</title>
 
-          <para>This section describes the Thor Cluster Attributes tab.
-          </para>
+          <para>This section describes the Thor Cluster Attributes tab.</para>
 
           <para>
             <graphic fileref="images/CM-img18-1.jpg" vendor="configmgrSS" />
@@ -2534,6 +2533,16 @@ sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/envi
             command window where it is running.</para>
           </listitem>
         </orderedlist>
+
+        <sect3>
+          <title>Roxie Configuration Attributes</title>
+
+          <para>Roxie has many configurable attributes which can be used to
+          for customizing and tuning to your specific needs. The following
+          section expands on each of the Roxie tabs and the available
+          attributes. There is additional Roxie configuration information in
+          the section immediately following these tables.</para>
+        </sect3>
       </sect2>
 
       <!--configMgr-ROXIE-Include-SEC4-->
@@ -2544,6 +2553,66 @@ sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/envi
                   xpointer="element(/1)"
                   xmlns:xi="http://www.w3.org/2001/XInclude" />
 
+      <sect2>
+        <title />
+
+        <sect3>
+          <title>Additional Roxie Configuration items</title>
+
+          <para>
+            <emphasis role="bold">Add Servers to Roxie Farm</emphasis>
+          </para>
+
+          <para>To add servers to a Roxie farm</para>
+
+          <para><orderedlist>
+              <listitem>
+                <para>Select the <emphasis role="bold">Roxie Cluster -
+                myroxie</emphasis> (default) from the Navigator window on the
+                left side.</para>
+              </listitem>
+
+              <listitem>
+                <para>Select the <emphasis role="bold">Servers</emphasis>
+                tab.</para>
+              </listitem>
+
+              <listitem>
+                <para>Right-click on <emphasis role="bold">Roxie
+                Servers</emphasis>.</para>
+              </listitem>
+
+              <listitem>
+                <para>Select <emphasis role="bold">Reconfigure
+                Servers</emphasis>.</para>
+              </listitem>
+
+              <listitem>
+                <para>Press the <emphasis role="bold">Add Hardware</emphasis>
+                button.</para>
+              </listitem>
+
+              <listitem>
+                <para>Enter the values for the new server(s) in the dialog
+                then press OK.</para>
+              </listitem>
+            </orderedlist>All configured servers are then used when you create
+          a port to listen on. </para>
+
+          <variablelist>
+            <varlistentry>
+              <term>NOTE</term>
+
+              <listitem>
+                <para>If working with an older environment file this process
+                has changed. You no longer have to specify for a server to use
+                a specific port.</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+        </sect3>
+      </sect2>
+
       <sect2 id="Topology" role="brk">
         <title>Topology</title>
 
@@ -2600,86 +2669,86 @@ sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/envi
             </tgroup>
           </informaltable>
         </para>
-      </sect2>
 
-      <sect2 id="Propogate-configuration-changes" role="brk">
-        <title>Distribute Configuration Changes to all Nodes</title>
+        <sect3 id="Propogate-configuration-changes" role="brk">
+          <title>Distribute Configuration Changes to all Nodes</title>
 
-        <para>Once your environment is set up as desired, you must copy the
-        configuration file to the other nodes.</para>
+          <para>Once your environment is set up as desired, you must copy the
+          configuration file to the other nodes.</para>
 
-        <para />
+          <para />
 
-        <orderedlist>
-          <listitem>
-            <para>If it is running, stop the system</para>
+          <orderedlist>
+            <listitem>
+              <para>If it is running, stop the system</para>
 
-            <para>
-              <informaltable colsep="1" frame="all" rowsep="1">
-                <?dbfo keep-together="always"?>
+              <para>
+                <informaltable colsep="1" frame="all" rowsep="1">
+                  <?dbfo keep-together="always"?>
 
-                <tgroup cols="2">
-                  <colspec colwidth="49.50pt" />
+                  <tgroup cols="2">
+                    <colspec colwidth="49.50pt" />
 
-                  <colspec />
+                    <colspec />
 
-                  <tbody>
-                    <row>
-                      <entry>
-                        <inlinegraphic fileref="images/caution.png" />
-                      </entry>
+                    <tbody>
+                      <row>
+                        <entry>
+                          <inlinegraphic fileref="images/caution.png" />
+                        </entry>
 
-                      <entry>Be sure system is stopped before attempting to
-                      copy the Environment.xml file.</entry>
-                    </row>
-                  </tbody>
-                </tgroup>
-              </informaltable>
-            </para>
-          </listitem>
+                        <entry>Be sure system is stopped before attempting to
+                        copy the Environment.xml file.</entry>
+                      </row>
+                    </tbody>
+                  </tgroup>
+                </informaltable>
+              </para>
+            </listitem>
 
-          <listitem>
-            <para>Back up the original environment.xml file</para>
+            <listitem>
+              <para>Back up the original environment.xml file</para>
 
-            <programlisting># for example
+              <programlisting># for example
 sudo -u hpcc cp /etc/HPCCSystems/environment.xml /etc/HPCCSystems/environment.bak </programlisting>
 
-            <para>Note: the "live environment.xml file is located in your
-            <emphasis role="bold">/etc/HPCCSystems/</emphasis> directory.
-            ConfigManager works on files in <emphasis
-            role="bold">/etc/HPCCSystems/source</emphasis> directory. You must
-            copy from this location to make an environment.xml file
-            active.</para>
-          </listitem>
+              <para>Note: the "live environment.xml file is located in your
+              <emphasis role="bold">/etc/HPCCSystems/</emphasis> directory.
+              ConfigManager works on files in <emphasis
+              role="bold">/etc/HPCCSystems/source</emphasis> directory. You
+              must copy from this location to make an environment.xml file
+              active.</para>
+            </listitem>
 
-          <listitem>
-            <para>Copy the NewEnvironment.xml file from the source directory
-            to the /etc/HPCCSystems and rename the file to
-            environment.xml</para>
+            <listitem>
+              <para>Copy the NewEnvironment.xml file from the source directory
+              to the /etc/HPCCSystems and rename the file to
+              environment.xml</para>
 
-            <programlisting># for example
+              <programlisting># for example
 sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/environment.xml</programlisting>
 
-            <para />
-          </listitem>
+              <para />
+            </listitem>
 
-          <listitem>
-            <para>Copy the /etc/HPCCSystems/environment.xml to the
-            /etc/HPCCSystems/ on every node.</para>
+            <listitem>
+              <para>Copy the /etc/HPCCSystems/environment.xml to the
+              /etc/HPCCSystems/ on every node.</para>
 
-            <para />
-          </listitem>
+              <para />
+            </listitem>
 
-          <listitem>
-            <para>Restart the HPCC system</para>
+            <listitem>
+              <para>Restart the HPCC system</para>
 
-            <para>You might prefer to script this process, especially if you
-            have many nodes. See the Example Scripts section in the Appendix
-            of the Installing_and_RunningtheHPCCPlatform document. You can use
-            the scripts as a model to create your own script to copy the
-            environment.xml file out to all your nodes.</para>
-          </listitem>
-        </orderedlist>
+              <para>You might prefer to script this process, especially if you
+              have many nodes. See the Example Scripts section in the Appendix
+              of the Installing_and_RunningtheHPCCPlatform document. You can
+              use the scripts as a model to create your own script to copy the
+              environment.xml file out to all your nodes.</para>
+            </listitem>
+          </orderedlist>
+        </sect3>
       </sect2>
     </sect1>
   </chapter>

+ 1 - 1
docs/EN_US/ECLLanguageReference/ECLR-includer.xml

@@ -45,7 +45,7 @@
                 xpointer="xpointer(//*[@id='DateVer'])"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
 
-    <releaseinfo>© 2017 HPCC Systems<superscript>®</superscript>. All rights
+    <releaseinfo>© 2018 HPCC Systems<superscript>®</superscript>. All rights
     reserved. Except where otherwise noted, ECL Language Reference content
     licensed under Creative Commons public license.</releaseinfo>
 

+ 3 - 2
docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-APPLY.xml

@@ -4,8 +4,9 @@
 <sect1 id="APPLY">
   <title>APPLY</title>
 
-  <para><emphasis role="bold">[</emphasis><emphasis>attrname</emphasis>
-  :=<emphasis role="bold"> ] APPLY<indexterm>
+  <para role="syntax"><emphasis
+  role="bold">[</emphasis><emphasis>attrname</emphasis> :=<emphasis
+  role="bold"> ] APPLY<indexterm>
       <primary>APPLY</primary>
     </indexterm><indexterm>
       <primary>APPLY function</primary>

+ 2 - 2
docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-ASCII.xml

@@ -4,7 +4,7 @@
 <sect1 id="ASCII">
   <title>ASCII</title>
 
-  <para><emphasis role="bold">ASCII<indexterm>
+  <para role="syntax"><emphasis role="bold">ASCII<indexterm>
       <primary>ASCII</primary>
     </indexterm><indexterm>
       <primary>ASCII function</primary>
@@ -16,7 +16,7 @@
       <tgroup cols="2">
         <colspec colwidth="78.75pt" />
 
-        <colspec colwidth="310.05pt" />
+        <colspec />
 
         <tbody>
           <row>

+ 2 - 2
docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-ASIN.xml

@@ -4,7 +4,7 @@
 <sect1 id="ASIN">
   <title>ASIN</title>
 
-  <para><emphasis role="bold">ASIN<indexterm>
+  <para role="syntax"><emphasis role="bold">ASIN<indexterm>
       <primary>ASIN</primary>
     </indexterm><indexterm>
       <primary>ASIN function</primary>
@@ -15,7 +15,7 @@
       <tgroup cols="2">
         <colspec colwidth="79.65pt" />
 
-        <colspec colwidth="309.15pt" />
+        <colspec />
 
         <tbody>
           <row>

+ 3 - 1
docs/EN_US/ECLLanguageReference/ECLR_mods/Templ-GETDATATYPE.xml

@@ -27,7 +27,9 @@
     </informaltable></para>
 
   <para>The <emphasis role="bold">#GETDATATYPE </emphasis>function returns the
-  value type of the <emphasis>field</emphasis>.</para>
+  value type of the <emphasis>field</emphasis>. The <emphasis>field</emphasis>
+  argument must be a scalar value or a field from a dataset (rather than a
+  field from a record definition.)</para>
 
   <para>Example:</para>
 

+ 10 - 9
docs/EN_US/HPCCClientTools/CT_Mods/CT_ECL_IDE.xml

@@ -2336,8 +2336,7 @@
                 </row>
 
                 <row>
-                  <entry><emphasis role="bold">Insert
-                  Attribute</emphasis></entry>
+                  <entry><emphasis role="bold">Insert File</emphasis></entry>
 
                   <entry>Adds a new ECL file inside the selected
                   folder.</entry>
@@ -2345,14 +2344,14 @@
 
                 <row>
                   <entry><emphasis role="bold"><emphasis role="bold">Rename
-                  Attribute</emphasis></emphasis></entry>
+                  File</emphasis></emphasis></entry>
 
                   <entry>Renames the selected ECL file</entry>
                 </row>
 
                 <row>
                   <entry><emphasis role="bold"><emphasis role="bold">Copy
-                  Attribute</emphasis></emphasis></entry>
+                  File</emphasis></emphasis></entry>
 
                   <entry>Enables you to copy the selected ECL file so it can
                   be pasted into a different folder.</entry>
@@ -2360,7 +2359,7 @@
 
                 <row>
                   <entry><emphasis role="bold"><emphasis role="bold">Move
-                  Attribute</emphasis></emphasis></entry>
+                  File</emphasis></emphasis></entry>
 
                   <entry>Moves the selected ECL file to specified
                   folder</entry>
@@ -2368,10 +2367,12 @@
 
                 <row>
                   <entry><emphasis role="bold"><emphasis role="bold">Delete
-                  Attribute</emphasis></emphasis></entry>
+                  File</emphasis></emphasis></entry>
 
                   <entry>Moves the selected ECL file to the Trash folder on
-                  your desktop</entry>
+                  your desktop. You can also press the <emphasis
+                  role="bold">Delete</emphasis> key to access this
+                  functionality. </entry>
                 </row>
 
                 <row>
@@ -3472,7 +3473,7 @@ ENDMACRO;
       </sect2>
 
       <sect2 id="Graph_Viewer" role="brk">
-        <title>Graph Viewer </title>
+        <title>Graph Viewer</title>
 
         <para>A workunit’s execution graph is displayed in the Graph
         Tab.</para>
@@ -3506,7 +3507,7 @@ ENDMACRO;
       </sect2>
 
       <sect2 id="ECLWatch_View" role="brk">
-        <title>ECL Watch View </title>
+        <title>ECL Watch View</title>
 
         <para>A workunit’s Workunit Details page view is displayed in the ECL
         Watch Tab.</para>

+ 93 - 0
docs/EN_US/HPCCSystemAdmin/HPCCSystemAdministratorsGuide.xml

@@ -1665,6 +1665,99 @@ dfsSSLPrivateKeyFile=/keyfilepath/keyfile</programlisting>Set the <emphasis
         the Thors. This needs to be configured per Thor cluster
         definition.</para>
 
+        <para>Multiple Thors on the same cluster require them to share the
+        same build and installation. The environment defines each Thor
+        cluster, which can share the same machine set. There are slave and
+        master port settings that need to be set to avoid clashing. There are
+        also memory sharing/splitting considerations and settings that need to
+        be made. The table below indicates settings in the environment to
+        consider.</para>
+
+        <para><informaltable border="all" colsep="1" rowsep="1">
+            <tgroup cols="2">
+              <colspec colwidth="94.50pt" />
+
+              <tbody>
+                <row>
+                  <entry><emphasis role="bold">Setting</emphasis></entry>
+
+                  <entry><emphasis role="bold">Description</emphasis></entry>
+                </row>
+
+                <row>
+                  <entry><emphasis
+                  role="bold">globalMemorySize</emphasis></entry>
+
+                  <entry>The maximum memory a slave process can use. Typically
+                  85 percent of the memory on the system divided by the total
+                  number of slaves running on the hardware across all
+                  Thors.</entry>
+                </row>
+
+                <row>
+                  <entry><emphasis
+                  role="bold">localThorPortInc</emphasis></entry>
+
+                  <entry>This value is the increment from the base slave
+                  port.</entry>
+                </row>
+
+                <row>
+                  <entry><emphasis
+                  role="bold">masterMemorySize</emphasis></entry>
+
+                  <entry>The maximum memory a Thor master can use. If left
+                  blank it will use the <emphasis>globalMemorySize</emphasis>
+                  value.</entry>
+                </row>
+
+                <row>
+                  <entry><emphasis role="bold">masterport</emphasis></entry>
+
+                  <entry>This value must be unique between Thor instances
+                  running on the same hardware.</entry>
+                </row>
+
+                <row>
+                  <entry><emphasis role="bold">name</emphasis></entry>
+
+                  <entry>The name of each Thor instance must be
+                  unique.</entry>
+                </row>
+
+                <row>
+                  <entry><emphasis role="bold">nodeGroup</emphasis></entry>
+
+                  <entry>This value is associated with files published by this
+                  Thor instance. Normally it is left blank and defaults to the
+                  same as the <emphasis>name</emphasis> attribute. In
+                  environments with multiple Thors sharing the same group of
+                  nodes, the <emphasis>name</emphasis> value of each Thor must
+                  be different. However, the <emphasis>nodeGroup</emphasis>
+                  value of all the Thors sharing the same physical nodes
+                  should be set to the same name. It is very important to make
+                  the <emphasis>nodeGroup</emphasis> value equal to one of the
+                  Thor instance name values.</entry>
+                </row>
+
+                <row>
+                  <entry><emphasis role="bold">slaveport</emphasis></entry>
+
+                  <entry>This value must be unique between Thor instances
+                  running on the same hardware.</entry>
+                </row>
+
+                <row>
+                  <entry><emphasis
+                  role="bold">SlavesPerNode</emphasis></entry>
+
+                  <entry>The number of slaves per node per Thor
+                  instance.</entry>
+                </row>
+              </tbody>
+            </tgroup>
+          </informaltable></para>
+
         <para>You must not place multiple Thors on hardware which does not
         have enough CPU cores to support it. You should not have more Thors
         than number of cores. One good rule is to use a formula where the

+ 0 - 59
docs/EN_US/RunningHPCCinaVirtualMachine/RunningHPCCinaVirtualMachine.xml

@@ -231,65 +231,6 @@
           <listitem>
             <para>Start the VM VirtualBox application.</para>
           </listitem>
-
-          <listitem>
-            <para>From the <emphasis role="bold">File</emphasis> menu, select
-            <emphasis role="bold">Preferences</emphasis>...</para>
-
-            <para>The <emphasis>VirtualBox - Settings</emphasis> dialog
-            displays.<figure id="VBoxSettings">
-                <title xreflabel="welc">VirtualBox - Settings</title>
-
-                <mediaobject>
-                  <imageobject>
-                    <imagedata fileref="images/vmimg14.jpg" />
-                  </imageobject>
-                </mediaobject>
-              </figure></para>
-          </listitem>
-
-          <listitem>
-            <para>Select<emphasis role="bold"> Network</emphasis> from the
-            list on the left side of the window.</para>
-          </listitem>
-
-          <listitem>
-            <para>Double-click on the <emphasis>VirtualBox Host-Only Ethernet
-            Adaptor</emphasis>.</para>
-          </listitem>
-
-          <listitem>
-            <para>From the<emphasis> Network Details</emphasis> window, select
-            the <emphasis role="bold">DHCP Server</emphasis> Tab and check the
-            <emphasis role="bold">Enable Server</emphasis> box. <figure
-                id="NetworkDetails">
-                <title xreflabel="welc">Network Details</title>
-
-                <mediaobject>
-                  <imageobject>
-                    <imagedata fileref="images/vmimg15.jpg" />
-                  </imageobject>
-                </mediaobject>
-              </figure><variablelist>
-                <varlistentry>
-                  <term>Note:</term>
-
-                  <listitem>
-                    <para>You may need to add IP Address values to the Lower
-                    Address Bound and Upper Address Bound fields. The address
-                    the VM uses is in the private IP address range of
-                    192.168.x.x</para>
-                  </listitem>
-                </varlistentry>
-              </variablelist></para>
-          </listitem>
-
-          <listitem>
-            <para>Press the <emphasis role="bold">OK</emphasis> button on the
-            <emphasis>Network Details</emphasis> dialog box, then press the
-            <emphasis role="bold">OK</emphasis> button on the
-            <emphasis>VirtualBox - Settings</emphasis> box.</para>
-          </listitem>
         </orderedlist>
       </sect2>
 

BIN
docs/EN_US/images/vmimg14.jpg


BIN
docs/EN_US/images/vmimg15.jpg


+ 1 - 1
docs/common/Version.xml

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
 <chapter>

+ 0 - 3
ecl/eclcc/eclcc.cpp

@@ -1192,9 +1192,6 @@ void EclCC::processSingleQuery(EclCompileInstance & instance,
             else
             {
                 Owned<IHqlScope> scope = createPrivateScope();
-                if (instance.legacyImport)
-                    importRootModulesToScope(scope, ctx);
-
                 instance.query.setown(parseQuery(scope, queryContents, ctx, NULL, NULL, true, true));
 
                 if (instance.archive)

+ 2 - 0
ecl/hql/hqlgram.hpp

@@ -734,6 +734,7 @@ public:
     IHqlExpression* clearFieldMap(IHqlExpression* expr);
     void setExpectedAttribute(IIdAtom * _expectedAttribute)             { expectedAttribute = _expectedAttribute; current_id = _expectedAttribute; }
     void setCurrentToExpected()             { current_id = expectedAttribute; }
+    void setPendingGlobalImport(bool _globalImportPending) { globalImportPending = _globalImportPending; }
     IHqlScope * queryPrimaryScope(bool isPrivate);
     unsigned nextParameterIndex()               { return 0; } // not commoned up at moment{ return activeParameters.length()+savedParameters.length(); }
     void addActiveParameterOwn(const attribute & errpos, IHqlExpression * expr, IHqlExpression * defaultValue);
@@ -904,6 +905,7 @@ protected:
     bool parseConstantText;
     bool expandingMacroPosition;
     bool inSignedModule;
+    bool globalImportPending = false;
     OwnedHqlExpr gpgSignature;
 
     IErrorArray pendingWarnings;

+ 11 - 1
ecl/hql/hqlgram2.cpp

@@ -3525,6 +3525,13 @@ IHqlExpression *HqlGram::lookupSymbol(IIdAtom * searchName, const attribute& err
     if (expectedUnknownId)
         return NULL;
 
+    if (globalImportPending)
+    {
+        if (lexObject->hasLegacyImportSemantics())
+            importRootModulesToScope(globalScope, lookupCtx);
+        globalImportPending = false;
+    }
+
     //Check periodically if parsing a referenced identifier has caused the compile to abort.
     checkAborting();//NOTE: checkAborting() checks whether the parseContext is aborting and implicitly propagates this state, thus consistently triggering the parser to abort.
 
@@ -10599,7 +10606,7 @@ IHqlExpression * HqlGram::resolveImportModule(const attribute & errpos, IHqlExpr
     const char * parentName = str(parent->queryId());
     if (name == _container_Atom)
     {
-        const char * containerName = str(parent->queryFullContainerId());
+        const char * containerName = str(parent->queryBody()->queryFullContainerId());
         //This is a bit ugly - remove the last qualified module, and resolve the name again.  A more "correct" method
         //saving container pointers hit problems because remote scopes within CHqlMergedScope containers have a remote
         //scope as the parent, rather than the merged scope...
@@ -12089,6 +12096,9 @@ extern HQL_API IHqlExpression * parseQuery(IHqlScope *scope, IFileContents * con
             ctx.noteBeginQuery(scope, contents);
 
         HqlGram parser(scope, scope, contents, ctx, xmlScope, false, loadImplicit);
+        if (isRoot)
+            parser.setPendingGlobalImport(true);
+
         parser.setQuery(true);
         parser.getLexer()->set_yyLineNo(1);
         parser.getLexer()->set_yyColumn(1);

+ 0 - 2
ecl/hql/hqlutil.cpp

@@ -9287,8 +9287,6 @@ IHqlExpression * expandMacroDefinition(IHqlExpression * expr, HqlLookupContext &
     //with implicitly importing myModule.
     Owned<IFileContents> mappedContents = createFileContentsFromText(macroText.length(), macroText.str(), macroContents->querySourcePath(), false, NULL);
     Owned<IHqlScope> scope = createPrivateScope();
-    if (queryLegacyImportSemantics())
-        importRootModulesToScope(scope, ctx);
     return parseQuery(scope, mappedContents, ctx, NULL, macroParms, true, true);
 }
 

+ 19 - 0
ecl/regress/issue18657.eclxml

@@ -0,0 +1,19 @@
+<Archive build="internal_6.4.8-rc1Debug"
+         eclVersion="6.4.8"
+         legacyImport="0"
+         legacyWhen="0">
+ <Query attributePath="TestX.Fred.Sue.Jo.BWR_Test"/>
+ <Module key="testx" name="TestX"/>
+ <Module key="testx.fred" name="TestX.Fred">
+  <Attribute key="testme" name="TestMe" sourcePath="/home/gavin/dev/issue18657/./TestX/Fred/TestMe.ecl">
+   export TestMe := 10;&#10;&#10;
+  </Attribute>
+ </Module>
+ <Module key="testx.fred.sue" name="TestX.Fred.Sue"/>
+ <Module key="testx.fred.sue.jo" name="TestX.Fred.Sue.Jo">
+  <Attribute key="bwr_test" name="BWR_Test" sourcePath="TestX/Fred/Sue/Jo/BWR_Test.ecl">
+   IMPORT $.^.^ AS M1;
+OUTPUT(M1.TestMe);&#10;
+  </Attribute>
+ </Module>
+</Archive>

+ 38 - 0
ecl/regress/legacy3.eclxml

@@ -0,0 +1,38 @@
+<Archive legacyMode="true">
+<!--
+
+    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+ <Module name="common">
+  <Attribute name="m1">
+output('hello');
+export m1 := m2+10;
+  </Attribute>
+ </Module>
+ <Module name="other">
+  <Attribute name="m1">
+output('hello');
+export m1 := m2+10;
+  </Attribute>
+ </Module>
+ <Query>
+ //#import(modern);
+ shared common := 3;
+ rec := RECORD
+    other := 3;
+ END;
+ output(common);
+ </Query>
+</Archive>

+ 35 - 0
ecl/regress/legacy4.eclxml

@@ -0,0 +1,35 @@
+<Archive legacyMode="false">
+<!--
+
+    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+ <Module name="common">
+  <Attribute name="m1">
+  //#when(legacy);
+output('hello');
+export m1 := 10;
+  </Attribute>
+ </Module>
+ <Module name="other">
+  <Attribute name="m1">
+output('hello');
+export m1 := m2+10;
+  </Attribute>
+ </Module>
+ <Query>
+ //#import(legacy);
+ output(common.m1);
+ </Query>
+</Archive>

+ 35 - 0
ecl/regress/legacy5.eclxml

@@ -0,0 +1,35 @@
+<Archive legacyMode="true">
+<!--
+
+    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+ <Module name="common">
+  <Attribute name="m1">
+export m1 := 'bad';
+  </Attribute>
+ </Module>
+ <Module name="xx.common">
+  <Attribute name="m1">
+export m1 := 'good';
+  </Attribute>
+ </Module>
+ <Query>
+ //check that the import has precedence over the implicit global import
+ //Although actually there is a long standing problem- that the explicit import appears to be ignored!
+ //So ensure it is consistent with previous versions
+ import xx.common as common;
+ output(common.m1);
+ </Query>
+</Archive>

+ 1 - 0
plugins/proxies/CMakeLists.txt

@@ -15,6 +15,7 @@
 ################################################################################
 
 install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_saltlib.ecllib DESTINATION plugins COMPONENT Runtime)
+install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_keylib.ecllib DESTINATION plugins COMPONENT Runtime)
 install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_metaphone.ecllib DESTINATION plugins COMPONENT Runtime)
 install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_thorlib.ecllib DESTINATION plugins COMPONENT Runtime)
 install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_word.ecllib DESTINATION plugins COMPONENT Runtime)

+ 28 - 0
plugins/proxies/lib_keylib.ecllib

@@ -0,0 +1,28 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2017 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+/* Proxy service header for (EE-only) keylib plugin version MOXIEKEYLIB 1.0.04 */
+
+EXPORT KeyLib := SERVICE : plugin('moxiekeylib')
+  string KeylibStripPunctuation(const string src) : c,pure,entrypoint='mklStripPunctuation';
+  string CompName(const string src) : c,pure,entrypoint='mklCompName';
+  string CompNameNoSyn(const string src) : c,pure,entrypoint='mklCompNameNoSyn';
+  string GongDACname(const string src) : c,pure,entrypoint='mklGongDACname';
+  string GongDAPHCname(const string src) : c,pure,entrypoint='mklGongDAPHCname';
+  string GongCompName(const string src) : c,pure,entrypoint='mklGongCompName';
+END;
+

+ 20 - 29
thorlcr/activities/firstn/thfirstnslave.cpp

@@ -30,8 +30,8 @@ class CFirstNSlaveBase : public CSlaveActivity
     typedef CSlaveActivity PARENT;
 
 protected:
-    rowcount_t limit, skipCount;
-    bool stopped;
+    rowcount_t limit = RCUNBOUND, skipCount = 0;
+    bool stopped = true;
     IHThorFirstNArg *helper;
 
 public:
@@ -74,8 +74,8 @@ class CFirstNSlaveLocal : public CFirstNSlaveBase
 {
     typedef CFirstNSlaveBase PARENT;
 
-    bool firstget;
-    rowcount_t skipped;
+    bool firstget = true;
+    rowcount_t skipped = 0;
 public:
     CFirstNSlaveLocal(CGraphElementBase *_container) : CFirstNSlaveBase(_container)
     {
@@ -130,7 +130,7 @@ class CFirstNSlaveGrouped : public CFirstNSlaveBase
 {
     typedef CFirstNSlaveBase PARENT;
 
-    unsigned countThisGroup;
+    unsigned countThisGroup = 0;
 public:
     CFirstNSlaveGrouped(CGraphElementBase *_container) : CFirstNSlaveBase(_container)
     {
@@ -212,21 +212,25 @@ class CFirstNSlaveGlobal : public CFirstNSlaveBase, implements ILookAheadStopNot
 
     Semaphore limitgot;
     CriticalSection crit;
-    rowcount_t maxres, skipped, totallimit;
-    bool firstget;
+    rowcount_t maxres = RCUNBOUND, skipped = 0, totallimit = RCUNBOUND;
+    bool firstget = true;
     ThorDataLinkMetaInfo inputMeta;
     Owned<IEngineRowStream> originalInputStream;
 
-    void ensureSendCount()
+    void sendOnce(rowcount_t count)
     {
-        if (isFastThrough(input)) // i.e. no readahead
         {
-            if (RCUNBOUND == maxres)
-            {
-                maxres = getDataLinkCount() + skipped;
-                sendCount();
-            }
+            CriticalBlock b(crit);
+            if (RCUNBOUND != maxres) // already set and sent
+                return;
+            maxres = count;
         }
+        sendCount();
+    }
+    void ensureSendCount()
+    {
+        if (hasStarted() && isFastThrough(input)) // i.e. if fast through there is no readahead
+            sendOnce(getDataLinkCount() + skipped);
     }
     void doStopInput()
     {
@@ -294,14 +298,7 @@ public:
             if (limit+skipCount<r)
                 r = limit+skipCount;
             // sneaky short circuit
-            {
-                CriticalBlock b(crit);
-                if (RCUNBOUND == maxres)
-                {
-                    maxres = r;
-                    sendCount();
-                }
-            }
+            sendOnce(r);
         }
         ActPrintLog("FIRSTN: Record limit is %" RCPF "d %" RCPF "d", limit, skipCount); 
         return true;
@@ -384,13 +381,7 @@ public:
 // ILookAheadStopNotify
     virtual void onInputFinished(rowcount_t count) override // count is the total read from input (including skipped)
     {
-        // sneaky short circuit
-        {
-            CriticalBlock b(crit);
-            if (RCUNBOUND != maxres) return;
-            maxres = count;
-            sendCount();
-        }
+        sendOnce(count);
         ActPrintLog("FIRSTN: maximum row count %" RCPF "d", count);
     }
 };

+ 5 - 1
thorlcr/activities/parse/thparseslave.cpp

@@ -65,7 +65,11 @@ public:
     {
         ActivityTimer s(totalCycles, timeActivities);
         PARENT::start();
-        rowIter->first();
+    }
+    virtual void stop() override
+    {
+        parser->reset();
+        PARENT::stop();
     }
     void processRecord(const void * in)
     {