Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29286
Modified Files:
Tag: XQuery_0-16
pftijah.mx serialize_pftijah.mx
Log Message:
* repair fragment bug introduced by new commit structure
* tj_log() MIL function to be able to do debugging IO in 'difficult areas'
Index: serialize_pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/serialize_pftijah.mx,v
retrieving revision 1.36.2.4
retrieving revision 1.36.2.5
diff -u -d -r1.36.2.4 -r1.36.2.5
--- serialize_pftijah.mx 21 Feb 2007 21:05:35 -0000 1.36.2.4
+++ serialize_pftijah.mx 22 Feb 2007 14:30:07 -0000 1.36.2.5
@@ -649,11 +649,13 @@
return NULL;
int newFragments = (int)BATcount(fragments) + 1;
/* */
+ BBPunfix(BBPcacheid(res->b_collPre));
res->b_collPre =
pftu_create_bat(pftu_batname1("tj_%s_tid%d",res->name,newFragments),TYPE_void,TYPE_oid,1);
if ( !res->b_collPre )
return NULL;
BBPfix(BBPcacheid(res->b_collPre));
BATseqbase(res->b_collPre,res->tijahPre);
+ BBPunfix(BBPcacheid(res->b_collSize));
res->b_collSize =
pftu_create_bat(pftu_batname1("tj_%s_size%d",res->name,newFragments),TYPE_void,TYPE_int,1);
if ( !res->b_collSize )
return NULL;
@@ -662,6 +664,13 @@
if ( !BUNappend(fragments,&res->tijahPre,0) )
return NULL;
BBPunfix(BBPcacheid(fragments));
+ /* */
+ str pretag = "_tid";
+ bat prebat = BBPcacheid(res->b_collPre);
+ if ( !BUNreplace(tjCtx_BAT,pretag,&prebat,0) ) { return NULL; }
+ str sizetag = "_size";
+ bat sizebat = BBPcacheid(res->b_collSize);
+ if ( !BUNreplace(tjCtx_BAT,sizetag,&sizebat,0) ) { return NULL;
}
#ifdef TJ_TRACE
if ( TJ_TRACE ) stream_printf(GDKout,"C[%s]: loadTijahContext()
finished creating new fragments\n",res->name);
#endif
Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.92.2.14
retrieving revision 1.92.2.15
diff -u -d -r1.92.2.14 -r1.92.2.15
--- pftijah.mx 21 Feb 2007 21:05:35 -0000 1.92.2.14
+++ pftijah.mx 22 Feb 2007 14:30:06 -0000 1.92.2.15
@@ -53,6 +53,10 @@
.COMMAND tj_dispose_termdb() : void = CMDtj_dispose_termdb;
"INCOMPLETE"
+.COMMAND tj_log(str, int) : void = CMDtj_log;
+ "DEBUGGING function for difficult IO areas"
+
+
.COMMAND serialize_tijah_opt(
BAT[void,bat] ws,
int niters,
@@ -617,7 +621,8 @@
var t_start := usec();
bat("tj_globalTerms").access(BAT_WRITE);
bat("tj_globalTags").access(BAT_WRITE);
- var collBat := _tj_collection(collName);
+ var collBat;
+ collBat := _tj_collection(collName);
[EMAIL PROTECTED]() {
_tj_add2collection(collName, collBat, $h, $t, store);
}
@@ -725,8 +730,9 @@
collBat.find("_size").access(BAT_APPEND).mmap(1);
collBat.find("_tid").access(BAT_APPEND).mmap(1);
collBat.find("_pfpre").access(BAT_APPEND).mmap(1);
- collBat.find("submitBats").append("tj_" + collName + "_size1");
- collBat.find("submitBats").append("tj_" + collName + "_tid1");
+ var fpfx := str(collBat.find("_fragments").count());
+ collBat.find("submitBats").append("tj_" + collName + "_size" + fpfx);
+ collBat.find("submitBats").append("tj_" + collName + "_tid" + fpfx);
collBat.find("submitBats").append("tj_" + collName + "_pfpre");
collBat.find("submitBats").append("tj_" + collName + "_fragments");
collBat.find("submitBats").append("tj_" + collName + "_doc_name");
@@ -2568,6 +2574,7 @@
{
mod_frags.append("tj_" + collName + "_tid" + str(frag_offset));
mod_frags.append("tj_" + collName + "_size" + str(frag_offset));
+ frag_offset :+= 1;
}
return mod_frags;
@@ -2757,6 +2764,21 @@
return monet_exec(str);
}
+#define LOGGERFILE "/tmp/TIJAH_LOGGER"
+
+/*
+ * the CMDtj_log is created to be able to print in very difficult IO areas
+ */
+int CMDtj_log(str format, int* i) {
+ FILE* f;
+
+ if ( (f = fopen(LOGGERFILE,"a")) ) {
+ fprintf(f,(const char*)format,*i);
+ fclose(f);
+ }
+ return GDK_SUCCEED;
+}
+
int CMDtijah_command(bit* res, str command) {
if ( 0 ) stream_printf(GDKout,"# tijah_command(%s)\n",(char*)command);
*res = executeMIL(command); /* OK */
-------------------------------------------------------------------------
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