提交 6538f86e 编写于 作者: H Hongze Cheng

more

上级 8b608cd3
......@@ -20,10 +20,26 @@
extern "C" {
#endif
/* ------------------------ TYPES EXPOSED ------------------------ */
typedef struct SRequest SRequest;
typedef struct SReqBatch SReqBatch;
typedef struct SReqBatchIter SReqBatchIter;
// SRequest
// SReqBatch
// SReqBatchIter
void tdInitRBIter(SReqBatchIter *pIter, SReqBatch *pReqBatch);
const SRequest *tdRBIterNext(SReqBatchIter *pIter);
void tdClearRBIter(SReqBatchIter *pIter);
/* ------------------------ TYPES DEFINITION ------------------------ */
struct SReqBatchIter {
int iReq;
SReqBatch *pReqBatch;
};
#ifdef __cplusplus
}
#endif
......
......@@ -15,12 +15,36 @@
#include "vnodeDef.h"
static int vnodeApplyWriteRequest(SVnode *pVnode, const SRequest *pRequest);
int vnodeProcessWriteReqs(SVnode *pVnode, SReqBatch *pReqBatch) {
/* TODO */
return 0;
}
int vnodeApplyWriteReqs(SVnode *pVnode, SReqBatch *pReqBatch) {
SReqBatchIter rbIter;
tdInitRBIter(&rbIter, pReqBatch);
for (;;) {
const SRequest *pReq = tdRBIterNext(&rbIter);
if (pReq == NULL) {
break;
}
if (vnodeApplyWriteRequest(pVnode, pReq) < 0) {
// TODO
}
}
tdClearRBIter(&rbIter);
return 0;
}
/* ------------------------ STATIC METHODS ------------------------ */
static int vnodeApplyWriteRequest(SVnode *pVnode, const SRequest *pRequest) {
/* TODO */
return 0;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册