Fixed remaining warnings, got rid of alTupdate

This commit is contained in:
Sears Russell 2006-05-25 20:08:12 +00:00
parent fda416090b
commit b5d578f4e0
10 changed files with 69 additions and 33 deletions

View file

@ -59,7 +59,7 @@ env_open(DB_ENV **dbenvp)
}*/
dbenv->set_tx_max(dbenv, 32000);
int max;
unsigned int max;
dbenv->get_tx_max(dbenv, &max);
printf("Max xact count: %d\n", max);

View file

@ -130,12 +130,16 @@ terms specified in this license.
#define OPERATION_LINEAR_HASH_INSERT 31
#define OPERATION_LINEAR_HASH_REMOVE 32
#define OPERATION_SET_RAW 33
#define OPERATION_INSTANT_SET_RAW 34
// these operations are specific to OASYS
#define OPERATION_OASYS_DIFF_DO 33
#define OPERATION_OASYS_DIFF_REDO 34
#define OPERATION_OASYS_DIFF_UNDO 35
#define OPERATION_OASYS_SEMIDIFF_DO 36
#define OPERATION_OASYS_SEMIDIFF_REDO 37
#define OPERATION_OASYS_DIFF_DO 35
#define OPERATION_OASYS_DIFF_REDO 36
#define OPERATION_OASYS_DIFF_UNDO 37
#define OPERATION_OASYS_SEMIDIFF_DO 38
#define OPERATION_OASYS_SEMIDIFF_REDO 39
/* number above should be less than number below */

View file

@ -58,5 +58,6 @@ terms specified in this license.
#define TinstantSet(xid,rid,dat) Tupdate(xid,rid,dat, OPERATION_INSTANT_SET)
Operation getInstantSet();
Operation getInstantSetRaw();
#endif

View file

@ -63,6 +63,7 @@ terms specified in this license.
#define Tset(xid,rid,dat) Tupdate(xid,rid,dat, OPERATION_SET)
Operation getSet();
Operation getSetRaw();
Operation getSetRangeInverse();
Operation getSetRange();

View file

