Bugfixes (compiles now)
This commit is contained in:
parent
9be3c4edd3
commit
7971df14bf
3 changed files with 31 additions and 20 deletions
|
@ -5,6 +5,26 @@
|
|||
A multiplexer takes an iterator, and splits its output into multiple consumers.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
lladdIterator_t *iterator;
|
||||
lladdConsumer_t *consumer;
|
||||
} lladdFifo_t;
|
||||
|
||||
typedef struct lladdFifoPool_t {
|
||||
lladdFifo_t ** pool;
|
||||
lladdConsumer_t * (*getConsumer)(struct lladdFifoPool_t * pool,
|
||||
byte * multiplexKey,
|
||||
size_t multiplexKeySize);
|
||||
int fifoCount;
|
||||
} lladdFifoPool_t;
|
||||
|
||||
|
||||
void multiplexHashLogByKey(byte * key,
|
||||
size_t keySize,
|
||||
byte * value,
|
||||
size_t valueSize,
|
||||
byte ** multiplexKey,
|
||||
size_t * multiplexKeySize);
|
||||
|
||||
typedef struct {
|
||||
lladdIterator_t * it;
|
||||
|
@ -18,10 +38,10 @@ typedef struct {
|
|||
/** A hash of consumer implementations, keyed on the output of the multiplexKey parameter of *multiplex */
|
||||
pblHashTable_t * consumerHash;
|
||||
/** The next two fields are used to create new consumers on demand. */
|
||||
lladdConsumer_t * (*getConsumer)(void* newConsumerArg,
|
||||
lladdConsumer_t * (*getConsumer)(struct lladdFifoPool_t * newConsumerArg,
|
||||
byte* multiplexKey,
|
||||
size_t multiplexKeySize);
|
||||
void * getConsumerArg;
|
||||
lladdFifoPool_t * getConsumerArg;
|
||||
pthread_t worker;
|
||||
int xid;
|
||||
} lladdMultiplexer_t;
|
||||
|
@ -34,10 +54,10 @@ lladdMultiplexer_t * lladdMultiplexer_alloc(int xid, lladdIterator_t * it,
|
|||
size_t valueSize,
|
||||
byte ** multiplexKey,
|
||||
size_t * multiplexKeySize),
|
||||
lladdConsumer_t * getConsumer(void* getConsumerArg,
|
||||
lladdConsumer_t * getConsumer(lladdFifoPool_t * getConsumerArg,
|
||||
byte* multiplexKey,
|
||||
size_t multiplexKeySize),
|
||||
void * getConsumerArg);
|
||||
lladdFifoPool_t * fifoPool);
|
||||
|
||||
/**
|
||||
creates a new thread that will consume input from it, and forward
|
||||
|
@ -61,3 +81,6 @@ int lladdMultiplexer_start(lladdMultiplexer_t * multiplexer, pthread_attr_t * th
|
|||
@todo lladdMultiplex_join does not propagate compensation errors as it should.
|
||||
*/
|
||||
int lladdMultiplexer_join(lladdMultiplexer_t * multiplexer);
|
||||
|
||||
lladdConsumer_t * fifoPool_getConsumerCRC32( lladdFifoPool_t * pool, byte * multiplexKey, size_t multiplexKeySize);
|
||||
lladdFifoPool_t * fifoPool_ringBufferInit (int consumerCount, int bufferSize);
|
||||
|
|
|
@ -9,16 +9,16 @@ lladdMultiplexer_t * lladdMultiplexer_alloc(int xid, lladdIterator_t * it,
|
|||
size_t valueSize,
|
||||
byte ** multiplexKey,
|
||||
size_t * multiplexKeySize),
|
||||
lladdConsumer_t * getConsumer(void* getConsumerArg,
|
||||
lladdConsumer_t * getConsumer(struct lladdFifoPool_t* getConsumerArg,
|
||||
byte* multiplexKey,
|
||||
size_t multiplexKeySize),
|
||||
void * getConsumerArg) {
|
||||
lladdFifoPool_t * fifoPool) {
|
||||
lladdMultiplexer_t * ret = malloc(sizeof(lladdMultiplexer_t));
|
||||
ret->it = it;
|
||||
ret->multiplexer = multiplexer;
|
||||
ret->consumerHash = pblHtCreate();
|
||||
ret->getConsumer = getConsumer;
|
||||
ret->getConsumerArg = getConsumerArg;
|
||||
ret->getConsumerArg = fifoPool;
|
||||
ret->xid = xid;
|
||||
return ret;
|
||||
}
|
||||
|
@ -73,23 +73,11 @@ void * multiplexer_worker(void * arg) {
|
|||
*********************************************************************/
|
||||
// @todo remove the code until the //-----, as it just makes up for code that Jimmy needs to commit!
|
||||
|
||||
typedef struct {
|
||||
lladdIterator_t *iterator;
|
||||
lladdConsumer_t *consumer;
|
||||
} lladdFifo_t;
|
||||
|
||||
lladdFifo_t * logMemory_init(int bufferSize, int initialLSN);
|
||||
|
||||
//---------
|
||||
|
||||
typedef struct lladdFifoPool_t {
|
||||
lladdFifo_t ** pool;
|
||||
lladdConsumer_t * (*getConsumer)(struct lladdFifoPool_t * pool,
|
||||
byte * multiplexKey,
|
||||
size_t multiplexKeySize);
|
||||
int fifoCount;
|
||||
} lladdFifoPool_t;
|
||||
|
||||
|
||||
|
||||
void multiplexHashLogByKey(byte * key,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# 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
|
||||
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
|
||||
else
|
||||
TESTS =
|
||||
|
|
Loading…
Reference in a new issue