added method to access dirtyPageTable

This commit is contained in:
Sears Russell 2009-08-05 20:02:33 +00:00
parent 573cbaa98e
commit a6aa8ed942
8 changed files with 22 additions and 12 deletions

View file

@ -80,11 +80,10 @@ int main(int argc, char ** argv) {
for(long i =0; i < page_count; i++) {
Page * p = loadPage(-1, i);
stasis_dirty_page_table_set_dirty(stasis_dirty_page_table, p);
stasis_dirty_page_table_set_dirty(stasis_runtime_dirty_page_table(), p);
releasePage(p);
}
Tdeinit();
return 0;
}

View file

@ -56,7 +56,7 @@ void TlsmRegionForceRid(int xid, void *conf) {
a.regionList.slot = i;
pageid_t pid;
Tread(xid,a.regionList,&pid);
stasis_dirty_page_table_flush_range(stasis_dirty_page_table, pid, pid+a.regionSize);
stasis_dirty_page_table_flush_range(stasis_runtime_dirty_page_table(), pid, pid+a.regionSize);
// TregionDealloc(xid,pid);
}
}

View file

@ -273,6 +273,14 @@ static void TregionAllocHelper(int xid, pageid_t page, pageid_t pageCount, int a
new_tag.size = PAGEID_T_MAX;
// We're extending the page file, so pre-fill the stasis buffer manager with dirty zeros. This
// prevents the file from becoming sparse.
for(pageid_t i = page+1; i < newPageid; i++) {
Page * p = loadUninitializedPage(xid, i);
stasis_dirty_page_table_set_dirty(stasis_runtime_dirty_page_table(), p);
releasePage(p);
}
}
new_tag.prev_size = pageCount;
// Create the new region, and disassociate it from this transaction immediately.

View file

@ -25,7 +25,7 @@ void rawPageSetData(int xid, lsn_t lsn, Page * p) {
// writelock(p->rwlatch, 255);
rawPageWriteLSN(xid, p, lsn);
// XXX should be handled in releasePage.
stasis_dirty_page_table_set_dirty(stasis_dirty_page_table, p);
stasis_dirty_page_table_set_dirty(stasis_runtime_dirty_page_table(), p);
// unlock(p->rwlatch);
return;
}

View file

@ -29,7 +29,6 @@ static int stasis_transaction_table_num_active = 0;
static int stasis_transaction_table_xid_count = 0;
static stasis_log_t* stasis_log_file = 0;
// XXX should be static!
stasis_dirty_page_table_t * stasis_dirty_page_table = 0;
static stasis_truncation_t * stasis_truncation = 0;
/**
@ -51,6 +50,10 @@ void stasis_transaction_table_init() {
}
}
void * stasis_runtime_dirty_page_table() {
return stasis_dirty_page_table;
}
int Tinit() {
pthread_mutex_init(&stasis_transaction_table_mutex, NULL);
stasis_initted = 1;
@ -60,7 +63,6 @@ int Tinit() {
stasis_transaction_table_init();
stasis_operation_table_init();
stasis_dirty_page_table_init();
stasis_log_file = 0;

View file

@ -10,6 +10,7 @@
#include <set>
#include "lsmIterators.h"
#include <stasis/truncation.h>
#include <stasis/dirtyPageTable.h>
namespace rose {
@ -93,7 +94,7 @@ namespace rose {
rose::slot_index_t ret = mc->append(xid, *i);
if(ret == rose::NOSPACE) {
stasis_dirty_page_table_set_dirty(stasis_dirty_page_table, p);
stasis_dirty_page_table_set_dirty((stasis_dirty_page_table_t*)stasis_runtime_dirty_page_table(), p);
mc->pack();
unlock(p->rwlatch);
releasePage(p);
@ -108,7 +109,7 @@ namespace rose {
}
(*inserted)++;
}
stasis_dirty_page_table_set_dirty(stasis_dirty_page_table, p);
stasis_dirty_page_table_set_dirty((stasis_dirty_page_table_t*)stasis_runtime_dirty_page_table(), p);
mc->pack();
unlock(p->rwlatch);
releasePage(p);

View file

@ -794,6 +794,10 @@ void TtruncateLog();
* that stasis_log_file is no longer global.
*/
void * stasis_log(void);
/**
* XXX if releasePage kept the dirty page table up to date, it would greatly reduce the number of places where the dirty page table is updated.
*/
void * stasis_runtime_dirty_page_table();
#include "operations.h"

View file

@ -76,9 +76,5 @@ void stasis_truncation_thread_start(stasis_truncation_t* trunc);
Initiate a round of log truncation.
*/
int stasis_truncation_truncate(stasis_truncation_t* trunc, int force);
/**
* XXX if releasePage kept the dirty page table up to date, it would greatly reduce the number of places where the dirty page table is updated.
*/
extern stasis_dirty_page_table_t * stasis_dirty_page_table;
END_C_DECLS
#endif