diff --git a/include/libs/wal/wal.h b/include/libs/wal/wal.h index e59d60f7dc2f7e816cd302cfd24be164098d781f..37cd2637839337291a99bb638f47bb0b33a9f54a 100644 --- a/include/libs/wal/wal.h +++ b/include/libs/wal/wal.h @@ -60,8 +60,8 @@ void walClose(twalh); //write int64_t walWrite(twalh, int8_t msgType, void* body, uint32_t bodyLen); void walFsync(twalh, bool forceHint); -//int32_t walCommit(twalh, uint64_t ver); -//int32_t walRollback(twalh, uint64_t ver); +//int32_t walCommit(twalh, int64_t ver); +//int32_t walRollback(twalh, int64_t ver); //read int32_t walRead(twalh, SWalHead **, int64_t ver); diff --git a/include/server/vnode/tq/tq.h b/include/server/vnode/tq/tq.h index 91688e890df0c699de8f9e0ab4004d5bbd3da182..dd355c838142f129fef8e4ea62a7e2cfababe441 100644 --- a/include/server/vnode/tq/tq.h +++ b/include/server/vnode/tq/tq.h @@ -25,23 +25,14 @@ extern "C" { typedef struct STQ STQ; STQ* tqInit(void* ref_func(void*), void* unref_func(void*)); -void tqCleanUp(STQ* pTq); - -//create persistent storage for meta info such as consuming offset -//return value > 0: cgId -//return value <= 0: error code -int tqCreateGroup(STQ*); -//create ring buffer in memory and load consuming offset -int tqOpenGroup(STQ*, int cgId); -//destroy ring buffer and persist consuming offset -int tqCloseGroup(STQ*, int cgId); -//delete persistent storage for meta info -int tqDropGroup(STQ*, int cgId); - -int tqPushMsg(STQ*, void *, int64_t version); +void tqCleanUp(STQ*); + +//void* will be replace by a msg type +int tqPushMsg(STQ*, void* msg, int64_t version); int tqCommit(STQ*); -int tqHandleMsg(STQ*, void *msg); +//void* will be replace by a msg type +int tqHandleMsg(STQ*, void* msg); #ifdef __cplusplus } diff --git a/source/server/vnode/tq/inc/tqInt.h b/source/server/vnode/tq/inc/tqInt.h index 416a915456e78b1746e4a3cc5a4cde5336b42f97..a51f0b03af766533cdbe90948be0e27d978ba276 100644 --- a/source/server/vnode/tq/inc/tqInt.h +++ b/source/server/vnode/tq/inc/tqInt.h @@ -25,6 +25,17 @@ extern "C" { //implement the array index //implement the ring buffer +//create persistent storage for meta info such as consuming offset +//return value > 0: cgId +//return value <= 0: error code +int tqCreateGroup(STQ*); +//create ring buffer in memory and load consuming offset +int tqOpenGroup(STQ*, int cgId); +//destroy ring buffer and persist consuming offset +int tqCloseGroup(STQ*, int cgId); +//delete persistent storage for meta info +int tqDropGroup(STQ*, int cgId); + #ifdef __cplusplus } #endif