Selaa lähdekoodia

Merge branch 'candidate-5.2.4' into candidate-5.4.0

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 vuotta sitten
vanhempi
commit
dde353adf1

+ 7 - 3
dali/dafilesrv/dafilesrv.cpp

@@ -492,6 +492,9 @@ int main(int argc,char **argv)
             SocketEndpoint listenep;
             bool useSSL;
             bool requireauthenticate;
+            unsigned parallelRequestLimit;
+            unsigned throttleDelayMs;
+            unsigned throttleCPULimit;
 
             
             class cpollthread: public Thread
@@ -514,8 +517,9 @@ int main(int argc,char **argv)
 
         public:
 
-            cserv(SocketEndpoint _listenep, bool _useSSL)
-                : listenep(_listenep),useSSL(_useSSL),pollthread(this)
+            cserv(SocketEndpoint _listenep, bool _useSSL, unsigned _parallelRequestLimit, unsigned _throttleDelayMs, unsigned _throttleCPULimit)
+                : listenep(_listenep),useSSL(_useSSL),pollthread(this),
+                  parallelRequestLimit(_parallelRequestLimit), throttleDelayMs(_throttleDelayMs), throttleCPULimit(_throttleCPULimit)
             {
                 stopped = false;
                 started = false;
@@ -592,7 +596,7 @@ int main(int argc,char **argv)
                 PROGLOG(DAFS_SERVICE_DISPLAY_NAME " Stopped");
                 stopped = true;
             }
-        } service(listenep, useSSL);
+        } service(listenep, useSSL, parallelRequestLimit, throttleDelayMs, throttleCPULimit);
         service.start();
         return 0;
 #else

+ 62 - 0
docs/ECLLanguageReference/ECLR_mods/BltInFunc-FROMJSON.xml

@@ -0,0 +1,62 @@
+<?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="FROMJSON">
+  <title>FROMJSON</title>
+
+  <para><emphasis role="bold">FROMJSON<indexterm>
+      <primary>FROMJSON</primary>
+    </indexterm><indexterm>
+      <primary>FROMJSON function</primary>
+    </indexterm>(</emphasis><emphasis> record, jsonstring </emphasis><emphasis
+  role="bold">)</emphasis></para>
+
+  <para><informaltable colsep="1" frame="all" rowsep="1">
+      <tgroup cols="2">
+        <colspec colwidth="77.95pt" />
+
+        <tbody>
+          <row>
+            <entry><emphasis>record</emphasis></entry>
+
+            <entry>The RECORD structure to produce. Each field should specify
+            the XPATH to the data in the json<emphasis>string</emphasis> that
+            it should hold. If omitted, the lower-cased field names are
+            used.</entry>
+          </row>
+
+          <row>
+            <entry><emphasis>jsonstring</emphasis></entry>
+
+            <entry>A string containing the JSON to convert.</entry>
+          </row>
+
+          <row>
+            <entry>Return:</entry>
+
+            <entry>FROMJSON returns a single row (record).</entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </informaltable></para>
+
+  <para>The <emphasis role="bold">FROMJSON </emphasis>function returns a
+  single row (record) in the <emphasis>record</emphasis> format from the
+  specified json<emphasis>string</emphasis>. This may be used anywhere a
+  single row can be used (similar to the ROW function).</para>
+
+  <para>Example:</para>
+
+  <programlisting>namesRec := RECORD  
+  UNSIGNED2 EmployeeID{xpath('EmpID')};  
+  STRING10 Firstname{xpath('FName')};  
+  STRING10 Lastname{xpath('LName')}; 
+END; 
+x := '{"FName": "George" , "LName": "Jetson", "EmpID": 42}'; 
+rec := FROMJSON(namesRec,x); 
+OUTPUT(rec);
+</programlisting>
+
+  <para>See Also: <link linkend="ROW">ROW</link>, <link
+  linkend="TOJSON">TOJSON</link></para>
+</sect1>

+ 64 - 0
docs/ECLLanguageReference/ECLR_mods/BltInFunc-TOJSON.xml

@@ -0,0 +1,64 @@
+<?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="TOJSON">
+  <title>TOJSON</title>
+
+  <para><emphasis role="bold">TOJSON<indexterm>
+      <primary>TOJSON</primary>
+    </indexterm><indexterm>
+      <primary>TOJSON function</primary>
+    </indexterm>(</emphasis><emphasis> record </emphasis><emphasis
+  role="bold">)</emphasis></para>
+
+  <para><informaltable colsep="1" frame="all" rowsep="1">
+      <tgroup cols="2">
+        <colspec colwidth="77.95pt" />
+
+        <tbody>
+          <row>
+            <entry><emphasis>record</emphasis></entry>
+
+            <entry>The row (record) of data to convert to JSON format.</entry>
+          </row>
+
+          <row>
+            <entry>Return:</entry>
+
+            <entry>TOJSON returns a STRING.</entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </informaltable></para>
+
+  <para>The <emphasis role="bold">TOJSON </emphasis>function returns a single
+  string with the data in the <emphasis>record</emphasis> re-formatted as
+  JSON. If the RECORD structure of the <emphasis>record</emphasis> has XPATHs
+  defined, then they will be used, otherwise the lower-cased field names are
+  used as the JSON tag names.</para>
+
+  <para>Example:</para>
+
+  <programlisting>namesRec1 := RECORD  
+ UNSIGNED2 EmployeeID{xpath('EmpID')};  
+ STRING10 Firstname{xpath('FName')};  
+ STRING10 Lastname{xpath('LName')}; 
+END; 
+str1 := TOJSON(ROW({42,'Fred','Flintstone'},namesRec1)); 
+OUTPUT(str1); 
+//returns this string: 
+//'"EmpID": 42, "FName": "Fred", "LName": "Flintstone"' 
+namesRec2 := RECORD  
+  UNSIGNED2 EmployeeID;  
+  STRING10 Firstname;  
+  STRING10 Lastname; 
+END; 
+str2 := TOJSON(ROW({42,'Fred','Flintstone'},namesRec2)); 
+OUTPUT(str2); 
+//returns this string: 
+//'"employeeid": 42, "firstname": "Fred", "lastname": "Flintstone"'
+</programlisting>
+
+  <para>See Also: <link linkend="ROW">ROW</link>, <link
+  linkend="FROMJSON">FROMJSON</link></para>
+</sect1>