add memallocator dependency
This commit is contained in:
parent
6cb65f4385
commit
fed05bb64b
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
#include "mallocator.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -91,11 +92,9 @@ typedef struct tmqSubscribeRsp {
|
||||||
} TmqSubscribeRsp;
|
} TmqSubscribeRsp;
|
||||||
|
|
||||||
typedef struct TmqHeartbeatReq {
|
typedef struct TmqHeartbeatReq {
|
||||||
|
|
||||||
} TmqHeartbeatReq;
|
} TmqHeartbeatReq;
|
||||||
|
|
||||||
typedef struct TmqHeartbeatRsp {
|
typedef struct TmqHeartbeatRsp {
|
||||||
|
|
||||||
} TmqHeartbeatRsp;
|
} TmqHeartbeatRsp;
|
||||||
|
|
||||||
typedef struct TqTopicVhandle {
|
typedef struct TqTopicVhandle {
|
||||||
|
@ -107,10 +106,6 @@ typedef struct TqTopicVhandle {
|
||||||
void* (*mCallback)(void*, void*);
|
void* (*mCallback)(void*, void*);
|
||||||
} TqTopicVhandle;
|
} TqTopicVhandle;
|
||||||
|
|
||||||
typedef struct STQ {
|
|
||||||
//the collection of group handle
|
|
||||||
//the handle of kvstore
|
|
||||||
} STQ;
|
|
||||||
|
|
||||||
#define TQ_BUFFER_SIZE 8
|
#define TQ_BUFFER_SIZE 8
|
||||||
|
|
||||||
|
@ -159,9 +154,30 @@ typedef struct TqQueryMsg {
|
||||||
struct TqQueryMsg* next;
|
struct TqQueryMsg* next;
|
||||||
} TqQueryMsg;
|
} TqQueryMsg;
|
||||||
|
|
||||||
//init in each vnode
|
typedef struct TqLogReader {
|
||||||
STQ* tqInit(void* ref_func(void*), void* unref_func(void*));
|
void* logHandle;
|
||||||
void tqCleanUp(STQ*);
|
int32_t (*walRead)(void* logHandle, void** data, int64_t ver);
|
||||||
|
int64_t (*walGetFirstVer)(void* logHandle);
|
||||||
|
int64_t (*walGetSnapshotVer)(void* logHandle);
|
||||||
|
int64_t (*walGetLastVer)(void* logHandle);
|
||||||
|
} TqLogReader;
|
||||||
|
|
||||||
|
typedef struct TqConfig {
|
||||||
|
// TODO
|
||||||
|
} TqConfig;
|
||||||
|
|
||||||
|
typedef struct STQ {
|
||||||
|
// the collection of group handle
|
||||||
|
// the handle of kvstore
|
||||||
|
const char* path;
|
||||||
|
TqConfig* tqConfig;
|
||||||
|
TqLogReader* tqLogReader;
|
||||||
|
SMemAllocatorFactory* allocFac;
|
||||||
|
} STQ;
|
||||||
|
|
||||||
|
// open in each vnode
|
||||||
|
STQ* tqOpen(const char* path, TqConfig* tqConfig, TqLogReader* tqLogReader, SMemAllocatorFactory *allocFac);
|
||||||
|
void tqDestroy(STQ*);
|
||||||
|
|
||||||
// void* will be replace by a msg type
|
// void* will be replace by a msg type
|
||||||
int tqPushMsg(STQ*, void* msg, int64_t version);
|
int tqPushMsg(STQ*, void* msg, int64_t version);
|
||||||
|
|
|
@ -75,9 +75,9 @@ int32_t walRead(SWal *, SWalHead **, int64_t ver);
|
||||||
int32_t walReadWithFp(SWal *, FWalWrite writeFp, int64_t verStart, int32_t readNum);
|
int32_t walReadWithFp(SWal *, FWalWrite writeFp, int64_t verStart, int32_t readNum);
|
||||||
|
|
||||||
// lifecycle check
|
// lifecycle check
|
||||||
int32_t walFirstVer(SWal *);
|
int64_t walGetFirstVer(SWal *);
|
||||||
int32_t walPersistedVer(SWal *);
|
int64_t walGetSnapshotVer(SWal *);
|
||||||
int32_t walLastVer(SWal *);
|
int64_t walGetLastVer(SWal *);
|
||||||
// int32_t walDataCorrupted(SWal*);
|
// int32_t walDataCorrupted(SWal*);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#define _TQ_META_STORE_H_
|
#define _TQ_META_STORE_H_
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "tq.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -27,10 +27,20 @@ void walClose(SWal *pWal) {}
|
||||||
|
|
||||||
void walFsync(SWal *pWal, bool force) {}
|
void walFsync(SWal *pWal, bool force) {}
|
||||||
|
|
||||||
int64_t walWrite(SWal *pWal, int64_t index, void *body, int32_t bodyLen) {}
|
int64_t walWrite(SWal *pWal, int64_t index, void *body, int32_t bodyLen) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t walCommit(SWal *pWal, int64_t ver) { return 0; }
|
int32_t walCommit(SWal *pWal, int64_t ver) { return 0; }
|
||||||
|
|
||||||
int32_t walRollback(SWal *pWal, int64_t ver) { return 0; }
|
int32_t walRollback(SWal *pWal, int64_t ver) { return 0; }
|
||||||
|
|
||||||
int32_t walPrune(SWal *pWal, int64_t ver) { return 0; }
|
int32_t walPrune(SWal *pWal, int64_t ver) { return 0; }
|
||||||
|
|
||||||
|
|
||||||
|
int32_t walRead(SWal *, SWalHead **, int64_t ver);
|
||||||
|
int32_t walReadWithFp(SWal *, FWalWrite writeFp, int64_t verStart, int32_t readNum);
|
||||||
|
|
||||||
|
int64_t walGetFirstVer(SWal *);
|
||||||
|
int64_t walGetSnapshotVer(SWal *);
|
||||||
|
int64_t walGetLastVer(SWal *);
|
||||||
|
|
Loading…
Reference in New Issue