log_bid ebat_copy(log_bid b, oid ibase, int temp) { /* make a copy of b */ BAT *o = temp_descriptor(b); BAT *c; log_bid r; if (!ebats[o->ttype]) ebats[o->ttype] = bat_new(TYPE_void, o->ttype, 0); if (!temp && BATcount(o)) { c = BATcopy(o, TYPE_void, o->ttype, TRUE); BATseqbase(c, ibase ); c->H->dense = 1; BATcommit(o); BATcommit(c); bat_set_access(c, BAT_READ); r = temp_create(c); bat_destroy(c); } else { c = ebats[o->ttype]; r = temp_create(c); } bat_destroy(o); return r; }
/* in the commit prelude, the delta status in the memory image of all * bats is commited */ static gdk_return prelude(int cnt, bat *subcommit) { int i = 0; while (++i < cnt) { bat bid = subcommit ? subcommit[i] : i; if (BBP_status(bid) & BBPPERSISTENT) { BAT *b = BBP_cache(bid); if (b == NULL && (BBP_status(bid) & BBPSWAPPED)) { b = BBPquickdesc(bid, TRUE); if (b == NULL) return GDK_FAIL; } if (b) { assert(!isVIEW(b)); assert(b->batRole == PERSISTENT); BATcommit(b); } } } return GDK_SUCCEED; }
str TRNtrans_commit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p) { int i, *bid; BAT *b; (void) cntxt; (void) mb; for (i = p->retc; i < p->argc; i++) { bid = (int *) getArgReference(stk, p, i); if ((b = BATdescriptor(*bid)) == NULL) { throw(MAL, "transaction.commit", RUNTIME_OBJECT_MISSING); } BATcommit(b); BBPunfix(b->batCacheid); } return MAL_SUCCEED; }
log_bid temp_copy(log_bid b, int temp) { /* make a copy of b, if temp is set only create a empty bat */ BAT *o = temp_descriptor(b); BAT *c; log_bid r; if (!temp) { c = BATcopy(o, o->htype, o->ttype, TRUE); bat_set_access(c, BAT_READ); BATcommit(c); } else { c = bat_new(o->htype, o->ttype, COLSIZE); } r = temp_create(c); bat_destroy(c); bat_destroy(o); return r; }
log_bid eubat_copy(log_bid b, int temp) { /* make a copy of b */ BAT *o = temp_descriptor(b); BAT *c; log_bid r; if (!eubats[o->ttype]) eubats[o->ttype] = bat_new(TYPE_oid, o->ttype, 0, TRANSIENT); if (!temp && BATcount(o)) { c = BATcopy(o, TYPE_oid, o->ttype, TRUE, PERSISTENT); BATcommit(c); r = temp_create(c); bat_set_access(c, BAT_READ); bat_destroy(c); } else { c = eubats[o->ttype]; r = temp_create(c); } bat_destroy(o); return r; }