Changeset: 3d6bbfd5d011 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3d6bbfd5d011
Removed Files:
        monetdb5/mal/mal_sabaoth.c
        monetdb5/mal/mal_sabaoth.h
        monetdb5/modules/mal/sabaoth.c
        monetdb5/modules/mal/sabaoth.h
        monetdb5/modules/mal/sabaoth.mal
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        common/utils/msabaoth.c
        common/utils/msabaoth.h
        monetdb5/mal/Makefile.ag
        monetdb5/mal/mal.c
        monetdb5/mal/mal_session.c
        monetdb5/modules/mal/Makefile.ag
        monetdb5/modules/mal/mal_init.mal
Branch: default
Log Message:

Cleanup: removed unused sabaoth stuff.


diffs (truncated from 607 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -11621,14 +11621,6 @@ stdout of test 'MAL-signatures` in direc
 [ "remote",    "register",     "pattern remote.register(conn:str, mod:str, 
fcn:str):void ",    "RMTregister;", "register <mod>.<fcn> at the remote site"   
    ]
 [ "remote",    "register_supervisor",  "command 
remote.register_supervisor(sup_uuid:str, query_uuid:str):int ",        
"RMTregisterSupervisor;",       "Register the supervisor uuid at a remote site" 
]
 [ "remote",    "resolve",      "command remote.resolve(pattern:str):bat[:str] 
",       "RMTresolve;",  "resolve a pattern against Merovingian and return the 
URIs"     ]
-[ "sabaoth",   "epilogue",     "command sabaoth.epilogue():void ",     
"SABepilogue;", "Release the resources held by the sabaoth module"      ]
-[ "sabaoth",   "getLocalConnectionHost",       "command 
sabaoth.getLocalConnectionHost():str ",        "SABgetLocalConnectionHost;",   
"Returns the hostname this server can be connected to, or nil if none"  ]
-[ "sabaoth",   "getLocalConnectionPort",       "command 
sabaoth.getLocalConnectionPort():int ",        "SABgetLocalConnectionPort;",   
"Returns the port this server can be connected to, or 0 if none"        ]
-[ "sabaoth",   "getLocalConnectionURI",        "command 
sabaoth.getLocalConnectionURI():str ", "SABgetLocalConnectionURI;",    "Returns 
the URI this server can be connected to, or nil if none"       ]
-[ "sabaoth",   "marchConnection",      "command 
sabaoth.marchConnection(host:str, port:int):void ",    "SABmarchConnection;",  
"Publishes the given host/port as available for connecting to this server"      
]
-[ "sabaoth",   "marchScenario",        "command 
sabaoth.marchScenario(lang:str):void ",        "SABmarchScenario;",    
"Publishes the given language as available for this server"     ]
-[ "sabaoth",   "prelude",      "command sabaoth.prelude():void ",      
"SABprelude;",  "Initialise the sabaoth module" ]
-[ "sabaoth",   "retreatScenario",      "command 
sabaoth.retreatScenario(lang:str):void ",      "SABretreatScenario;",  
"Unpublishes the given language as available for this server"   ]
 [ "sample",    "subuniform",   "pattern sample.subuniform(b:bat[:any], 
p:dbl):bat[:oid] ",     "SAMPLEuniform;",       "Returns the oids of a uniform 
sample of size = (p x count(b)), where 0 <= p <= 1.0"    ]
 [ "sample",    "subuniform",   "pattern sample.subuniform(b:bat[:any], p:dbl, 
sample_seed:int):bat[:oid] ",    "SAMPLEuniform;",       "Returns the oids of a 
uniform sample of size = (p x count(b)), where 0 <= p <= 1.0 and where the prg 
is seeded with sample_seed"       ]
 [ "sample",    "subuniform",   "pattern sample.subuniform(b:bat[:any], 
sample_size:lng):bat[:oid] ",   "SAMPLEuniform;",       "Returns the oids of a 
uniform sample of size s"        ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -16033,14 +16033,6 @@ stdout of test 'MAL-signatures` in direc
 [ "remote",    "register",     "pattern remote.register(conn:str, mod:str, 
fcn:str):void ",    "RMTregister;", "register <mod>.<fcn> at the remote site"   
    ]
 [ "remote",    "register_supervisor",  "command 
remote.register_supervisor(sup_uuid:str, query_uuid:str):int ",        
"RMTregisterSupervisor;",       "Register the supervisor uuid at a remote site" 
]
 [ "remote",    "resolve",      "command remote.resolve(pattern:str):bat[:str] 
",       "RMTresolve;",  "resolve a pattern against Merovingian and return the 
URIs"     ]
-[ "sabaoth",   "epilogue",     "command sabaoth.epilogue():void ",     
"SABepilogue;", "Release the resources held by the sabaoth module"      ]
-[ "sabaoth",   "getLocalConnectionHost",       "command 
sabaoth.getLocalConnectionHost():str ",        "SABgetLocalConnectionHost;",   
"Returns the hostname this server can be connected to, or nil if none"  ]
-[ "sabaoth",   "getLocalConnectionPort",       "command 
sabaoth.getLocalConnectionPort():int ",        "SABgetLocalConnectionPort;",   
"Returns the port this server can be connected to, or 0 if none"        ]
-[ "sabaoth",   "getLocalConnectionURI",        "command 
sabaoth.getLocalConnectionURI():str ", "SABgetLocalConnectionURI;",    "Returns 
the URI this server can be connected to, or nil if none"       ]
-[ "sabaoth",   "marchConnection",      "command 
sabaoth.marchConnection(host:str, port:int):void ",    "SABmarchConnection;",  
"Publishes the given host/port as available for connecting to this server"      
]
-[ "sabaoth",   "marchScenario",        "command 
sabaoth.marchScenario(lang:str):void ",        "SABmarchScenario;",    
"Publishes the given language as available for this server"     ]
-[ "sabaoth",   "prelude",      "command sabaoth.prelude():void ",      
"SABprelude;",  "Initialise the sabaoth module" ]
-[ "sabaoth",   "retreatScenario",      "command 
sabaoth.retreatScenario(lang:str):void ",      "SABretreatScenario;",  
"Unpublishes the given language as available for this server"   ]
 [ "sample",    "subuniform",   "pattern sample.subuniform(b:bat[:any], 
p:dbl):bat[:oid] ",     "SAMPLEuniform;",       "Returns the oids of a uniform 
sample of size = (p x count(b)), where 0 <= p <= 1.0"    ]
 [ "sample",    "subuniform",   "pattern sample.subuniform(b:bat[:any], p:dbl, 
sample_seed:int):bat[:oid] ",    "SAMPLEuniform;",       "Returns the oids of a 
uniform sample of size = (p x count(b)), where 0 <= p <= 1.0 and where the prg 
is seeded with sample_seed"       ]
 [ "sample",    "subuniform",   "pattern sample.subuniform(b:bat[:any], 
sample_size:lng):bat[:oid] ",   "SAMPLEuniform;",       "Returns the oids of a 
uniform sample of size s"        ]
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1729,20 +1729,6 @@ str RUNcostPrediction(Client cntxt, MalB
 str RUNisolation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str RUNpickResult(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str RUNvolumeCost(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
-str SABAOTHfreeStatus(sabdb **ret);
-str SABAOTHgetLocalConnection(str *ret);
-str SABAOTHgetMyStatus(sabdb **ret);
-str SABAOTHmarchConnection(str *host, int *port);
-str SABAOTHmarchScenario(str *lang);
-str SABAOTHretreatScenario(str *lang);
-str SABepilogue(void *ret);
-str SABgetLocalConnectionHost(str *ret);
-str SABgetLocalConnectionPort(int *ret);
-str SABgetLocalConnectionURI(str *ret);
-str SABmarchConnection(void *ret, str *host, int *port);
-str SABmarchScenario(void *ret, str *lang);
-str SABprelude(void *ret);
-str SABretreatScenario(void *ret, str *lang);
 str SAMPLEuniform(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str SERVERbindBAT(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str SERVERclient(void *res, const Stream *In, const Stream *Out);
@@ -2414,7 +2400,7 @@ void moveInstruction(MalBlkPtr mb, int p
 void msab_dbfarminit(const char *dbfarm);
 void msab_dbpathinit(const char *dbpath);
 char *msab_deserialise(sabdb **ret, char *sabdb);
-char *msab_freeStatus(sabdb **ret);
+void msab_freeStatus(sabdb **ret);
 char *msab_getDBfarm(char **ret);
 char *msab_getDBname(char **ret);
 char *msab_getMyStatus(sabdb **ret);
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -778,7 +778,7 @@ msab_getStatus(sabdb** ret, char *dbname
 /**
  * Frees up the sabdb structure returned by getStatus.
  */
-char *
+void
 msab_freeStatus(sabdb** ret)
 {
        sabdb *p, *q;
@@ -812,8 +812,6 @@ msab_freeStatus(sabdb** ret)
                free(p);
                p = q;
        }
-
-       return(NULL);
 }
 
 /**
diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h
--- a/common/utils/msabaoth.h
+++ b/common/utils/msabaoth.h
@@ -75,7 +75,7 @@ msab_export char *msab_registerStarted(v
 msab_export char *msab_registerStop(void);
 msab_export char *msab_getMyStatus(sabdb** ret);
 msab_export char *msab_getStatus(sabdb** ret, char *dbname);
-msab_export char *msab_freeStatus(sabdb** ret);
+msab_export void msab_freeStatus(sabdb** ret);
 msab_export char *msab_getUplogInfo(sabuplog *ret, const sabdb *db);
 msab_export char *msab_serialise(char **ret, const sabdb *db);
 msab_export char *msab_deserialise(sabdb **ret, char *sabdb);
diff --git a/monetdb5/mal/Makefile.ag b/monetdb5/mal/Makefile.ag
--- a/monetdb5/mal/Makefile.ag
+++ b/monetdb5/mal/Makefile.ag
@@ -39,7 +39,6 @@ lib_mal = {
                mal_parser.c mal_parser.h \
                mal_profiler.c mal_profiler.h \
                mal_resolve.c mal_resolve.h \
-               mal_sabaoth.c mal_sabaoth.h \
                mal_scenario.c mal_scenario.h \
                mal_session.c mal_session.h \
                mal_stack.c mal_stack.h \
diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -27,7 +27,7 @@ int have_hge;
 #include "mal_interpreter.h"
 #include "mal_namespace.h"  /* for initNamespace() */
 #include "mal_client.h"
-#include "mal_sabaoth.h"
+#include "msabaoth.h"
 #include "mal_dataflow.h"
 #include "mal_profiler.h"
 #include "mal_private.h"
diff --git a/monetdb5/mal/mal_sabaoth.c b/monetdb5/mal/mal_sabaoth.c
deleted file mode 100644
--- a/monetdb5/mal/mal_sabaoth.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
- */
-
-/*
- * (author) Fabian Groffen
- *  Cluster support
- * The cluster facilitation currently only deals with (de-)registering of
- * services offered by the local server to other servers.
- * The name of this module is inspired by the Armada setting of ancient
- * times and origanisational structures.  Sabaoth, stands for ``Lord of
- * Hosts'' in an army setting as found in the Bible's New Testament.  This
- * module allows an army of Mservers to be aware of each other on a local
- * machine and redirect to each other when necessary.
- */
-#include "monetdb_config.h"
-#include "mal_sabaoth.h"
-#include <unistd.h>    /* unlink and friends */
-#include <sys/types.h>
-#ifdef HAVE_DIRENT_H
-#include <dirent.h> /* readdir, DIR */
-#endif
-#include <sys/stat.h>
-#include <string.h> /* for getting error messages */
-
-#if defined(_MSC_VER) && _MSC_VER >= 1400
-#define close _close
-#endif
-
-#define excFromMem(TPE, WHRE, X)                                               
\
-       do {                                                                    
                        \
-               str _me = createException(TPE, WHRE, "%s", X);  \
-               free(X);                                                        
                        \
-               return(_me);                                                    
                \
-       } while (0)
-
-/**
- * Writes the given language to the scenarios file.  If the file doesn't
- * exist, it is created.  Multiple invocations of this function for the
- * same language are ignored.
- */
-str SABAOTHmarchScenario(str *lang) {
-       str err = msab_marchScenario(*lang);
-       if (err != NULL)
-               excFromMem(MAL, "sabaoth.marchscenario", err);
-       return(MAL_SUCCEED);
-}
-
-/**
- * Removes the given language from the scenarios file.  If the scenarios
- * file is empty (before or) after removing the language, the file is
- * removed.
- */
-str SABAOTHretreatScenario(str *lang) {
-       str err = msab_retreatScenario(*lang);
-       if (err != NULL)
-               excFromMem(MAL, "sabaoth.retreatscenario", err);
-       return(MAL_SUCCEED);
-}
-
-/**
- * Writes an URI to the connection file based on the given arguments.
- * If the file doesn't exist, it is created.  Multiple invocations of
- * this function for the same arguments are NOT ignored.  If port is set
- * to <= 0, this function treats the host argument as UNIX domain
- * socket, in which case host must start with a '/'.
- */
-str SABAOTHmarchConnection(str *host, int *port) {
-       str err = msab_marchConnection(*host, *port);
-       if (err != NULL)
-               excFromMem(MAL, "sabaoth.marchconnection", err);
-       return(MAL_SUCCEED);
-}
-
-/**
- * Returns the connection string for the current database, or nil when
- * there is none.  If there are multiple connections defined, only the
- * first is returned.
- */
-str SABAOTHgetLocalConnection(str *ret) {
-       char data[8096];
-       sabdb *stats = NULL;
-       str err;
-
-       err = msab_getMyStatus(&stats);
-       if (err != NULL)
-               excFromMem(MAL, "sabaoth.getlocalconnection", err);
-
-       if (stats == NULL || stats->conns == NULL || stats->conns->val == NULL) 
{
-               *ret = GDKstrdup(str_nil);
-       } else {
-               if (stats->conns->val[15] == '/') {
-                       snprintf(data, sizeof(data), "%s?database=%s",
-                                       stats->conns->val, stats->dbname);
-               } else {
-                       snprintf(data, sizeof(data), "%s%s",
-                                       stats->conns->val, stats->dbname);
-               }
-               *ret = GDKstrdup(data);
-       }
-
-       if (stats != NULL)
-               SABAOTHfreeStatus(&stats);
-       if(*ret == NULL)
-               throw(MAL,"sabaoth.getlocalconnection", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
-       return(MAL_SUCCEED);
-}
-
-/**
- * Returns the status as NULL terminated sabdb struct list for the
- * current database.  Since the current database should always exist,
- * this function never returns NULL.
- */
-str SABAOTHgetMyStatus(sabdb** ret) {
-       str err = msab_getMyStatus(ret);
-       if (err != NULL)
-               excFromMem(MAL, "sabaoth.getmystatus", err);
-       return(MAL_SUCCEED);
-}
-
-/**
- * Frees up the sabdb structure returned by getStatus.
- */
-str SABAOTHfreeStatus(sabdb** ret) {
-       str err = msab_freeStatus(ret);
-       if (err != NULL)
-               excFromMem(MAL, "sabaoth.freestatus", err);
-       return(MAL_SUCCEED);
-}
diff --git a/monetdb5/mal/mal_sabaoth.h b/monetdb5/mal/mal_sabaoth.h
deleted file mode 100644
--- a/monetdb5/mal/mal_sabaoth.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
- */
-
-#ifndef _MAL_SABAOTH_DEF
-#define _MAL_SABAOTH_DEF
-
-#include "mal.h"
-#include "mal_exception.h"
-#include "msabaoth.h"
-mal_export str SABAOTHmarchScenario(str *lang);
-mal_export str SABAOTHretreatScenario(str *lang);
-mal_export str SABAOTHmarchConnection(str *host, int *port);
-mal_export str SABAOTHgetLocalConnection(str *ret);
-mal_export str SABAOTHgetMyStatus(sabdb** ret);
-mal_export str SABAOTHfreeStatus(sabdb** ret);
-#endif
diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c
--- a/monetdb5/mal/mal_session.c
+++ b/monetdb5/mal/mal_session.c
@@ -16,7 +16,7 @@
 #include "mal_namespace.h"
 #include "mal_authorize.h"
 #include "mal_builder.h"
-#include "mal_sabaoth.h"
+#include "msabaoth.h"
 #include "mal_private.h"
 #include "gdk.h"       /* for opendir and friends */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to