提交 7e61fc12 编写于 作者: H Hongze Cheng

more code

上级 83234b0a
......@@ -36,6 +36,10 @@ IF (TD_LINUX)
TARGET_LINK_LIBRARIES(taosd balance sync)
ENDIF ()
IF (TD_DNODE_PLUGINS)
TARGET_LINK_LIBRARIES(taosd dnodePlugins)
ENDIF()
SET(PREPARE_ENV_CMD "prepare_env_cmd")
SET(PREPARE_ENV_TARGET "prepare_env_target")
ADD_CUSTOM_COMMAND(OUTPUT ${PREPARE_ENV_CMD}
......
......@@ -170,6 +170,17 @@ static void dnodeCheckDataDirOpenned(char *dir) {
}
static int32_t dnodeInitStorage() {
pDnodeTier = dnodeNewTier();
if (pDnodeTier == NULL) {
dError("failed to create new dnode tier since %s", tstrerror(terrno));
return -1;
}
if (dnodeAddDisks(pDnodeTier, NULL, 0) < 0) {
dError("failed to add disks to dnode tier since %s", tstrerror(terrno));
return -1;
}
if (dnodeCreateDir(tsDataDir) < 0) {
dError("failed to create dir: %s, reason: %s", tsDataDir, strerror(errno));
return -1;
......@@ -204,7 +215,12 @@ static int32_t dnodeInitStorage() {
return 0;
}
static void dnodeCleanupStorage() {}
static void dnodeCleanupStorage() {
if (pDnodeTier) {
dnodeCloseTier(pDnodeTier);
pDnodeTier = NULL;
}
}
bool dnodeIsFirstDeploy() {
return strcmp(tsFirst, tsLocalEp) == 0;
......
......@@ -20,7 +20,7 @@
SDnodeTier *dnodeNewTier() { return NULL; }
void * dnodeCloseTier(SDnodeTier *pDnodeTier) { return NULL; }
int dnodeAddDisks(SDnodeTier *pDnodeTier, SDiskCfg *pDiskCfgs, int ndisks);
int dnodeAddDisks(SDnodeTier *pDnodeTier, SDiskCfg *pDiskCfgs, int ndisks) { return 0; }
int dnodeUpdateTiersInfo(SDnodeTier *pDnodeTier) { return 0; }
int dnodeCheckTiers(SDnodeTier *pDnodeTier) { return 0; }
SDisk * dnodeAssignDisk(SDnodeTier *pDnodeTier, int level) { return NULL; }
......
......@@ -187,6 +187,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_DND_DISK_ALREADY_EXISTS, 0, 0x0406, "Disk alrea
TAOS_DEFINE_ERROR(TSDB_CODE_DND_DISK_NOT_DIRECTORY, 0, 0x0407, "Disk is not a directory")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_NO_DISK_SPACE, 0, 0x0408, "Dnode no disk space")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_DUPLICATE_PRIMARY_DISK, 0, 0x0409, "Duplicate primary disk")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_LACK_PRIMARY_DISK, 0, 0x040A, "Lack primary disk")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_NO_DISK_AT_TIER, 0, 0x040B, "No disk at tier")
// vnode
TAOS_DEFINE_ERROR(TSDB_CODE_VND_ACTION_IN_PROGRESS, 0, 0x0500, "Action in progress")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册