Added the base functionality and test case for the BTree... just a hello world method. but it has the h, c and check files. -colleen ;)

This commit is contained in:
Colleen M. Lewis 2005-05-05 21:34:12 +00:00
parent 9fb39c14ce
commit 345f0cde78
7 changed files with 59 additions and 4 deletions

View file

@ -161,6 +161,7 @@ typedef struct {
#include "operations/instantSet.h"
#include "operations/arrayList.h"
#include "operations/linearHash.h"
#include "operations/bTree.h"
#include "operations/naiveLinearHash.h"
#include "operations/nestedTopActions.h"
#include "operations/linkedListNTA.h"

6
lladd/operations/bTree.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef __B_TREE_H
#define __B_TREE_H
int HelloWorld();
#endif

View file

@ -66,6 +66,7 @@ terms specified in this license.
/*#define REUSE_PAGES */
compensated_function int TpageAlloc(int xid/*, int type*/);
compensated_function recordid TfixedPageAlloc(int xid, int size);
compensated_function int TpageAllocMany(int xid, int count/*, int type*/);
compensated_function int TpageDealloc(int xid, int pageid);
compensated_function int TpageSet(int xid, int pageid, byte* dat);

View file

@ -15,7 +15,7 @@ liblladd_a_SOURCES=crc32.c common.c stats.c io.c bufferManager.c linkedlist.c op
operations/arrayList.c hash.c operations/linearHash.c \
operations/naiveLinearHash.c operations/nestedTopActions.c \
operations/linearHashNTA.c operations/linkedListNTA.c \
operations/pageOrientedListNTA.c
operations/pageOrientedListNTA.c operations/bTree.c
# logger/logMemory.c \ ringbuffer.c \ asdfas
#operations/lladdhash.c

View file

@ -0,0 +1,20 @@
#define __USE_GNU
#define _GNU_SOURCE
#include <pthread.h>
#include <lladd/transactional.h>
#include <lladd/hash.h>
#include "../page.h"
#include "../page/slotted.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <lladd/operations/noop.h>
#include <lladd/fifo.h>
#include <lladd/multiplexer.h>
#include "../logger/logMemory.h"
#include <stdio.h>
int HelloWorld(){
printf("hello");
return 0;
}

View file

@ -7,6 +7,8 @@
/*#include "../page/slotted.h"*/
#include "../page/header.h"
#include "../pageFile.h"
#include "../page/fixed.h"
#include <alloca.h>
#ifdef REUSE_PAGES
static int freelist;
@ -299,6 +301,31 @@ compensated_function int TpageAlloc(int xid /*, int type */) {
return newpage;
}
/**
@todo TfixedPageAlloc is a huge hack, and it writes an extra 4k to
the log each time it is called.
@return a recordid. The page field contains the page that was
allocated, the slot field contains the number of slots on the
apge, and the size field contains the size of each slot.
*/
recordid TfixedPageAlloc(int xid, int size) {
int page = TpageAlloc(xid);
Page * p = loadPage(xid, page);
fixedPageInitialize(p , xid, recordsPerPage(size));
byte * tmpMemAddr = alloca(PAGE_SIZE);
memcpy(tmpMemAddr, p->memAddr, PAGE_SIZE);
TpageSet(xid, page, tmpMemAddr);
releasePage(p);
recordid rid;
rid.page = page;
rid.slot = recordsPerPage(size);
rid.size = size;
return rid;
}
compensated_function int TpageAllocMany(int xid, int count /*, int type*/) {
/* int firstPage = -1;
int lastPage = -1; */

View file

@ -1,12 +1,12 @@
# INCLUDES = @CHECK_CFLAGS@
if HAVE_LIBCHECK
## Had to disable check_lht because lht needs to be rewritten.
TESTS = check_logEntry check_logWriter check_page check_operations check_transactional2 check_recovery check_blobRecovery check_bufferManager check_indirect check_pageOperations check_linearHash check_logicalLinearHash check_header check_linkedListNTA check_linearHashNTA check_pageOrientedList check_lockManager check_compensations check_errorHandling check_ringbuffer check_iterator check_multiplexer
#check_lladdhash
TESTS = check_logEntry check_logWriter check_page check_operations check_transactional2 check_recovery check_blobRecovery check_bufferManager check_indirect check_pageOperations check_linearHash check_logicalLinearHash check_header check_linkedListNTA check_linearHashNTA check_pageOrientedList check_lockManager check_compensations check_errorHandling check_ringbuffer check_iterator check_multiplexer check_bTree
#check_lladdhash
else
TESTS =
endif
noinst_PROGRAMS = $(TESTS)
LDADD = $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a #-lefence
CLEANFILES = check_lht.log check_logEntry.log storefile.txt logfile.txt blob0_file.txt blob1_file.txt check_blobRecovery.log check_logWriter.log check_operations.log check_recovery.log check_transactional2.log check_page.log check_bufferManager.log check_indirect.log check_bufferMananger.log check_lladdhash.log check_pageOperations.log check_linearhash.log check_linkedListNTA.log check_linearHashNTA.log check_pageOrientedListNTA.log check_lockManager.log check_compensations.log check_errorhandling.log check_header.logg check_iterator.log check_linearHash.log check_ringbuffer.log
CLEANFILES = check_lht.log check_logEntry.log storefile.txt logfile.txt blob0_file.txt blob1_file.txt check_blobRecovery.log check_logWriter.log check_operations.log check_recovery.log check_transactional2.log check_page.log check_bufferManager.log check_indirect.log check_bufferMananger.log check_lladdhash.log check_pageOperations.log check_linearhash.log check_linkedListNTA.log check_linearHashNTA.log check_pageOrientedListNTA.log check_lockManager.log check_compensations.log check_errorhandling.log check_header.logg check_iterator.log check_linearHash.log check_ringbuffer.log check_bTree.log
AM_CFLAGS= -g -Wall -pedantic -std=gnu99