Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29724

Modified Files:
      Tag: xrpcdemo
        pathfinder.mx serialize.mx xrpc_server.mx 
Log Message:
various xrpc demo fixes
- remaining memory leaks
- update queries
- node parameters
- some issues in the GUI



U serialize.mx
Index: serialize.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/serialize.mx,v
retrieving revision 1.109.4.6
retrieving revision 1.109.4.7
diff -u -d -r1.109.4.6 -r1.109.4.7
--- serialize.mx        10 Jun 2008 04:55:42 -0000      1.109.4.6
+++ serialize.mx        10 Jun 2008 10:04:46 -0000      1.109.4.7
@@ -2094,7 +2094,7 @@
     stream_close(s);
     stream_destroy(s);
     
-    snprintf(dotcmd, 1024, "dot -Tcmapx -o%s.xml -Tgif -o%s.gif %s", 
base_name, base_name, dotFile);
+    snprintf(dotcmd, 1024, "dot -Tcmapx -o%s.xml -Tgif -o%s.gif %s 2> %s.err", 
base_name, base_name, dotFile, dotFile);
     if (ret || system(dotcmd) < 0) {
         GDKerror("draw_queryflow: failed to generate query flow graph using 
\"dot\"");
         return GDK_FAIL;
@@ -2141,8 +2141,12 @@
         if (strcmp(xrpc_caller, "query") == 0) {
             BATiter wsi = bat_iterator(ws);
             BAT *participants = BATdescriptor(*(bat*) BUNtail(wsi, 
XRPC_PARTICIPANTS));
-            if(draw_queryflow(*xrpc_seqnr, xrpc_method, time_exec, 
participants) == GDK_FAIL)
-                return GDK_FAIL;
+            int ret = GDK_FAIL;
+            if (participants) {
+                ret = draw_queryflow(*xrpc_seqnr, xrpc_method, time_exec, 
participants);
+                BBPunfix(participants->batCacheid);
+            }
+            if (ret == GDK_FAIL) return ret;
         }
     }
     ret = xquery_print_result_driver (

U xrpc_server.mx
Index: xrpc_server.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v
retrieving revision 1.68.4.13
retrieving revision 1.68.4.14
diff -u -d -r1.68.4.13 -r1.68.4.14
--- xrpc_server.mx      10 Jun 2008 04:55:44 -0000      1.68.4.13
+++ xrpc_server.mx      10 Jun 2008 10:04:48 -0000      1.68.4.14
@@ -646,7 +646,7 @@
     /* FIXME: should used BATdescriptor */
 @= getbat
     @1 = BATdescriptor(*(bat*)BUNtail(shredBATi,[EMAIL PROTECTED]));
-    if (pre_size == NULL) {
+    if (@1 == NULL) {
         send_err(out, ERR404, "env:Sender", "Shredded BAT @1 unavailable");
         goto cleanup;
     }
@@ -928,6 +928,7 @@
 @c
 cleanup:
     if (req) XRPCreq_free(req);
+    @:delbat(pre_size)@
     @:delbat(pre_level)@
     @:delbat(pre_prop)@
     @:delbat(pre_kind)@

U pathfinder.mx
Index: pathfinder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pathfinder.mx,v
retrieving revision 1.416.2.1.2.13
retrieving revision 1.416.2.1.2.14
diff -u -d -r1.416.2.1.2.13 -r1.416.2.1.2.14
--- pathfinder.mx       10 Jun 2008 04:55:39 -0000      1.416.2.1.2.13
+++ pathfinder.mx       10 Jun 2008 10:04:43 -0000      1.416.2.1.2.14
@@ -4967,7 +4967,12 @@
 
             if (shredBAT) {
                 /* add shredded RPC request message to the working set */
-                src = " ws_opencoll(ws, bat(xrpc_shredBAT), \"\", 
TEMP_DOC);\n";
+                src = " var cont := ws_opencoll(ws, bat(xrpc_shredBAT), \"\", 
TEMP_DOC);\n"
+                      " 
fun_kind000.inplace([+](fun_kind000.ord_select(64,int_nil),<<(int(cont),6) - 
64));\n";
+                /* the above weirdness is to handle nested requests made from 
a cached ws in 2PC.
+                 * in that case, the XRC message is *not* cont=1, but 
something else, therefore
+                 * we have to adjust the kind numbers of all node values.
+                 */
                 while(*src && cur < end) *cur++ = *src++;
             }
 
@@ -5019,14 +5024,16 @@
             }
             for(k=0; k<argcnt[j][i]; k++,l++) {
                 /* 'hack': perform simple atomic casts using Monet's 
ATOMfromstr */
-                int t = argtpe[l];
-                if (fun->sig->tpe[i] < XQUERY_ABSTRACT)
-                    t = fun->sig->tpe[i]; /* just parse the value string as if 
it was from the desired type */ 
                 /* it is doubtful how well pathfinder supports other
                  * casts and what we should do here in those cases.
                  */
+                int t = argtpe[l];
+                if (fun->sig->tpe[i] < XQUERY_ABSTRACT)
+                    t = fun->sig->tpe[i]; /* just parse the value string as if 
it was from the desired type */ 
+
+                /* parse value from tpe/str into a MonetDB BAT representation. 
*/ 
                 cur = xquery_parse_val(t, argval[l], ctx->fun_item000, 
ctx->fun_kind000, 
-                                       ctx->int_values, ctx->dbl_values, 
ctx->str_values, mil, 0); 
+                                       ctx->int_values, ctx->dbl_values, 
ctx->str_values, mil, 1); 
                 if (cur) return cur;
                 @:bunappend(fun_vid000, &vid, (size_t) *(oid*), SZFMT, "@0", 
ctx->)@
                 @:bunappend(fun_iter000, &iter, (size_t) *(oid*), SZFMT, "@0", 
ctx->)@


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to