Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2930

Modified Files:
      Tag: XQuery_0-16
        nexi.c nexi_generate_mil.c 
Log Message:
* fragmented querying is now automagic. No more fragments="true" neccessary.
* debug=98 now prints the data of intermediate nexi steps.



Index: nexi_generate_mil.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/nexi_generate_mil.c,v
retrieving revision 1.23.2.1
retrieving revision 1.23.2.2
diff -u -d -r1.23.2.1 -r1.23.2.2
--- nexi_generate_mil.c 24 Jan 2007 08:25:27 -0000      1.23.2.1
+++ nexi_generate_mil.c 22 Feb 2007 11:19:56 -0000      1.23.2.2
@@ -1026,6 +1026,10 @@
       if ( TDEBUG(5) ) {
           MILPRINTF(MILOUT,"printf(\"# tijah-mil-exec: computed 
R%d.\\n\");\n",com_num);
       }
+      if ( TDEBUG(98) ) {
+          MILPRINTF(MILOUT,"printf(\"# tijah-mil-exec: contents of R%d 
is:\\n\");\n",com_num);
+          MILPRINTF(MILOUT,"R%d.print();\n",com_num);
+      }
       
       POP_COMMAND();
       com_sp++;

Index: nexi.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/nexi.c,v
retrieving revision 1.47
retrieving revision 1.47.2.1
diff -u -d -r1.47 -r1.47.2.1
--- nexi.c      19 Jan 2007 13:41:06 -0000      1.47
+++ nexi.c      22 Feb 2007 11:19:56 -0000      1.47.2.1
@@ -79,6 +79,7 @@
 #include "pftijah.h"
 #include "nexi.h"
 #include "pftijah.h"
+#include "pftijah_util.h"
 
 #define LOGFILE   GDKout
 #define LOGPRINTF if ( 0 ) stream_printf
@@ -97,14 +98,6 @@
   parserCtx->collection   = "PFX";
   parserCtx->queryText    = query;
   parserCtx->errBUFF[0]   = 0;
-  parserCtx->useFragments = 0;
-  if ( 1 /* not fragmented */ ) {
-    parserCtx->ffPfx        = ""; /* "_frag"*/;
-    parserCtx->flastPfx     = ", str(1)"; /* */;
-  } else {
-    parserCtx->ffPfx        = "_frag"; /* "_frag"*/;
-    parserCtx->flastPfx     = ""; /* "_frag"*/;
-  }
   parserCtx->milFILEname  = NULL;
   /* initialize the lists */
   if ( ! (
@@ -273,24 +266,9 @@
        } else if ( strcmp(optName,"collection") == 0 ) {
             parserCtx->collection = optVal;
        } else if ( strcmp(optName,"fragments") == 0 ) {
-           if ( (strcmp(optVal,"true")==0) || 
-                (strcmp(optVal,"TRUE")==0) ||
-                (strcmp(optVal,"on")==0) ||
-                (strcmp(optVal,"ON")==0) 
-              ) {
-             if (TDEBUG(1)) stream_printf(GDKout,"# old_main: setting 
fragmentation ON.\n");
-              parserCtx->useFragments = 1;
-              parserCtx->ffPfx        = "_frag";
-              parserCtx->flastPfx     = "";
-           } else {
-             if (TDEBUG(1)) stream_printf(GDKout,"# old_main: setting 
fragmentation OFF.\n");
-              parserCtx->useFragments = 0;
-              parserCtx->ffPfx        = "";
-              parserCtx->flastPfx     = ", str(1)";
-           }
+             if (TDEBUG(1)) stream_printf(GDKout,"# old_main: ignoring 
fragmentation setting.\n");
        } else if ( strcmp(optName,"background_collection") == 0 ) {
             strcpy(background_collection, optVal);
-            
         } else if ( strcmp(optName,"returnNumber") == 0 || 
                     strcmp(optName,"retNum") == 0 || 
                     strcmp(optName,"top") == 0 ) {
@@ -470,8 +448,25 @@
             stream_printf(GDKout,"TijahOptions: should handle: 
%s=%s\n",optName,optVal);
         }
     }
-    
-    
+    /*
+     * Now find out if the collection is fragmented or not.
+     */
+    BAT* fb = 
pftu_lookup_bat(pftu_batname1("tj_%s_fragments",(char*)parserCtx->collection,0));
+    if ( ! fb ) {
+           stream_printf(GDKerr,"Error: cannot find fragments bat for 
collection \"%s\".\n",parserCtx->collection);
+           return 0;
+    }
+    if ( BATcount(fb) > 1 ) {
+             if (TDEBUG(1)) stream_printf(GDKout,"# old_main: setting 
fragmentation ON.\n");
+              parserCtx->useFragments = 1;
+              parserCtx->ffPfx        = "_frag";
+              parserCtx->flastPfx     = "";
+    } else {
+             if (TDEBUG(1)) stream_printf(GDKout,"# old_main: setting 
fragmentation OFF.\n");
+              parserCtx->useFragments = 0;
+              parserCtx->ffPfx        = "";
+              parserCtx->flastPfx     = ", str(1)";
+    }
     // Some special cases for NLLR, since NLLR only works with COARSE2 at the 
moment
     if ( txt_retr_model->model == MODEL_NLLR ) {
         // Switch to COARSE2 algebra for NLLR


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to