Removed unused abort/commit callbacks.

This commit is contained in:
Sears Russell 2006-07-26 17:48:36 +00:00
parent 62abe94bf5
commit 7888d647ed
8 changed files with 17 additions and 84 deletions

View file

@ -121,35 +121,6 @@ int bufInit();
*/
void bufDeinit();
/**
* all actions necessary when committing a transaction. Can assume that the log
* has been written as well as any other udpates that do not depend on the
* buffer manager
*
* @param xid transaction ID
* @param lsn the lsn at which the transaction aborted. (Currently
* unused, but may be useful for other implementations of the buffer
* manager.)
* @return 0 on success
* @return error code on failure
*/
int bufTransCommit(int xid, lsn_t lsn);
/**
*
* Currently identical to bufTransCommit.
*
* @param xid transaction ID
*
* @param lsn the lsn at which the transaction aborted. (Currently
* unused, but may be useful for other implementations of the buffer
* manager.)
*
* @return 0 on success
* @return error code on failure
*/
int bufTransAbort(int xid, lsn_t lsn);
END_C_DECLS
#endif

View file

@ -386,6 +386,14 @@ void Trevive(int xid, long lsn);
*/
void TsetXIDCount(int xid);
/**
* Checks to see if a transaction is still active.
*
* @param xid The transaction id to be tested.
* @return true if the transacation is still running, false otherwise.
*/
int TisActiveTransaction(int xid);
/**
This is used by log truncation.
*/

View file

@ -68,10 +68,3 @@ void writeBlob(int xid, Page * p2, lsn_t lsn, recordid rid, const byte * buf) {
}
void commitBlobs(int xid) {
}
void abortBlobs(int xid) {
}

View file

@ -56,21 +56,6 @@ void readBlob(int xid, Page * p, recordid rid, void * buf);
*/
void writeBlob(int xid, Page * p, lsn_t lsn, recordid rid, const void * buf);
/**
Atomicly (with respect to recovery) make the dirty version of the
blob the primary copy and mark it not-dirty.
*/
void commitBlobs(int xid);
/**
Revert the blob to the last clean version.
*/
void abortBlobs(int xid);
compensated_function recordid preAllocBlob(int xid, long blobsize);
compensated_function recordid preAllocBlobFromPage(int xid, long page, long blobsize);

View file

@ -151,23 +151,6 @@ void releasePage (Page * p) {
}
int bufTransCommit(int xid, lsn_t lsn) {
commitBlobs(xid);
pageCommit(xid);
if(globalLockManager.commit) { globalLockManager.commit(xid);}
return 0;
}
int bufTransAbort(int xid, lsn_t lsn) {
abortBlobs(xid); /* abortBlobs doesn't write any log entries, so it doesn't need the lsn. */
pageAbort(xid);
if(globalLockManager.abort) { globalLockManager.abort(xid);}
return 0;
}
static Page * getPage(int pageid, int locktype) {
Page * ret;
int spin = 0;

View file

@ -129,12 +129,6 @@ void pageDeInit() {
slottedPageDeInit();
}
void pageCommit(int xid) {
}
void pageAbort(int xid) {
}
void writeRecord(int xid, Page * p, lsn_t lsn, recordid rid, const void *dat) {
assert( (p->id == rid.page) && (p->memAddr != NULL) );

View file

@ -253,14 +253,6 @@ int readRecord(int xid, Page * page, recordid rid, void *dat);
* The same as readRecord, but does not obtain a latch.
*/
int readRecordUnlocked(int xid, Page * p, recordid rid, void *buf);
/**
Should be called when transaction xid commits.
*/
void pageCommit(int xid);
/**
Should be called when transaction xid aborts.
*/
void pageAbort(int xid);
/**
Allocate memory to hold a new page.

View file

@ -299,7 +299,7 @@ int Tcommit(int xid) {
#endif
lsn = LogTransCommit(&XactionTable[xid % MAX_TRANSACTIONS]);
bufTransCommit(xid, lsn); /* unlocks pages */
if(globalLockManager.commit) { globalLockManager.commit(xid); }
pthread_mutex_lock(&transactional_2_mutex);
XactionTable[xid%MAX_TRANSACTIONS].xid = INVALID_XTABLE_XID;
@ -319,7 +319,7 @@ int Tabort(int xid) {
/** @todo is the order of the next two calls important? */
undoTrans(*t/*XactionTable[xid%MAX_TRANSACTIONS]*/);
bufTransAbort(xid, lsn);
if(globalLockManager.abort) { globalLockManager.abort(xid); }
pthread_mutex_lock(&transactional_2_mutex);
@ -392,3 +392,10 @@ lsn_t transactions_minRecLSN() {
return minRecLSN;
}
int TisActiveTransaction(int xid) {
pthread_mutex_lock(&transactional_2_mutex);
int ret = XactionTable[xid%MAX_TRANSACTIONS].xid == xid;
pthread_mutex_unlock(&transactional_2_mutex);
return ret;
}