📄 bpm.mx
字号:
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] */@- Box administrationThe box currently does not carry any client protection.This should later be added or being provided by the BAT access.@= openCat@cstrBPMopen(){ 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(); @:getBATdescriptor(src,b,"bpm.deposit"); /* 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(); @:getBATdescriptor(bid,b,"bpm.deposit"); @:getBATdescriptor(src,bn,"bpm.deposit"); /* 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(); @:getBATdescriptor(bid,b,"bpm.range")@ /* 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(); @:getBATdescriptor(bid,b,"bpm.hash")@ /* 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(); @:getBATdescriptor(bid,b,"bpm.rangeHash")@ /* 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(); @:getBATdescriptor(bid,b,"bpm.hashRange")@ /* 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(); @:getBATdescriptor(bid,b,"bpm.derived")@ /* partition into two direction */ (void) b; (void) src; *ret= 0; throw(MAL, "bpm.derived","NYI");}@-Takeing out partitions.@cstrBPMtake(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(); @:getBATdescriptor(bid,b,"bpm.take"); (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(); @:getBATdescriptor(bid,b,"bpm.take"); (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(); @:getBATdescriptor(bid,b,"bpm.take"); (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(); @:getBATdescriptor(bid,b,"bpm.take"); (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(); @:getBATdescriptor(bid,b,"bpm.take")@ (void) b; (void) idx; *ret =0; throw(MAL, "bpm.take","NYI");}@- Updates@cstrBPMinsert(int *ret, int *bid, int *ins){ BAT *b; BPMopen(); @:getBATdescriptor(bid,b,"bpm.insert")@ /* distributed the content */ (void) b; (void) ins; *ret= 0; throw(MAL, "bpm.insert","NYI");}strBPMdelete(int *ret, int *bid, int *del){ BAT *b; BPMopen(); @:getBATdescriptor(bid,b,"bpm.delete")@ /* 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(); @:getBATdescriptor(bid,b,"bpm.insert")@ /* 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");}@- IterationsWe start with the large chunk iterator.The definition of the control statements require the samecontrol variables, which means that the BATview is accessibleto determine how far to advance when the next chunk is retrieved.The number of elements in the chunk is limited by the granulesize.@cstrBPMnewIteratorBase(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");}@-Iterations over partitioned BATs can be valued constrainted.@cstrBPMnewIterator(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");}@cstrBPMprelude(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;}@-In the epilogue phase we should discard any temporary MAT.@cstrBPMepilogue(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 + -