more
This commit is contained in:
parent
8b608cd3b7
commit
6538f86e5f
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue