⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bpm.c

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 C
字号:
#line 455 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"#include "mal_config.h"#include "bpm.h"static BAT *bpmName;		/* bat[:bat,:str] */static BAT *bpmPartition;	/* bat[:bat,:bat] */static BAT *bpmHeadLow[TYPE_any]; /*bat[:bat,:type_i] */static BAT *bpmHeadHigh[TYPE_any]; /*bat[:bat,:type_i] */static BAT *bpmTailLow[TYPE_any]; /*bat[:bat,:type_i] */static BAT *bpmTailHigh[TYPE_any]; /*bat[:bat,:type_i] */static BAT *bpmHeadSlots; /*bat[:bat,:int] */static BAT *bpmTailSlots; /*bat[:bat,:int] */#line 473 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"strBPMopen(){	int i;	if( bpmName )		return MAL_SUCCEED;	/* open all BATs available in the catalog */    mal_set_lock(mal_contextLock, "bpm");	bpmName= BATdescriptor(BBPindex("bpmName"));	if( bpmName == NULL)		throw(MAL, "bpm.open", "failed to access bpmName");	bpmPartition= BATdescriptor(BBPindex("bpmPartition"));	if( bpmPartition == NULL)		throw(MAL, "bpm.open", "failed to access bpmName");	bpmHeadSlots= BATdescriptor(BBPindex("bpmHeadSlots"));	if( bpmHeadSlots == NULL)		throw(MAL, "bpm.open", "failed to access bpmHeadSlots");	bpmTailSlots= BATdescriptor(BBPindex("bpmTailSlots"));	if( bpmTailSlots == NULL)		throw(MAL, "bpm.open", "failed to access bpmTailSlots");	for(i=0; i< GDKatomcnt; i++){		char buf[PATHLENGTH];		snprintf(buf,PATHLENGTH,"pbmHeadLow_%i",i);		bpmHeadLow[i]= BATdescriptor(BBPindex(buf));		snprintf(buf,PATHLENGTH,"pbmHeadHigh%i",i);		bpmHeadHigh[i]= BATdescriptor(BBPindex(buf));		snprintf(buf,PATHLENGTH,"pbmTailLow_%i",i);		bpmTailLow[i]= BATdescriptor(BBPindex(buf));		snprintf(buf,PATHLENGTH,"pbmTailHigh%i",i);		bpmTailHigh[i]= BATdescriptor(BBPindex(buf));	}    mal_unset_lock(mal_contextLock, "bpm");	return MAL_SUCCEED;}strBPMclose(int *ret){	(void) ret;	/* save the catalog using a subtransaction */	throw(MAL, "bpm.close","NYI");}strBPMdestroy(int *ret){	(void) ret;	/* re-initialize the partition table */	throw(MAL, "bpm.destroy","NYI");}strBPMdepositName(int *ret, str *nme, int *src){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*src)) == NULL ){ ;		 throw(MAL, "bpm.deposit", "cannot access descriptor");   }#line 532 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* test for duplicate names */	/* a nil-nil range partition*/	(void) nme;	(void) b;	*ret= 0;	throw(MAL, "bpm.deposit","NYI");}strBPMdeposit(int *ret, int *bid, int *src){	BAT *b, *bn;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.deposit", "cannot access descriptor");   }#line 544 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (bn= BATdescriptor(*src)) == NULL ){ ;		 throw(MAL, "bpm.deposit", "cannot access descriptor");   }#line 544 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* Distribued content of src to alias */	(void) b;	(void) bn;	*ret= 0;	throw(MAL, "bpm.deposit","NYI");}strBPMrange(int *ret, int *bid, ptr *hl, ptr *hh, ptr *tl, ptr *th){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.range", "cannot access descriptor");   }#line 556 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* determine the partitioning scheme */	(void) b;	(void) hl;	(void) hh;	(void) tl;	(void) th;	*ret= 0;	throw(MAL, "bpm.range","NYI");}strBPMhash(int *ret, int *bid, int *hslots, int *tslots){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.hash", "cannot access descriptor");   }#line 571 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* get hash slot administration */	(void) b;	(void) hslots;	(void) tslots;	*ret= 0;	throw(MAL, "bpm.hash","NYI");}strBPMrangeHash(int *ret, int *bid, ptr *hl, ptr *hh, int *tslots){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.rangeHash", "cannot access descriptor");   }#line 584 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* partition into two direction */	(void) b;	(void) hl;	(void) hh;	(void) tslots;	*ret= 0;	throw(MAL, "bpm.rangeHash","NYI");}strBPMhashRange(int *ret, int *bid, int *hslots, ptr *tl, ptr *th){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.hashRange", "cannot access descriptor");   }#line 598 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* partition into two direction */	(void) b;	(void) hslots;	(void) tl;	(void) th;	*ret= 0;	throw(MAL, "bpm.hashRange","NYI");}strBPMderived(int *ret, int *bid, int *src){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.derived", "cannot access descriptor");   }#line 612 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* partition into two direction */	(void) b;	(void) src;	*ret= 0;	throw(MAL, "bpm.derived","NYI");}#line 625 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"strBPMtake(int *ret, str *nme){	BPMopen();	(void) nme;	*ret =0;	throw(MAL, "bpm.take","NYI");}strBPMtakeRange(int *ret, int *bid, ptr *hl, ptr *hh, ptr *tl, ptr *th){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.take", "cannot access descriptor");   }#line 638 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	(void) b;	(void) hl;	(void) hh;	(void) tl;	(void) th;	*ret =0;	throw(MAL, "bpm.take","NYI");}strBPMtakeHash(int *ret, int *bid, int *hslots, int *tslots){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.take", "cannot access descriptor");   }#line 652 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	(void) b;	(void) hslots;	(void) tslots;	*ret =0;	throw(MAL, "bpm.take","NYI");}strBPMtakeRangeHash(int *ret, int *bid, ptr *hl, ptr *hh, int *tslots){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.take", "cannot access descriptor");   }#line 664 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	(void) b;	(void) hl;	(void) hh;	(void) tslots;	*ret =0;	throw(MAL, "bpm.take","NYI");}strBPMtakeHashRange(int *ret, int *bid, int *hslots, ptr *tl, ptr *th){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.take", "cannot access descriptor");   }#line 677 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	(void) b;	(void) tl;	(void) th;	(void) hslots;	*ret =0;	throw(MAL, "bpm.take","NYI");}strBPMtakePartition(int *ret, int *bid, int *idx){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.take", "cannot access descriptor");   }#line 690 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	(void) b;	(void) idx;	*ret =0;	throw(MAL, "bpm.take","NYI");}#line 702 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"strBPMinsert(int *ret, int *bid, int *ins){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.insert", "cannot access descriptor");   }#line 707 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* distributed the content */	(void) b;	(void) ins;	*ret= 0;	throw(MAL, "bpm.insert","NYI");}strBPMdelete(int *ret, int *bid, int *del){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.delete", "cannot access descriptor");   }#line 720 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* delete some information from the partitions */	(void) b;	(void) del;	*ret= 0;	throw(MAL, "bpm.delete","NYI");}strBPMreplace(int *ret, int *bid, int *ins, int *del){	BAT *b;	BPMopen();	#line 380 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	if( (b= BATdescriptor(*bid)) == NULL ){ ;		 throw(MAL, "bpm.insert", "cannot access descriptor");   }#line 733 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"	/* replace values */	(void) b;	(void) ins;	(void) del;	*ret= 0;	throw(MAL, "bpm.replace","NYI");}strBPMgetNames(int *ret){	BPMopen();	*ret =0;	throw(MAL, "bpm.getNames","NYI");}strBPMdiscard(int *ret, int *bid){	BPMopen();	(void) bid;	*ret =0;	throw(MAL, "bpm.discard","NYI");}#line 766 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"strBPMnewIteratorBase(int *ret, str *nme){	(void) nme;	*ret = 0;	throw(MAL, "bpm.newIterator","NYI");}strBPMhasMoreElementsBase(int *ret, str *nme){	(void) nme;	*ret = 0;	throw(MAL, "bpm.hasMoreElements","NYI");}#line 785 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"strBPMnewIterator(int *ret, int *bid){	(void) bid;	*ret = 0;	throw(MAL, "bpm.newIterator","NYI");}strBPMnewIteratorRng(int *ret, int *bid, ptr *first, ptr *last){	(void) first;	(void) last;	(void) bid;	*ret = 0;	throw(MAL, "bpm.newIterator","NYI");}strBPMnewIteratorRng4(int *ret, int *bid, ptr *first, ptr *last,	ptr *vlow, ptr *vhgh){	(void) first;	(void) last;	(void) vlow;	(void) vhgh;	(void) bid;	*ret = 0;	throw(MAL, "bpm.newIterator","NYI");}strBPMhasMoreElements(int *ret, int *bid){	(void) bid;	*ret = 0;	throw(MAL, "bpm.hasMoreElements","NYI");}strBPMhasMoreElementsRng(int *ret, int *bid, ptr *first, ptr *last){	(void) first;	(void) last;	(void) bid;	*ret = 0;	throw(MAL, "bpm.hasMoreElements","NYI");}strBPMhasMoreElementsRng4(int *ret, int *bid, ptr *first, ptr *last,	ptr *vlow, ptr *vhgh){	(void) first;	(void) last;	(void) vlow;	(void) vhgh;	(void) bid;	*ret = 0;	throw(MAL, "bpm.hasMoreElements","NYI");}strBPMgetDimension(ptr *first, ptr *last, ptr *vlow, ptr *vhgh, int *bid){	(void) first;	(void) last;	(void) vlow;	(void) vhgh;	(void) bid;	throw(MAL, "bpm.getDimension","NYI");}strBPMdump(int *ret){	stream *fd = GDKout;	ptr p,q;	BATloop(bpmName,p,q){		str nme= (str) BUNtail(bpmName,p);		stream_printf(fd,"[ \"%s\"",nme);		/* localize partition details */		stream_printf(fd,"]\n");	}	(void) ret;	throw(MAL, "bpm.dump","NYI");}strBPMdumpAlias(int *ret, int *bid){	(void) ret;	(void) bid;	throw(MAL, "bpm.dump","NYI");}#line 883 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"strBPMprelude(int *ret){    mal_set_lock(mal_contextLock, "bpm.prelude");	bpmName= BATdescriptor(BBPindex("bpmName"));	if( bpmName == NULL){		/* initialize the bpm catalog */	}	*ret =0;    mal_unset_lock(mal_contextLock, "bpm.prelude");	return MAL_SUCCEED;}#line 898 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/bpm.mx"strBPMepilogue(int *ret){	/* TODO: Make sure these are used. This is needed by icc only. And 	   should be removed once the implementation matures.	 */	(void)bpmHeadLow[0];	(void)bpmHeadHigh[0];	(void)bpmTailLow[0];	(void)bpmTailHigh[0];	*ret =0;	return MAL_SUCCEED;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -