added segment.c

This commit is contained in:
Sears Russell 2009-07-09 21:09:36 +00:00
parent ade1dc896e
commit eb0661ceeb
6 changed files with 51 additions and 3 deletions

View file

@ -14,10 +14,15 @@ ADD_LIBRARY(stasis crc32.c redblack.c lhtable.c rw.c doubleLinkedList.c
logger/filePool.c
logger/inMemoryLog.c
logger/logHandle.c logger/logger2.c
logger/logMemory.c page/raw.c page/slotted.c page/lsnFree.c
logger/logMemory.c
logger/reorderingHandle.c
logger/groupForce.c
page/fixed.c compensations.c
page/slotted.c
page/fixed.c
page/raw.c
page/lsnFree.c
page/segment.c
compensations.c
operations/pageOperations.c
operations/decrement.c operations/increment.c
operations/prepare.c operations/set.c

View file

@ -13,7 +13,7 @@ libstasis_la_SOURCES=crc32.c redblack.c lhtable.c rw.c doubleLinkedList.c common
logger/logMemory.c \
logger/reorderingHandle.c \
logger/groupForce.c \
page/raw.c page/slotted.c page/lsnFree.c page/fixed.c compensations.c \
page/raw.c page/slotted.c page/lsnFree.c page/fixed.c page/segment.c compensations.c \
operations/pageOperations.c operations/decrement.c \
operations/increment.c operations/prepare.c operations/set.c \
operations/alloc.c operations/noop.c \

View file

@ -126,6 +126,7 @@ void stasis_page_init(stasis_dirty_page_table_t * dpt) {
stasis_page_impl_register(stasis_page_blob_impl());
stasis_page_impl_register(lsmRootImpl());
stasis_page_impl_register(slottedLsnFreeImpl());
stasis_page_impl_register(segmentImpl());
}
void stasis_page_deinit() {

40
src/stasis/page/segment.c Normal file
View file

@ -0,0 +1,40 @@
/*
* segment.c
*
* Created on: Jul 9, 2009
* Author: sears
*/
#include <stasis/page.h>
static int notSupported(int xid, Page * p) { return 0; }
page_impl segmentImpl() {
static page_impl pi = {
SEGMENT_PAGE,
0,
0,
0,
0,// readDone
0,// writeDone
0,
0,
0,
0,
0,
notSupported, // is block supported
stasis_block_first_default_impl,
stasis_block_next_default_impl,
stasis_block_done_default_impl,
0,
0,
0,
0,
0,
0, //XXX page_impl_dereference_identity,
0,
0,
0
};
return pi;
}

View file

@ -239,6 +239,7 @@ static const short SLOT_TYPE_LENGTHS[] = { -1, -1, sizeof(blob_record_t), -1};
#define BLOB_PAGE 8
#define LSM_ROOT_PAGE 9
#define SLOTTED_LSN_FREE_PAGE 10
#define SEGMENT_PAGE 11
#define USER_DEFINED_PAGE(n) (100+n) // 0 <= n < 155
#define MAX_PAGE_TYPE 255

View file

@ -901,6 +901,7 @@ int stasis_fixed_records_per_page(size_t size);
void stasis_page_blob_initialize(Page * p);
page_impl slottedLsnFreeImpl();
page_impl segmentImpl();
END_C_DECLS
#endif