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:
parent
f5ff26b233
commit
80ed16c18e
8 changed files with 26 additions and 14 deletions
|
@ -1,3 +1,3 @@
|
||||||
LDADD=-ldb -lpthread
|
LDADD=-lpthread
|
||||||
bin_PROGRAMS=transapp bdbRaw bdbHash bdbHashThreaded bdbHashWriteRequests
|
bin_PROGRAMS=transapp bdbRaw bdbHash bdbHashThreaded bdbHashWriteRequests
|
||||||
AM_CFLAGS=-g
|
AM_CFLAGS=-g
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
#ifndef __CONSUMER_H
|
#ifndef __CONSUMER_H
|
||||||
#define __ITERATOR_H
|
#define __ITERATOR_H
|
||||||
|
|
||||||
#define MAX_ITERATOR_TYPES 10
|
#define MAX_ITERATOR_TYPES 10
|
||||||
#define FIFO_CONSUMER 0
|
#define FIFO_CONSUMER 0
|
||||||
#define ARRAY_CONSUMER 1
|
#define ARRAY_CONSUMER 1
|
||||||
|
#define LOG_MEMORY_CONSUMER 2
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int foo;
|
int foo;
|
||||||
|
@ -22,8 +23,7 @@ void consumer_init();
|
||||||
void Tconsumer_close(int xid, lladdConsumer_t * it);
|
void Tconsumer_close(int xid, lladdConsumer_t * it);
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@param xid Transaction id
|
@param xid Transaction id @param it The consumer
|
||||||
@param it The consumer
|
|
||||||
@param key Can be null if there is no key.
|
@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???)
|
@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, ....);
|
//int Tconsumer_tryPush(int xid, ....);
|
||||||
|
|
||||||
#endif
|
#endif // __CONSUMER_H
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#define MAX_ITERATOR_TYPES 10
|
#define MAX_ITERATOR_TYPES 10
|
||||||
#define LINEAR_HASH_NTA_ITERATOR 0
|
#define LINEAR_HASH_NTA_ITERATOR 0
|
||||||
#define ARRAY_ITERATOR 1
|
#define ARRAY_ITERATOR 1
|
||||||
|
#define LOG_MEMORY_ITERATOR 2
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
// void * new(void * arg);
|
// void * new(void * arg);
|
||||||
|
@ -13,6 +14,7 @@ typedef struct {
|
||||||
int (*next) (int xid, void * it);
|
int (*next) (int xid, void * it);
|
||||||
int (*key) (int xid, void * it, byte ** key);
|
int (*key) (int xid, void * it, byte ** key);
|
||||||
int (*value)(int xid, void * it, byte ** value);
|
int (*value)(int xid, void * it, byte ** value);
|
||||||
|
int (*releaseTuple)(int xid, void * it);
|
||||||
} lladdIterator_def_t;
|
} lladdIterator_def_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -38,6 +40,14 @@ void Titerator_close(int xid, lladdIterator_t * it);
|
||||||
*/
|
*/
|
||||||
int Titerator_next(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
|
This function allows the caller to access the current iterator
|
||||||
position. When an iterator is initialized, it is in the 'null'
|
position. When an iterator is initialized, it is in the 'null'
|
||||||
|
|
4
m4/db.m4
4
m4/db.m4
|
@ -96,7 +96,7 @@ AC_DEFUN([AC_FIND_DB], [
|
||||||
if test ! x"$ac_dbdir" = x"yes" ; then
|
if test ! x"$ac_dbdir" = x"yes" ; then
|
||||||
ac_dbincdirs=$ac_dbdir/include
|
ac_dbincdirs=$ac_dbdir/include
|
||||||
else
|
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/include/db$ac_dbver"
|
||||||
ac_dbincdirs="$ac_dbincdirs /usr/local/BerkeleyDB.$ac_dbver/include"
|
ac_dbincdirs="$ac_dbincdirs /usr/local/BerkeleyDB.$ac_dbver/include"
|
||||||
fi
|
fi
|
||||||
|
@ -104,7 +104,7 @@ AC_DEFUN([AC_FIND_DB], [
|
||||||
if test ! x"$ac_dbdir" = x"yes" ; then
|
if test ! x"$ac_dbdir" = x"yes" ; then
|
||||||
ac_dblibdirs="$ac_dbdir/lib"
|
ac_dblibdirs="$ac_dbdir/lib"
|
||||||
else
|
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"
|
ac_dblibdirs="$ac_dblibdirs /usr/local/BerkeleyDB.$ac_dbver/lib"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ lib_LIBRARIES=liblladd.a
|
||||||
# removed: recovery.c transactional.c logger.c logger/logparser.c logger/logstreamer.c
|
# 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 \
|
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 \
|
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/logEntry.c logger/logWriter.c logger/logHandle.c logger/logger2.c \
|
||||||
logger/logMemory.c multiplexer.c\
|
logger/logMemory.c multiplexer.c\
|
||||||
page/slotted.c page/header.c page/fixed.c compensations.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/naiveLinearHash.c operations/nestedTopActions.c \
|
||||||
operations/linearHashNTA.c operations/linkedListNTA.c \
|
operations/linearHashNTA.c operations/linkedListNTA.c \
|
||||||
operations/pageOrientedListNTA.c
|
operations/pageOrientedListNTA.c
|
||||||
|
|
||||||
|
# logger/logMemory.c \ ringbuffer.c \ asdfas
|
||||||
#operations/lladdhash.c
|
#operations/lladdhash.c
|
||||||
AM_CFLAGS= -g -Wall -pedantic -std=gnu99
|
AM_CFLAGS= -g -Wall -pedantic -std=gnu99
|
||||||
|
|
|
@ -287,7 +287,7 @@ void allocBlob(int xid, Page * p, lsn_t lsn, recordid rid) {
|
||||||
fdatasync(fileno(blobf0));
|
fdatasync(fileno(blobf0));
|
||||||
fdatasync(fileno(blobf1));
|
fdatasync(fileno(blobf1));
|
||||||
#else
|
#else
|
||||||
#warn Not using fdatasync
|
//#warn Not using fdatasync
|
||||||
fsync(fileno(blobf0));
|
fsync(fileno(blobf0));
|
||||||
fsync(fileno(blobf1));
|
fsync(fileno(blobf1));
|
||||||
#endif
|
#endif
|
||||||
|
@ -434,7 +434,7 @@ void writeBlob(int xid, Page * p, lsn_t lsn, recordid rid, const void * buf) {
|
||||||
#ifdef HAVE_FDATASYNC
|
#ifdef HAVE_FDATASYNC
|
||||||
fdatasync(fileno(fd));
|
fdatasync(fileno(fd));
|
||||||
#else
|
#else
|
||||||
#warn Not using fdatasync()
|
//#warn Not using fdatasync()
|
||||||
fsync(fileno(fd));
|
fsync(fileno(fd));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ void pageInit() {
|
||||||
int ret = posix_memalign((void*)(&(pool[i].memAddr)), PAGE_SIZE, PAGE_SIZE);
|
int ret = posix_memalign((void*)(&(pool[i].memAddr)), PAGE_SIZE, PAGE_SIZE);
|
||||||
assert(!ret);
|
assert(!ret);
|
||||||
#else
|
#else
|
||||||
#warn Not using posix_memalign
|
//#warn Not using posix_memalign
|
||||||
pool[i].memAddr = malloc(PAGE_SIZE);
|
pool[i].memAddr = malloc(PAGE_SIZE);
|
||||||
assert(pool[i].memAddr);
|
assert(pool[i].memAddr);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -133,7 +133,7 @@ void openPageFile() {
|
||||||
// O_DIRECT is broken under linux 2.4..
|
// O_DIRECT is broken under linux 2.4..
|
||||||
stable = open (STORE_FILE, O_CREAT | O_RDWR /*| O_DIRECT*/, S_IRWXU | S_IRWXG | S_IRWXO);
|
stable = open (STORE_FILE, O_CREAT | O_RDWR /*| O_DIRECT*/, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
#else
|
#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.
|
// 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);
|
stable = open (STORE_FILE, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue