Commit 09152fb3 authored by Andreas Schmidt's avatar Andreas Schmidt

Merge branch 'feature/cleanupThread' into develop

parents 98809a7e 067d59ef
......@@ -11,12 +11,6 @@ cdef extern from "pthread.h" nogil:
ctypedef struct pthread_cond_t:
pass
cdef extern from "prrt/stores/forwardPacketTable.h":
cdef struct prrtForwardPacketTable:
pass
ctypedef prrtForwardPacketTable PrrtForwardPacketTable
cdef extern from "prrt/vdmcode/block_code.h":
cdef struct prrtCoder:
pass
......@@ -107,10 +101,6 @@ cdef extern from "prrt/socket.h":
BPTreeNode* dataStore
BPTreeNode* blockStore
PrrtForwardPacketTable* forwardPacketTable
List* receivers
uint16_t packetsCount
......
......@@ -4,12 +4,27 @@ cimport cprrt
cdef extern from "prrt/applicationConstraints.c":
pass
cdef extern from "prrt/stores/dataPacketStore.c":
pass
cdef extern from "prrt/stores/forwardPacketTable.c":
pass
cdef extern from "prrt/stores/lossGatherer.c":
pass
cdef extern from "prrt/stores/packetTimeoutTable.c":
pass
cdef extern from "prrt/stores/repairBlockStore.c":
pass
cdef extern from "prrt/processes/feedbackReceiver.c":
pass
cdef extern from "prrt/processes/cleaner.c":
pass
cdef extern from "prrt/processes/dataReceiver.c":
pass
......
......@@ -12,6 +12,6 @@ add_library(PRRT ../defines.h
stores/lossGatherer.c stores/lossGatherer.h
processes/dataReceiver.c processes/dataReceiver.h
processes/feedbackReceiver.c processes/feedbackReceiver.h
processes/dataTransmitter.c processes/dataTransmitter.h)
processes/dataTransmitter.c processes/dataTransmitter.h processes/cleaner.c processes/cleaner.h stores/repairBlockStore.c stores/repairBlockStore.h stores/packetTimeoutTable.c stores/packetTimeoutTable.h stores/dataPacketStore.c stores/dataPacketStore.h)
set_property(TARGET PRRT PROPERTY C_STANDARD 99)
\ No newline at end of file
......@@ -5,6 +5,9 @@
#include <stdint.h>
#include <stdbool.h>
#define MAX_TIMESTAMP (prrtTimestamp_t) 4294967295
#define HALF_TIMESTAMP (prrtTimestamp_t) 2147483648
typedef struct prrtClock {
prrtTimestamp_t lastMeasurement;
prrtTimedelta_t meanDeviation;
......
#include <unistd.h>
#include "../socket.h"
#include"../../util/dbg.h"
#include "cleaner.h"
void *cleanup(void *ptr)
{
PrrtSocket *socket = ptr;
while(1) {
if(socket->isSender) {
} else {
if(socket->packetTimeoutTable != NULL) {
List *expired_packets = PrrtPacketTimeoutTable_expire_packets(socket->packetTimeoutTable,
PrrtClock_get_prrt_time_us(
socket->clock));
if(List_count(expired_packets) > 0) {
PrrtPacket *first = List_first(expired_packets);
prrtSequenceNumber_t firstSequenceNumberBase = first->sequenceNumber - first->index - SEQNO_SPACE/4;
PrrtPacket *last = List_last(expired_packets);
prrtSequenceNumber_t lastSequenceNumberBase = last->sequenceNumber - last->index - 1;
PrrtRepairBlockStore_expire_block_range(socket->repairBlockStore, firstSequenceNumberBase,
lastSequenceNumberBase);
List *list = List_create();
PrrtDataPacketStore_remove_range(socket->dataPacketStore, list, firstSequenceNumberBase, last->sequenceNumber);
List_destroy(list);
while(List_count(expired_packets) > 0) {
PrrtPacket* packet = (PrrtPacket*) List_shift(expired_packets);
PrrtPacket_destroy(packet);
}
}
List_destroy(expired_packets);
debug("I CLEAN; Data-Store Size: %d, Block-Store Size: %d", PrrtDataPacketStore_size(socket->dataPacketStore), PrrtRepairBlockStore_size(socket->repairBlockStore));
}
}
usleep(1000000);
}
return NULL;
}
#ifndef PRRT_CLEANER_H
#define PRRT_CLEANER_H
void * cleanup(void *ptr);
#endif //PRRT_CLEANER_H
This diff is collapsed.
......@@ -10,11 +10,11 @@
#include "packet.h"
#include "../util/dbg.h"
#include "../util/common.h"
#include "processes/feedbackReceiver.h"
#include "processes/cleaner.h"
#include "processes/dataTransmitter.h"
#include "processes/dataReceiver.h"
#include "processes/feedbackReceiver.h"
#include "socket.h"
#include "block.h"
#include "receiver.h"
PrrtSocket *PrrtSocket_create(const bool is_sender)
......@@ -36,7 +36,9 @@ PrrtSocket *PrrtSocket_create(const bool is_sender)
sock_ptr->csi = PrrtChannelStateInformation_create();
sock_ptr->applicationConstraints = PrrtApplicationConstraints_create();
sock_ptr->dataStore = NULL;
sock_ptr->packetTimeoutTable = PrrtPacketTimeoutTable_create();
sock_ptr->dataPacketStore = PrrtDataPacketStore_create();
check(sock_ptr->dataSocketFd = socket(AF_INET, SOCK_DGRAM, 0), "Cannot create data socket.")
check(sock_ptr->feedbackSocketFd = socket(AF_INET, SOCK_DGRAM, 0), "Cannot create feedback socket.");
......@@ -54,6 +56,7 @@ PrrtSocket *PrrtSocket_create(const bool is_sender)
sock_ptr->receivers = List_create();
} else {
sock_ptr->forwardPacketTable = PrrtForwardPacketTable_create();
sock_ptr->repairBlockStore = PrrtRepairBlockStore_create();
check(pthread_mutex_init(&sock_ptr->inQueueFilledMutex, NULL) == 0, "Mutex init failed.");
check(pthread_cond_init(&sock_ptr->inQueueFilledCv, NULL) == 0, "Cond init failed.");
......@@ -97,6 +100,9 @@ bool PrrtSocket_bind(PrrtSocket *sock_ptr, const char* ipAddress, const uint16_t
"Cannot create data receiving thread.");
}
check(pthread_create(&sock_ptr->cleanupThread, NULL, cleanup, (void *) sock_ptr) ==
EXIT_SUCCESS, "Cannot create cleanup thread.");
return true;
error:
PrrtSocket_close(sock_ptr);
......@@ -185,6 +191,14 @@ int PrrtSocket_interrupt(PrrtSocket *sock_ptr) {
sock_ptr->receiveFeedbackThread = 0;
}
if(sock_ptr->cleanupThread != 0) {
check(pthread_cancel(sock_ptr->cleanupThread) == 0, "Cancel failed.");
check(pthread_join(sock_ptr->cleanupThread, res) == 0, "Join failed.");
sock_ptr->cleanupThread = 0;
}
return EXIT_SUCCESS;
error:
......@@ -201,30 +215,14 @@ int PrrtSocket_close(PrrtSocket *sock_ptr) {
check(pthread_mutex_unlock(&sock_ptr->closingMutex) == 0, "Unlock failed.");
}
if (sock_ptr->dataStore != NULL) {
List *dataList = List_create();
BPTree_get_range(sock_ptr->dataStore, dataList, 0, SEQNO_SPACE - 1);
while (List_count(dataList) > 0) {
PrrtPacket *packet = List_shift(dataList);
PrrtPacket_destroy(packet);
}
List_destroy(dataList);
sock_ptr->dataStore = BPTree_destroy(sock_ptr->dataStore);
if(sock_ptr->dataPacketStore != NULL) {
check(PrrtDataPacketStore_destroy(sock_ptr->dataPacketStore), "Destroy failed.");
sock_ptr->dataPacketStore = NULL;
}
if (sock_ptr->blockStore != NULL) {
List *blockList = List_create();
BPTree_get_range(sock_ptr->blockStore, blockList, 0, SEQNO_SPACE - 1);
while (List_count(blockList) > 0) {
PrrtBlock *block = List_shift(blockList);
PrrtBlock_destroy(block);
}
List_destroy(blockList);
sock_ptr->blockStore = BPTree_destroy(sock_ptr->blockStore);
if(sock_ptr->repairBlockStore != NULL) {
PrrtRepairBlockStore_destroy(sock_ptr->repairBlockStore);
sock_ptr->repairBlockStore = NULL;
}
if (sock_ptr->receivers != NULL) {
......@@ -255,6 +253,11 @@ int PrrtSocket_close(PrrtSocket *sock_ptr) {
sock_ptr->forwardPacketTable = NULL;
}
if(sock_ptr->packetTimeoutTable != NULL) {
check(PrrtPacketTimeoutTable_destroy(sock_ptr->packetTimeoutTable), "Destroy failed.");
sock_ptr->packetTimeoutTable = NULL;
}
check(pthread_mutex_destroy(&sock_ptr->closingMutex) == 0, "Mutex destroy failed.");
if(sock_ptr->address != NULL) {
......@@ -309,10 +312,10 @@ PrrtPacket *PrrtSocket_recv_feedback(PrrtSocket *prrtSocket, const size_t length
check_mem(prrtPacket);
PrrtPacket_decode(bufin, (uint16_t) n, prrtPacket);
PrrtPacketFeedbackPayload* payload = prrtPacket->payload;
struct in_addr a;
a.s_addr = payload->receiverAddress;
debug("Receiver Address: %s", inet_ntoa(a));
//PrrtPacketFeedbackPayload* payload = prrtPacket->payload;
//struct in_addr a;
//a.s_addr = payload->receiverAddress;
//debug("Receiver Address: %s", inet_ntoa(a));
prrtTimestamp_t forwardTripTimestamp = ((PrrtPacketFeedbackPayload*) prrtPacket->payload)->forwardTripTimestamp_us;
......
......@@ -8,6 +8,9 @@
#include "../util/bptree.h"
#include "channelStateInformation.h"
#include "applicationConstraints.h"
#include "stores/dataPacketStore.h"
#include "stores/packetTimeoutTable.h"
#include "stores/repairBlockStore.h"
#include "clock.h"
......@@ -31,9 +34,11 @@ typedef struct prrtSocket {
pthread_cond_t inQueueFilledCv;
List *inQueue;
BPTreeNode* dataStore;
pthread_t cleanupThread;
BPTreeNode* blockStore;
PrrtPacketTimeoutTable* packetTimeoutTable;
PrrtDataPacketStore* dataPacketStore;
PrrtRepairBlockStore* repairBlockStore;
PrrtForwardPacketTable* forwardPacketTable;
......
#include <stdlib.h>
#include <pthread.h>
#include "../../util/common.h"
#include "../../util/bptree.h"
#include "../../util/dbg.h"
#include "../packet.h"
#include "dataPacketStore.h"
PrrtDataPacketStore *PrrtDataPacketStore_create(void)
{
PrrtDataPacketStore* store = calloc(1, sizeof(PrrtDataPacketStore));
check_mem(store);
check(pthread_mutex_init(&store->lock, NULL) == EXIT_SUCCESS, "Init mutex failed.")
store->dataStore = NULL;
return store;
error:
PERROR("Out of memory%s.","");
return NULL;
}
uint32_t PrrtDataPacketStore_size(PrrtDataPacketStore *store)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
uint32_t res = BPTree_size(store->dataStore);
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return res;
error:
PERROR("Getting size failed%s.", "");
return 0;
}
bool PrrtDataPacketStore_destroy(PrrtDataPacketStore *store)
{
List *dataList = List_create();
BPTree_get_range(store->dataStore, dataList, 0, SEQNO_SPACE - 1);
while(List_count(dataList) > 0) {
PrrtPacket *packet = List_shift(dataList);
store->dataStore = BPTree_delete(store->dataStore, packet->sequenceNumber);
PrrtPacket_destroy(packet);
}
List_destroy(dataList);
check(pthread_mutex_destroy(&store->lock) == EXIT_SUCCESS, "Destroy failed.");
if(store->dataStore != NULL) {
store->dataStore = BPTree_destroy(store->dataStore);
}
free(store);
return true;
error:
PERROR("Could not destroy%s.","");
return false;
}
void PrrtDataPacketStore_remove_range(PrrtDataPacketStore *store, List *res, prrtSequenceNumber_t start, prrtSequenceNumber_t stop)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
if(start > stop) {
BPTree_get_range(store->dataStore, res, start, SEQNO_SPACE-1);
BPTree_get_range(store->dataStore, res, 0, stop);
} else {
BPTree_get_range(store->dataStore, res, start, stop);
}
LIST_FOREACH(res, first, next, current) {
PrrtPacket *packet = current->value;
store->dataStore = BPTree_delete(store->dataStore, packet->sequenceNumber);
}
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return;
error:
PERROR("Failed to remove range%s.","");
}
bool PrrtDataStore_insert(PrrtDataPacketStore *store, PrrtPacket *packet)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
if(BPTree_get(store->dataStore, packet->sequenceNumber) == NULL) {
store->dataStore = BPTree_insert(store->dataStore, packet->sequenceNumber, packet);
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return true;
}
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
error:
return false;
}
\ No newline at end of file
#include <stdint.h>
#include <stdbool.h>
#include <bits/pthreadtypes.h>
#ifndef PRRT_DATAPACKETSTORE_H
#define PRRT_DATAPACKETSTORE_H
typedef struct prrtDataPacketStore {
pthread_mutex_t lock;
BPTreeNode* dataStore;
} PrrtDataPacketStore;
PrrtDataPacketStore* PrrtDataPacketStore_create(void);
uint32_t PrrtDataPacketStore_size(PrrtDataPacketStore* store);
void PrrtDataPacketStore_remove_range(PrrtDataPacketStore *store, List *res, prrtSequenceNumber_t start, prrtSequenceNumber_t stop);
bool PrrtDataPacketStore_destroy(PrrtDataPacketStore* store);
bool PrrtDataStore_insert(PrrtDataPacketStore *store, PrrtPacket *packet);
#endif //PRRT_DATAPACKETSTORE_H
......@@ -34,8 +34,6 @@ LossStatistics LossGatherer_calculate_statistics(LossGatherer *lossGatherer, uin
.packetCount = length,
.gapCount = (uint16_t) x0,
.burstCount = (uint16_t) (1 - ((uint16_t) x0)),
};
statistics.gapLength = statistics.gapCount;
statistics.burstLength = statistics.burstCount;
......@@ -64,6 +62,8 @@ LossStatistics LossGatherer_calculate_statistics(LossGatherer *lossGatherer, uin
error:
PERROR("Stats error.%s","");
LossStatistics ls;
return ls;
}
bool LossGatherer_check_loss(LossGatherer *lossGatherer, uint32_t sequenceNumber)
......
......@@ -17,7 +17,7 @@ typedef struct lossStatistics {
uint16_t burstCount;
} LossStatistics;
LossGatherer* LossGatherer_create();
LossGatherer* LossGatherer_create(void);
LossStatistics LossGatherer_calculate_statistics(LossGatherer *lossGatherer, uint32_t start, uint16_t length);
bool LossGatherer_mark_loss(LossGatherer* lossGatherer, uint32_t sequenceNumber);
bool LossGatherer_check_loss(LossGatherer *lossGatherer, uint32_t sequenceNumber);
......
#include "../../util/common.h"
#include "../../util/dbg.h"
#include "../clock.h"
#include "packetTimeoutTable.h"
PrrtPacketTimeoutTable *PrrtPacketTimeoutTable_create(void)
{
PrrtPacketTimeoutTable *table = (PrrtPacketTimeoutTable *) calloc(1, sizeof(PrrtPacketTimeoutTable));
check_mem(table);
table->packetList = NULL;
check(pthread_mutex_init(&table->lock, NULL) == EXIT_SUCCESS, "Init mutex failed.");
return table;
error:
PERROR("Out of memory%s.","");
return NULL;
}
bool PrrtPacketTimeoutTable_destroy(PrrtPacketTimeoutTable *table)
{
List* list = List_create();
BPTree_get_range(table->packetList, list, 0, SEQNO_SPACE - 1);
while (List_count(list) > 0) {
PrrtPacket *packet = List_shift(list);
PrrtPacketDataPayload* payload = packet->payload;
table->packetList = BPTree_delete(table->packetList, payload->packetTimeout_us);
PrrtPacket_destroy(packet);
}
List_destroy(list);
if(table->packetList != NULL) {
table->packetList = BPTree_destroy(table->packetList);
}
pthread_mutex_destroy(&table->lock);
free(table);
return true;
}
bool PrrtPacketTimeoutTable_insert(PrrtPacketTimeoutTable *table, PrrtPacket *packet)
{
check(pthread_mutex_lock(&table->lock) == EXIT_SUCCESS, "Lock failed.");
PrrtPacketDataPayload* payload = packet->payload;
table->packetList = BPTree_insert(table->packetList, payload->packetTimeout_us, packet);
check(pthread_mutex_unlock(&table->lock) == EXIT_SUCCESS, "Unlock failed.");
return true;
error:
PERROR("Insert failed%s.","");
return false;
}
List *PrrtPacketTimeoutTable_expire_packets(PrrtPacketTimeoutTable *table, prrtTimestamp_t now)
{
check(pthread_mutex_lock(&table->lock) == EXIT_SUCCESS, "Lock failed.");
List* list = List_create();
if(table->packetList != NULL) {
if(now > HALF_TIMESTAMP) {
BPTree_get_range(table->packetList, list, now - HALF_TIMESTAMP, now);
} else {
BPTree_get_range(table->packetList, list, 0, now);
BPTree_get_range(table->packetList, list, now - HALF_TIMESTAMP, MAX_TIMESTAMP);
}
}
LIST_FOREACH(list, first, next, current) {
PrrtPacket *packet = current->value;
PrrtPacketDataPayload* payload = packet->payload;
table->packetList = BPTree_delete(table->packetList, payload->packetTimeout_us);
}
check(pthread_mutex_unlock(&table->lock) == EXIT_SUCCESS, "Unlock failed.");
return list;
error:
PERROR("Get expired timestamps failed%s.","");
return NULL;
}
PrrtPacket *PrrtPacketTimeoutTable_remove(PrrtPacketTimeoutTable *table, prrtTimestamp_t stamp)
{
check(pthread_mutex_lock(&table->lock) == EXIT_SUCCESS, "Lock failed.");
PrrtPacket *packet = (PrrtPacket *) BPTree_delete(table->packetList, stamp);
check(pthread_mutex_unlock(&table->lock) == EXIT_SUCCESS, "Unlock failed.");
return packet;
error:
PERROR("Get expired timestamps failed%s.","");
return NULL;
}
#ifndef PRRT_PACKETTIMEOUTTABLE_H
#define PRRT_PACKETTIMEOUTTABLE_H
#include <bits/pthreadtypes.h>
#include "../../util/bptree.h"
#include "../packet.h"
typedef struct prrtPacketTimeoutTable {
pthread_mutex_t lock;
BPTreeNode* packetList;
} PrrtPacketTimeoutTable;
PrrtPacketTimeoutTable* PrrtPacketTimeoutTable_create(void);
bool PrrtPacketTimeoutTable_insert(PrrtPacketTimeoutTable* table, PrrtPacket* packet);
List *PrrtPacketTimeoutTable_expire_packets(PrrtPacketTimeoutTable *table, prrtTimestamp_t now);
PrrtPacket *PrrtPacketTimeoutTable_remove(PrrtPacketTimeoutTable *table, prrtTimestamp_t stamp);
bool PrrtPacketTimeoutTable_destroy(PrrtPacketTimeoutTable* table);
#endif //PRRT_PACKETTIMEOUTTABLE_H
#include <pthread.h>
#include "../../util/dbg.h"
#include "../../util/common.h"
#include "repairBlockStore.h"
PrrtRepairBlockStore *PrrtRepairBlockStore_create(void)
{
PrrtRepairBlockStore *store = (PrrtRepairBlockStore *) calloc(1, sizeof(PrrtRepairBlockStore));
check_mem(store);
check(pthread_mutex_init(&store->lock, NULL) == EXIT_SUCCESS, "Init mutex failed.");
store->blockTree = NULL;
return store;
error:
PERROR("Out of memory%s.", "");
return NULL;
}
bool PrrtRepairBlockStore_destroy(PrrtRepairBlockStore *store)
{
List *blockList = List_create();
BPTree_get_range(store->blockTree, blockList, 0, SEQNO_SPACE - 1);
while (List_count(blockList) > 0) {
PrrtBlock *block = List_shift(blockList);
store->blockTree = BPTree_delete(store->blockTree, block->baseSequenceNumber);
PrrtBlock_destroy(block);
}
List_destroy(blockList);
if(store->blockTree != NULL) {
store->blockTree = BPTree_destroy(store->blockTree);
}
pthread_mutex_destroy(&store->lock);
free(store);
return true;
}
bool PrrtRepairBlockStore_delete(PrrtRepairBlockStore *store, prrtSequenceNumber_t sequenceNumber)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
store->blockTree = BPTree_delete(store->blockTree, sequenceNumber);
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return true;
error:
PERROR("Could not delete%s.","");
return false;
}
PrrtBlock *PrrtRepairBlockStore_get_block(PrrtRepairBlockStore *store, prrtSequenceNumber_t sequenceNumber)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
void *block = BPTree_get(store->blockTree, sequenceNumber);
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return block;
error:
PERROR("Could not get block%s.","");
return NULL;
}
bool PrrtRepairBlockStore_insert(PrrtRepairBlockStore *store, PrrtBlock *block)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
store->blockTree = BPTree_insert(store->blockTree, block->baseSequenceNumber, block);
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return true;
error:
PERROR("Could not insert%s.","");
return false;
}
uint32_t PrrtRepairBlockStore_size(PrrtRepairBlockStore *store)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
uint32_t size = BPTree_size(store->blockTree);
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return size;
error:
PERROR("Could not get size%s.","");
return 0;
}
bool PrrtRepairBlockStore_expire_block_range(PrrtRepairBlockStore *store, prrtSequenceNumber_t start,
prrtSequenceNumber_t stop)
{
check(pthread_mutex_lock(&store->lock) == EXIT_SUCCESS, "Lock failed.");
while(start != stop) {
PrrtBlock* block = BPTree_get(store->blockTree, start);
if(block != NULL) {
PrrtBlock_destroy(block);
store->blockTree = BPTree_delete(store->blockTree, start);
}
start++;
}
check(pthread_mutex_unlock(&store->lock) == EXIT_SUCCESS, "Unlock failed.");
return true;
error:
PERROR("Could not expire%s.","");
return false;
}
#ifndef PRRT_REPAIRBLOCKSTORE_H
#define PRRT_REPAIRBLOCKSTORE_H
#include <bits/pthreadtypes.h>
#include "../packet.h"
#include "../block.h"
#include "../../util/bptree.h"
typedef struct prrtRepairBlockStore {
pthread_mutex_t lock;
BPTreeNode *blockTree;
} PrrtRepairBlockStore;
PrrtRepairBlockStore *PrrtRepairBlockStore_create(void);
bool PrrtRepairBlockStore_delete(PrrtRepairBlockStore *store, prrtSequenceNumber_t sequenceNumber);
PrrtBlock *PrrtRepairBlockStore_get_block(PrrtRepairBlockStore *store, prrtSequenceNumber_t sequenceNumber);
bool PrrtRepairBlockStore_insert(PrrtRepairBlockStore *store, PrrtBlock *block);
bool PrrtRepairBlockStore_expire_block_range(PrrtRepairBlockStore *store, prrtSequenceNumber_t start,
prrtSequenceNumber_t stop);
uint32_t PrrtRepairBlockStore_size(PrrtRepairBlockStore *store);
bool PrrtRepairBlockStore_destroy(PrrtRepairBlockStore *store);
#endif //PRRT_REPAIRBLOCKSTORE_H
This diff is collapsed.
......@@ -43,6 +43,10 @@
#ifndef PRRT_BPTREE_H
#define PRRT_BPTREE_H
#include <stdint.h>
typedef int64_t BPTreeKey_t;
#include "../defines.h"
#include "list.h"
......@@ -58,22 +62,23 @@
*/
typedef struct BPTreeNode {
void ** pointers;
int * keys;
BPTreeKey_t * keys;
struct BPTreeNode * parent;
bool is_leaf;
</