diff --git a/src/stasis/CMakeLists.txt b/src/stasis/CMakeLists.txt index 5c0ab3e..5f5f847 100644 --- a/src/stasis/CMakeLists.txt +++ b/src/stasis/CMakeLists.txt @@ -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 diff --git a/src/stasis/Makefile.am b/src/stasis/Makefile.am index 2ea0679..34462b4 100644 --- a/src/stasis/Makefile.am +++ b/src/stasis/Makefile.am @@ -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 \ diff --git a/src/stasis/page.c b/src/stasis/page.c index f43cb07..fdf76de 100644 --- a/src/stasis/page.c +++ b/src/stasis/page.c @@ -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() { diff --git a/src/stasis/page/segment.c b/src/stasis/page/segment.c new file mode 100644 index 0000000..239ca0b --- /dev/null +++ b/src/stasis/page/segment.c @@ -0,0 +1,40 @@ +/* + * segment.c + * + * Created on: Jul 9, 2009 + * Author: sears + */ + +#include + +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; +} diff --git a/stasis/constants.h b/stasis/constants.h index e8eb2b7..021711b 100644 --- a/stasis/constants.h +++ b/stasis/constants.h @@ -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 diff --git a/stasis/page.h b/stasis/page.h index a14312b..e05fa5d 100644 --- a/stasis/page.h +++ b/stasis/page.h @@ -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