提交 e26fbd80 编写于 作者: H Hongze Cheng

integrate nuraft

上级 6538f86e
......@@ -50,6 +50,11 @@ if(${BUILD_WITH_LUCENE})
cat("${CMAKE_SUPPORT_DIR}/lucene_CMakeLists.txt.in" ${DEPS_TMP_FILE})
endif(${BUILD_WITH_LUCENE})
## NuRaft
if(${BUILD_WITH_NURAFT})
cat("${CMAKE_SUPPORT_DIR}/nuraft_CMakeLists.txt.in" ${DEPS_TMP_FILE})
endif(${BUILD_WITH_NURAFT})
## download dependencies
configure_file(${DEPS_TMP_FILE} "${CMAKE_SOURCE_DIR}/deps/deps-download/CMakeLists.txt")
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
......
......@@ -25,6 +25,12 @@ option(
OFF
)
option(
BUILD_WITH_NURAFT
"If build with NuRaft"
OFF
)
option(
BUILD_DEPENDENCY_TESTS
"If build dependency tests"
......
# NuRaft
ExternalProject_Add(NuRaft
GIT_REPOSITORY https://github.com/eBay/NuRaft.git
GIT_TAG v1.3.0
SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/nuraft"
BINARY_DIR "${CMAKE_SOURCE_DIR}/deps/nuraft"
CONFIGURE_COMMAND "./prepare.sh"
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
\ No newline at end of file
......@@ -67,6 +67,12 @@ if(${BUILD_WITH_LUCENE})
add_subdirectory(lucene)
endif(${BUILD_WITH_LUCENE})
# NuRaft
if(${BUILD_WITH_NURAFT})
add_subdirectory(nuraft)
endif(${BUILD_WITH_NURAFT})
# ================================================================================================
# DEPENDENCY TEST
# ================================================================================================
......
......@@ -31,7 +31,7 @@ SVnode *vnodeOpen(const char *path, const SVnodeOptions *pVnodeOptions);
void vnodeClose(SVnode *pVnode);
void vnodeDestroy(const char *path);
int vnodeProcessWriteReqs(SVnode *pVnode, SReqBatch *pReqBatch);
int vnodeApplyWriteReqs(SVnode *pVnode, SReqBatch *pReqBatch);
int vnodeApplyWriteRequest(SVnode *pVnode, const SRequest *pRequest);
int vnodeProcessReadReq(SVnode *pVnode, SRequest *pReq);
int vnodeProcessSyncReq(SVnode *pVnode, SRequest *pReq);
......
......@@ -15,36 +15,14 @@
#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);
int vnodeApplyWriteRequest(SVnode *pVnode, const SRequest *pRequest) {
/* TODO */
return 0;
}
/* ------------------------ STATIC METHODS ------------------------ */
static int vnodeApplyWriteRequest(SVnode *pVnode, const SRequest *pRequest) {
/* TODO */
return 0;
}
\ No newline at end of file
/* ------------------------ STATIC METHODS ------------------------ */
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册