Initial implementation of logMemory.c. Haven't yet done any testing, but it seems to compile. However, as of now, the current source code in the cvs repository does not build, dying on check_<somehting (I think ringbuffer.x)>, due to an a reference to an undefined symbol 'mutex'.

This commit is contained in:
Jimmy Kittiyachavalit 2005-03-14 20:54:06 +00:00
parent f5ff26b233
commit 80ed16c18e
8 changed files with 26 additions and 14 deletions

View file

@ -1,3 +1,3 @@
LDADD=-ldb -lpthread
LDADD=-lpthread
bin_PROGRAMS=transapp bdbRaw bdbHash bdbHashThreaded bdbHashWriteRequests
AM_CFLAGS=-g

View file

@ -3,9 +3,10 @@
#ifndef __CONSUMER_H
#define __ITERATOR_H
#define MAX_ITERATOR_TYPES 10
#define FIFO_CONSUMER 0
#define ARRAY_CONSUMER 1
#define MAX_ITERATOR_TYPES 10
#define FIFO_CONSUMER 0
#define ARRAY_CONSUMER 1
#define LOG_MEMORY_CONSUMER 2
typedef struct {
int foo;
@ -22,8 +23,7 @@ void consumer_init();
void Tconsumer_close(int xid, lladdConsumer_t * it);
/**
@param xid Transaction id
@param it The consumer
@param xid Transaction id @param it The consumer
@param key Can be null if there is no key.
@param value Can be null if there is no value, but both can't be null. (Or can they???)
@ -37,4 +37,4 @@ int Tconsumer_push(int xid, lladdConsumer_t * it, byte * key, size_t keySize, by
*/
//int Tconsumer_tryPush(int xid, ....);
#endif
#endif // __CONSUMER_H

View file

@ -6,6 +6,7 @@
#define MAX_ITERATOR_TYPES 10
#define LINEAR_HASH_NTA_ITERATOR 0
#define ARRAY_ITERATOR 1
#define LOG_MEMORY_ITERATOR 2
typedef struct {
// void * new(void * arg);
@ -13,6 +14,7 @@ typedef struct {
int (*next) (int xid, void * it);
int (*key) (int xid, void * it, byte ** key);
int (*value)(int xid, void * it, byte ** value);
int (*releaseTuple)(int xid, void * it);
} lladdIterator_def_t;
typedef struct {
@ -38,6 +40,14 @@ void Titerator_close(int xid, lladdIterator_t * it);
*/
int Titerator_next(int xid, lladdIterator_t * it);
/**
NOTE: next acquires a mutex, releaseTuple releases mutex,
next key value --atomic
provides , allows iterator to clean up if necessary
> such as release lock
*/
int (*releaseTuple)(int xid, void * it);
/**
This function allows the caller to access the current iterator
position. When an iterator is initialized, it is in the 'null'

View file

@ -96,7 +96,7 @@ AC_DEFUN([AC_FIND_DB], [
if test ! x"$ac_dbdir" = x"yes" ; then
ac_dbincdirs=$ac_dbdir/include
else
ac_dbincdirs="/usr/include /usr/local/include/db4"
ac_dbincdirs="/usr/include /usr/local/include/db4 /usr/local/include/db42"
ac_dbincdirs="$ac_dbincdirs /usr/include/db$ac_dbver"
ac_dbincdirs="$ac_dbincdirs /usr/local/BerkeleyDB.$ac_dbver/include"
fi
@ -104,7 +104,7 @@ AC_DEFUN([AC_FIND_DB], [
if test ! x"$ac_dbdir" = x"yes" ; then
ac_dblibdirs="$ac_dbdir/lib"
else
ac_dblibdirs="/usr/lib /usr/local/lib"
ac_dblibdirs="/usr/lib /usr/local/lib /usr/local/lib/db42"
ac_dblibdirs="$ac_dblibdirs /usr/local/BerkeleyDB.$ac_dbver/lib"
fi

View file

@ -5,7 +5,7 @@ lib_LIBRARIES=liblladd.a
# removed: recovery.c transactional.c logger.c logger/logparser.c logger/logstreamer.c
liblladd_a_SOURCES=crc32.c common.c stats.c io.c bufferManager.c linkedlist.c operations.c \
pageFile.c pageCache.c page.c blobManager.c recovery2.c transactional2.c \
lockManager.c iterator.c arrayCollection.c \
lockManager.c iterator.c arrayCollection.c ringbuffer.c \
logger/logEntry.c logger/logWriter.c logger/logHandle.c logger/logger2.c \
logger/logMemory.c multiplexer.c\
page/slotted.c page/header.c page/fixed.c compensations.c \
@ -16,5 +16,7 @@ liblladd_a_SOURCES=crc32.c common.c stats.c io.c bufferManager.c linkedlist.c op
operations/naiveLinearHash.c operations/nestedTopActions.c \
operations/linearHashNTA.c operations/linkedListNTA.c \
operations/pageOrientedListNTA.c
# logger/logMemory.c \ ringbuffer.c \ asdfas
#operations/lladdhash.c
AM_CFLAGS= -g -Wall -pedantic -std=gnu99

View file

@ -287,7 +287,7 @@ void allocBlob(int xid, Page * p, lsn_t lsn, recordid rid) {
fdatasync(fileno(blobf0));
fdatasync(fileno(blobf1));
#else
#warn Not using fdatasync
//#warn Not using fdatasync
fsync(fileno(blobf0));
fsync(fileno(blobf1));
#endif
@ -434,7 +434,7 @@ void writeBlob(int xid, Page * p, lsn_t lsn, recordid rid, const void * buf) {
#ifdef HAVE_FDATASYNC
fdatasync(fileno(fd));
#else
#warn Not using fdatasync()
//#warn Not using fdatasync()
fsync(fileno(fd));
#endif

View file

@ -163,7 +163,7 @@ void pageInit() {
int ret = posix_memalign((void*)(&(pool[i].memAddr)), PAGE_SIZE, PAGE_SIZE);
assert(!ret);
#else
#warn Not using posix_memalign
//#warn Not using posix_memalign
pool[i].memAddr = malloc(PAGE_SIZE);
assert(pool[i].memAddr);
#endif

View file

@ -133,7 +133,7 @@ void openPageFile() {
// O_DIRECT is broken under linux 2.4..
stable = open (STORE_FILE, O_CREAT | O_RDWR /*| O_DIRECT*/, S_IRWXU | S_IRWXG | S_IRWXO);
#else
#warn Not using O_DIRECT
//#warn Not using O_DIRECT
// If we don't have posix_memalign(), then we aren't aligning our pages in memory, and can't use O_DIRECT.
stable = open (STORE_FILE, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
#endif