Sfoglia il codice sorgente

HPCC-9159 Add missing plugin proxies

Fixes HPCC-9159

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 12 anni fa
parent
commit
1ad24cc8a4

+ 2 - 0
plugins/proxies/CMakeLists.txt

@@ -16,4 +16,6 @@
 
 install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_saltlib.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)
 

+ 38 - 0
plugins/proxies/lib_thorlib.ecllib

@@ -0,0 +1,38 @@
+/*##############################################################################
+
+    Copyright (C) <2011>  <HPCC Systems>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as
+    published by the Free Software Foundation, either version 3 of the
+    License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+############################################################################## */
+
+export thorlib :=
+    SERVICE
+unsigned integer4 node() : library='graph', ctxmethod, entrypoint='getNodeNum';
+varstring l2p(const varstring name, boolean create=false) : library='graph', ctxmethod, entrypoint='getFilePart';
+unsigned integer4 nodes() : library='graph', ctxmethod, entrypoint='getNodes';
+varstring wuid() : library='graph', once, ctxmethod, entrypoint='getWuid';
+unsigned integer getFileOffset(const varstring lfname) : library='graph', ctxmethod, entrypoint='getFileOffset';
+varstring daliServers() : library='graph', once, ctxmethod, entrypoint='getDaliServers';
+varstring jobname() : library='graph', once, ctxmethod, entrypoint='getJobName';
+varstring jobowner() : library='graph', once, ctxmethod, entrypoint='getJobOwner';
+varstring cluster() : library='graph', once, ctxmethod, entrypoint='getClusterName';
+unsigned integer4 priority() : library='graph', once, ctxmethod, entrypoint='getPriority';
+varstring platform() : library='graph', once, ctxmethod, entrypoint='getPlatform';
+varstring os() : library='graph', once, ctxmethod, entrypoint='getOS';
+varstring getenv(const varstring name, const varstring defaultValue) : library='graph', pure, ctxmethod, entrypoint='getEnv';
+varstring getExpandLogicalName(const varstring name) : library='graph', pure, ctxmethod, entrypoint='getExpandLogicalName';
+unsigned integer4 logString(const varstring text) : library='graph', ctxmethod, entrypoint='logString';
+varstring group() : library='graph', once, ctxmethod, entrypoint='getGroupName';
+
+    END;

+ 45 - 0
plugins/proxies/lib_word.ecllib

@@ -0,0 +1,45 @@
+/*##############################################################################
+
+    Copyright (C) <2010>  <LexisNexis Risk Data Management Inc.>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as
+    published by the Free Software Foundation, either version 3 of the
+    License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+############################################################################## */
+
+import lib_stringlib;
+
+lb(string l, string r) := length(trim(l)) > length(trim(r));
+export Lead_contains(string l, string r) := if( lb(l,r),
+                                                r=l[1..length(trim(r))],
+                                                l=r[1..length(trim(l))]);
+
+
+export Tails(string50 l, string50 r) := length(trim(l))>=length(trim(r)) and
+                    l[length(trim(l))-length(trim(r))+1..length(l)] = r;
+
+
+export StripTail(string l, string r) := if ( Tails(l,r),
+                                             l[1..length(trim(l))-length(trim(r))],
+                                             l );
+
+export string StripUptoWord(string s, integer n) := if ( lib_stringlib.stringlib.stringfind(s,' ',n)=0,
+                                                         '',
+                                                         s[lib_stringlib.stringlib.stringfind(s,' ',n)+1..length(s)]);
+
+
+sp(string s,integer1 n) := if( lib_stringlib.stringlib.stringfind(s,' ',n)=0,
+                               length(s),
+                               lib_stringlib.stringlib.stringfind(s,' ',n) );
+export string word(string s,integer1 n) := if ( n = 1,
+                                                s[1..sp(s,1)],
+                                                s[sp(s,n-1)+1..sp(s,n)]);