Changeset: 3b193d5303ae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3b193d5303ae
Modified Files:
        clients/Tests/exports.stable.out
        monetdb5/mal/mal.c
        monetdb5/mal/mal.h
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_resource.c
        monetdb5/mal/mal_session.c
        monetdb5/modules/atoms/uuid.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/vaults/bam/Tests/bam_lib_mal.stable.err
        sql/backends/monet5/vaults/bam/Tests/bam_lib_mal.stable.out
        testing/Mtest.py.in
        tools/mserver/mserver5.c
Branch: default
Log Message:

the console is gone...


diffs (truncated from 627 to 300 lines):

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
@@ -2375,8 +2375,6 @@ str mal_quote(const char *msg, size_t si
 MT_Lock mal_remoteLock;
 void mal_resource_reset(void) __attribute__((__visibility__("hidden")));
 void mal_runtime_reset(void) __attribute__((__visibility__("hidden")));
-str mal_session_uuid;
-int mal_trace;
 void mal_unquote(char *msg);
 str manifoldRef;
 str mapiRef;
diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -13,8 +13,6 @@
 char   monet_cwd[FILENAME_MAX] = { 0 };
 size_t         monet_memory = 0;
 char   monet_characteristics[4096];
-int            mal_trace;              /* enable profile events on console */
-str     mal_session_uuid;   /* unique marker for the session */
 
 #ifdef HAVE_HGE
 int have_hge;
@@ -43,7 +41,7 @@ int have_hge;
 MT_Lock     mal_contextLock = MT_LOCK_INITIALIZER("mal_contextLock");
 MT_Lock     mal_namespaceLock = MT_LOCK_INITIALIZER("mal_namespaceLk");
 MT_Lock     mal_remoteLock = MT_LOCK_INITIALIZER("mal_remoteLock");
-MT_Lock        mal_profileLock = MT_LOCK_INITIALIZER("mal_profileLock");
+MT_Lock     mal_profileLock = MT_LOCK_INITIALIZER("mal_profileLock");
 MT_Lock     mal_copyLock = MT_LOCK_INITIALIZER("mal_copyLock");
 MT_Lock     mal_delayLock = MT_LOCK_INITIALIZER("mal_delayLock");
 MT_Lock     mal_beatLock = MT_LOCK_INITIALIZER("mal_beatLock");
@@ -92,8 +90,6 @@ int mal_init(void){
  * activity first.
  * This function should be called after you have issued sql_reset();
  */
-void cleanOptimizerPipe(void);
-
 void mserver_reset(void)
 {
        str err = 0;
@@ -112,29 +108,8 @@ void mserver_reset(void)
                fprintf(stderr, "!%s", err);
                free(err);
        }
-       /* TODO: make sure this is still required
-#ifdef HAVE_EMBEDDED
-       MTIMEreset();
-#endif
-*/
        mal_factory_reset();
        mal_dataflow_reset();
-       THRdel(mal_clients->mythread);
-       GDKfree(mal_clients->errbuf);
-       mal_clients->fdin->s = NULL;
-       bstream_destroy(mal_clients->fdin);
-       GDKfree(mal_clients->prompt);
-       GDKfree(mal_clients->username);
-       freeStack(mal_clients->glb);
-       if (mal_clients->usermodule/* && 
strcmp(mal_clients->usermodule->name,"user")==0*/)
-               freeModule(mal_clients->usermodule);
-
-       mal_clients->fdin = 0;
-       mal_clients->prompt = 0;
-       mal_clients->username = 0;
-       mal_clients->curprg = 0;
-       mal_clients->usermodule = 0;
-
        mal_client_reset();
        mal_linker_reset();
        mal_resource_reset();
@@ -143,13 +118,10 @@ void mserver_reset(void)
        mal_atom_reset();
        opt_pipes_reset();
        mdbExit();
-       GDKfree(mal_session_uuid);
-       mal_session_uuid = NULL;
 
-       memset((char*)monet_cwd,0, sizeof(monet_cwd));
+       memset((char*)monet_cwd, 0, sizeof(monet_cwd));
        monet_memory = 0;
        memset((char*)monet_characteristics,0, sizeof(monet_characteristics));
-       mal_trace = 0;
        mal_namespace_reset();
        /* No need to clean up the namespace, it will simply be extended
         * upon restart mal_namespace_reset(); */
@@ -159,7 +131,7 @@ void mserver_reset(void)
 
 /* stopping clients should be done with care, as they may be in the mids of
  * transactions. One safe place is between MAL instructions, which would
- * abort the transaction by raising an exception. All non-console sessions are
+ * abort the transaction by raising an exception. All sessions are
  * terminate this way.
  * We should also ensure that no new client enters the scene while shutting 
down.
  * For this we mark the client records as BLOCKCLIENT.
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -51,8 +51,6 @@ mal_export size_t     monet_memory;
 mal_export char        monet_characteristics[4096];
 mal_export lng                 memorypool;      /* memory claimed by 
concurrent threads */
 mal_export int                 memoryclaims;    /* number of threads active 
with expensive operations */
-mal_export int         mal_trace;              /* enable profile events on 
console */
-mal_export str         mal_session_uuid;       /* unique marker for the 
session */
 #ifdef HAVE_HGE
 mal_export int have_hge;
 #endif
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -7,11 +7,10 @@
  */
 
 /*
- * Clients gain access to the Monet server through a internet connection
- * or through its server console.  Access through the internet requires
- * a client program at the source, which addresses the default port of a
- * running server.  The functionality of the server console is limited.
- * It is a textual interface for expert use.
+ * Clients gain access to the Monet server through a internet connection.  
+ * Access through the internet requires a client program at the source, 
+ * which addresses the default port of a running server. It is a textual 
+ * interface for expert use.
  *
  * At the server side, each client is represented by a session record
  * with the current status, such as name, file descriptors, namespace,
@@ -19,8 +18,7 @@
  * control.
  *
  * The number of clients permitted concurrent access is a run time
- * option. The console is the first and is always present.  It reads
- * from standard input and writes to standard output.
+ * option. 
  *
  * Client sessions remain in existence until the corresponding
  * communication channels break.
@@ -77,9 +75,7 @@ MCinit(void)
                }
        }
 
-       MAL_MAXCLIENTS =
-               /* console */ 1 +
-               /* client connections */ maxclients;
+       MAL_MAXCLIENTS = /* client connections */ maxclients;
        mal_clients = GDKzalloc(sizeof(ClientRec) * MAL_MAXCLIENTS);
        if( mal_clients == NULL){
                fprintf(stderr,"#MCinit:" MAL_MALLOC_FAIL);
@@ -138,11 +134,6 @@ MCnewClient(void)
 {
        Client c;
        MT_lock_set(&mal_contextLock);
-       if (mal_clients[CONSOLE].user && mal_clients[CONSOLE].mode == 
FINISHCLIENT) {
-               /*system shutdown in progress */
-               MT_lock_unset(&mal_contextLock);
-               return NULL;
-       }
        for (c = mal_clients; c < mal_clients + MAL_MAXCLIENTS; c++) {
                if (c->mode == FREECLIENT) {
                        c->mode = RUNCLIENT;
@@ -227,7 +218,6 @@ MCinitClientRecord(Client c, oid user, b
        c->listing = 0;
        c->fdout = fout ? fout : GDKstdout;
        c->mdb = 0;
-       c->history = 0;
        c->curprg = c->backup = 0;
        c->glb = 0;
 
@@ -474,9 +464,9 @@ MCstopClients(Client cntxt)
        Client c = mal_clients;
 
        MT_lock_set(&mal_contextLock);
-       for(c= mal_clients +1;  c < mal_clients+MAL_MAXCLIENTS; c++)
-       if( cntxt != c){
-               if ( c->mode == RUNCLIENT)
+       for(c = mal_clients;  c < mal_clients+MAL_MAXCLIENTS; c++)
+       if (cntxt != c){
+               if (c->mode == RUNCLIENT)
                        c->mode = FINISHCLIENT; 
                else if (c->mode == FREECLIENT)
                        c->mode = BLOCKCLIENT;
@@ -491,13 +481,13 @@ MCactiveClients(void)
        int freeclient=0, finishing=0, running=0, blocked = 0;
        Client cntxt = mal_clients;
 
-       for(cntxt= mal_clients+1;  cntxt<mal_clients+MAL_MAXCLIENTS; cntxt++){
+       for(cntxt = mal_clients;  cntxt<mal_clients+MAL_MAXCLIENTS; cntxt++){
                freeclient += (cntxt->mode == FREECLIENT);
                finishing += (cntxt->mode == FINISHCLIENT);
                running += (cntxt->mode == RUNCLIENT);
                blocked += (cntxt->mode == BLOCKCLIENT);
        }
-       return finishing+running +1 /* the admin */;
+       return finishing+running;
 }
 
 void
@@ -507,14 +497,7 @@ MCcloseClient(Client c)
        fprintf(stderr,"closeClient %d " OIDFMT "\n", (int) (c - mal_clients), 
c->user);
 #endif
        /* free resources of a single thread */
-       if (!isAdministrator(c)) {
-               MCfreeClient(c);
-               return;
-       }
-
-       /* adm is set to disallow new clients entering */
-       mal_clients[CONSOLE].mode = FINISHCLIENT;
-       mal_exit(0);
+       MCfreeClient(c);
 }
 
 str
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -17,9 +17,6 @@
 
 #define SCENARIO_PROPERTIES 8
 
-#define CONSOLE     0
-#define isAdministrator(X) (X==mal_clients)
-
 enum clientmode {
        FREECLIENT,
        FINISHCLIENT,
@@ -31,9 +28,8 @@ enum clientmode {
 
 /*
  * The prompt structure is designed to simplify recognition of the
- * language framework for interaction. For direct console access it is a
- * short printable ASCII string. For access through an API we assume the
- * prompt is an ASCII string surrounded by a \001 character. This
+ * language framework for interaction. For access through an API we 
+ * assume the prompt is an ASCII string surrounded by a \001 character. This
  * simplifies recognition.  The information between the prompt brackets
  * can be used to pass the mode to the front-end. Moreover, the prompt
  * can be dropped if a single stream of information is expected from the
@@ -127,7 +123,6 @@ typedef struct CLIENT {
         */
        int debug;
        void  *mdb;            /* context upon suspend */
-       str    history;        /* where to keep console history */
        enum clientmode mode;  /* FREECLIENT..BLOCKED */
        /*
         * Client records are organized into a two-level dependency tree,
diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -1051,7 +1051,7 @@ mdbStep(Client cntxt, MalBlkPtr mb, MalS
        if (stk->cmd == 0)
                stk->cmd = 'n';
        /* a trapped call leads to process suspension */
-       /* then the console can be used to attach a debugger */
+       /* which can be used to attach a debugger */
        if (mb->trap) {
                mdbTrap(cntxt, mb, stk, getInstrPtr(mb,pc));
                return;
@@ -1405,7 +1405,7 @@ mdbHelp(stream *f)
        mnstr_printf(f, "down             -- go down the stack\n");
        mnstr_printf(f, "up               -- go up the stack\n");
        mnstr_printf(f, "trace <var>      -- trace assignment to variables\n");
-       mnstr_printf(f, "trap <mod>.<fcn> -- catch MAL function call in 
console\n");
+       mnstr_printf(f, "trap <mod>.<fcn> -- catch MAL function call in 
debugger\n");
        mnstr_printf(f, "help             -- this message\n");
 }
 
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -167,8 +167,6 @@ renderProfilerEvent(MalBlkPtr mb, MalStk
        logadd("\"tag\":%d,%s", stk?stk->tag:0, prettify);
        logadd("\"module\":\"%s\",%s", pci->modname ? pci->modname : "", 
prettify);
        logadd("\"instruction\":\"%s\",%s", pci->fcnname ? pci->fcnname : "", 
prettify);
-       if( mal_session_uuid)
-               logadd("\"session\":\"%s\",%s",mal_session_uuid,prettify);
 
        if( start){
                logadd("\"state\":\"start\",%s", prettify);
@@ -456,8 +454,6 @@ profilerHeartbeatEvent(char *alter)
        lognew();
        logadd("{%s",prettify); // fill in later with the event counter
        logadd("\"source\":\"heartbeat\",%s", prettify);
-       if(mal_session_uuid)
-               logadd("\"session\":\"%s\",%s", mal_session_uuid, prettify);
        logadd("\"clk\":"LLFMT",%s",usec,prettify);
        logadd("\"ctime\":%"PRIu64",%s", microseconds, prettify);
        logadd("\"rss\":%zu,%s", MT_getrss()/1024/1024, prettify);
@@ -660,8 +656,6 @@ MPresetProfiler(stream *fdout)
 {
        if (fdout != eventstream)
                return;
-       if (mal_trace) // already traced on console
-               return;
        MT_lock_set(&mal_profileLock);
        eventstream = 0;
        MT_lock_unset(&mal_profileLock);
@@ -1079,8 +1073,6 @@ void setHeartbeat(int delay)
 void initProfiler(void)
 {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to