@ -166,24 +166,30 @@ static compensated_function int TarrayListExtendInternal(int xid, recordid rid,
DEBUG("block %d\n", i);
/* We used to call OPERATION_INITIALIZE_FIXED_PAGE on each page in current indirection block. */
tmp.slot = i + FIRST_DATA_PAGE_OFFSET;
alTupdate(xid, tmp, &newFirstPage, op);
// alTupdate(xid, tmp, &newFirstPage, op);
/**
@XXX the calls to Tupdate in arrayList.c are bypassing operation implementations.
*/
Tupdate(xid, tmp, &newFirstPage, op);
DEBUG("Tset: {%d, %d, %d} = %d\n", tmp.page, tmp.slot, tmp.size, newFirstPage);
}
tmp.slot = MAX_OFFSET_POSITION;
int newMaxOffset = tlp.maxOffset+slots;
alTupdate(xid, tmp, &newMaxOffset, op);
// alTupdate(xid, tmp, &newMaxOffset, op);
Tupdate(xid, tmp, &newMaxOffset, op);
} end_ret(compensation_error());
return 0;
}
compensated_function int TarrayListInstantExtend(int xid, recordid rid, int slots) {
return TarrayListExtendInternal(xid, rid, slots, OPERATION_INSTANT_SET);
return TarrayListExtendInternal(xid, rid, slots, OPERATION_INSTANT_SET_RAW);
}
compensated_function int TarrayListExtend(int xid, recordid rid, int slots) {
return TarrayListExtendInternal(xid, rid, slots, OPERATION_SET);
return TarrayListExtendInternal(xid, rid, slots, OPERATION_SET_RAW);
}
static int operateInitFixed(int xid, Page * p, lsn_t lsn, recordid rid, const void * dat) {

View file

@ -64,6 +64,15 @@ Operation getInstantSet() {
};
return o;
}
Operation getInstantSetRaw() {
Operation o = {
OPERATION_INSTANT_SET_RAW, /* id */
SIZEOF_RECORD, /* use the size of the record as size of arg */
OPERATION_NOOP,
&operate /* Function */
};
return o;
}
/** @todo The spirit of instantSet suggests that it should hold a

View file

@ -310,8 +310,10 @@ void instant_update_hash_header(int xid, recordid hash, int i, int next_split) {
logical consistency to the buckets' linked lists. Then, call instant_rehash
to complete the split.
@todo Need to test recover_split, and figure out where to call it!
@XXX Need to test recover_split, and figure out where to call it!
*/
static void recover_split(int xid, recordid hashRid, int i, int next_split, int keySize, int valSize) __attribute__((unused));
static void recover_split(int xid, recordid hashRid, int i, int next_split, int keySize, int valSize) {
// This function would be simple, except for the ridiculous mount
// of state that it must maintain. See above for a description of what it does.

View file

@ -140,6 +140,15 @@ Operation getSet() {
};
return o;
}
Operation getSetRaw() {
Operation o = {
OPERATION_INSTANT_SET, /* id */
SIZEOF_RECORD, /* use the size of the record as size of arg */
NO_INVERSE,
&operate /* Function */
};
return o;
}
Operation getSetRange() {
Operation o = {

View file

@ -79,6 +79,9 @@ void setupOperationsTable() {
operationsTable[OPERATION_LINEAR_HASH_INSERT] = getLinearHashInsert();
operationsTable[OPERATION_LINEAR_HASH_REMOVE] = getLinearHashRemove();
operationsTable[OPERATION_SET_RAW] = getSetRaw();
operationsTable[OPERATION_INSTANT_SET_RAW] = getInstantSetRaw();
/*
int i;
@ -192,6 +195,7 @@ compensated_function void Tupdate(int xid, recordid rid, const void *dat, int op
try {
p = loadPage(xid, rid.page);
} end;
if(op != OPERATION_SET_RAW && op != OPERATION_INSTANT_SET_RAW) {
if(*page_type_ptr(p) == INDIRECT_PAGE) {
releasePage(p);
try {
@ -210,7 +214,7 @@ compensated_function void Tupdate(int xid, recordid rid, const void *dat, int op
p = loadPage(xid, rid.page);
} end;
}
}
/** @todo For logical undo logs, grabbing a lock makes no sense! */
begin_action(releasePage, p) {
TupdateHelper(xid, rid, dat, op, p);
@ -218,7 +222,7 @@ compensated_function void Tupdate(int xid, recordid rid, const void *dat, int op
}
compensated_function void alTupdate(int xid, recordid rid, const void *dat, int op) {
/*compensated_function void alTupdate(int xid, recordid rid, const void *dat, int op) {
Page * p ;
try {
p = loadPage(xid, rid.page);
@ -228,7 +232,7 @@ compensated_function void alTupdate(int xid, recordid rid, const void *dat, int
TupdateHelper(xid, rid, dat, op, p);
} compensate;
}
}*/
void TreadUnlocked(int xid, recordid rid, void * dat) {

View file

@ -133,7 +133,7 @@ int truncateNow() {
lsn_t rec_lsn = page_rec_lsn < xact_rec_lsn ? page_rec_lsn : xact_rec_lsn;
lsn_t log_trunc = LogTruncationPoint();
if((xact_rec_lsn - log_trunc) > MIN_INCREMENTAL_TRUNCATION) {
printf("xact = %ld \t log = %ld\n", xact_rec_lsn, log_trunc);
//printf("xact = %ld \t log = %ld\n", xact_rec_lsn, log_trunc);
if((rec_lsn - log_trunc) > MIN_INCREMENTAL_TRUNCATION) {
printf("Truncating now. rec_lsn = %ld, log_trunc = %ld\n", rec_lsn, log_trunc);
LogTruncate(rec_lsn);