提交 7444bf50 编写于 作者: S Shengliang Guan

minor changes

上级 826e3c58
......@@ -16,12 +16,40 @@
#ifndef _TD_MNODE_SDB_H_
#define _TD_MNODE_SDB_H_
#include "mnodeInt.h"
#include "cJSON.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
MN_SDB_START = 0,
MN_SDB_CLUSTER = 1,
MN_SDB_DNODE = 2,
MN_SDB_MNODE = 3,
MN_SDB_ACCT = 4,
MN_SDB_AUTH = 5,
MN_SDB_USER = 6,
MN_SDB_DB = 7,
MN_SDB_VGROUP = 8,
MN_SDB_STABLE = 9,
MN_SDB_FUNC = 10,
MN_SDB_OPER = 11,
MN_SDB_MAX = 12
} EMnSdb;
typedef enum { MN_OP_START = 0, MN_OP_INSERT = 1, MN_OP_UPDATE = 2, MN_OP_DELETE = 3, MN_OP_MAX = 4 } EMnOp;
typedef enum { MN_KEY_START = 0, MN_KEY_BINARY = 1, MN_KEY_INT32 = 2, MN_KEY_INT64 = 3, MN_KEY_MAX } EMnKey;
typedef enum { MN_SDB_STAT_AVAIL = 0, MN_SDB_STAT_DROPPED = 1 } EMnSdbStat;
typedef struct {
int8_t type;
int8_t status;
int8_t align[6];
} SdbHead;
typedef void (*SdbDeployFp)();
typedef void *(*SdbDecodeFp)(cJSON *root);
typedef int32_t (*SdbEncodeFp)(void *pHead, char *buf, int32_t maxLen);
......
......@@ -7,6 +7,7 @@ target_include_directories(
)
target_link_libraries(
mnode
PRIVATE sdb
PUBLIC transport
PUBLIC cjson
)
\ No newline at end of file
......@@ -24,6 +24,7 @@
#include "thash.h"
#include "cJSON.h"
#include "mnode.h"
#include "sdb.h"
#ifdef __cplusplus
extern "C" {
......@@ -59,26 +60,6 @@ typedef struct SFuncObj SFuncObj;
typedef struct SOperObj SOperObj;
typedef struct SMnMsg SMnMsg;
typedef enum {
MN_SDB_START = 0,
MN_SDB_CLUSTER = 1,
MN_SDB_DNODE = 2,
MN_SDB_MNODE = 3,
MN_SDB_ACCT = 4,
MN_SDB_AUTH = 5,
MN_SDB_USER = 6,
MN_SDB_DB = 7,
MN_SDB_VGROUP = 8,
MN_SDB_STABLE = 9,
MN_SDB_FUNC = 10,
MN_SDB_OPER = 11,
MN_SDB_MAX = 12
} EMnSdb;
typedef enum { MN_OP_START = 0, MN_OP_INSERT = 1, MN_OP_UPDATE = 2, MN_OP_DELETE = 3, MN_OP_MAX = 4 } EMnOp;
typedef enum { MN_KEY_START = 0, MN_KEY_BINARY = 1, MN_KEY_INT32 = 2, MN_KEY_INT64 = 3, MN_KEY_MAX } EMnKey;
typedef enum {
MN_AUTH_ACCT_START = 0,
MN_AUTH_ACCT_USER,
......@@ -97,13 +78,7 @@ typedef enum {
MN_AUTH_MAX
} EMnAuthOp;
typedef enum { MN_SDB_STAT_AVAIL = 0, MN_SDB_STAT_DROPPED = 1 } EMnSdbStat;
typedef struct {
int8_t type;
int8_t status;
int8_t align[6];
} SdbHead;
typedef struct SClusterObj {
SdbHead head;
......
......@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include "mnodeSdb.h"
#include "mnodeInt.h"
static void mnodeCreateDefaultAcct() {
int32_t code = TSDB_CODE_SUCCESS;
......
......@@ -17,7 +17,7 @@
#include "os.h"
#include "tkey.h"
#include "tglobal.h"
#include "mnodeSdb.h"
#include "mnodeInt.h"
static int32_t mnodeCreateDefaultUser(char *acct, char *user, char *pass) {
int32_t code = TSDB_CODE_SUCCESS;
......
......@@ -18,7 +18,7 @@
#include "tworker.h"
#include "tglobal.h"
#include "mnodeMnode.h"
#include "mnodeSdb.h"
#include "mnodeInt.h"
#include "mnodeShow.h"
#include "mnodeSync.h"
#include "mnodeWorker.h"
......
......@@ -27,7 +27,7 @@
#include "mnodeMnode.h"
#include "mnodeOper.h"
#include "mnodeProfile.h"
#include "mnodeSdb.h"
#include "mnodeInt.h"
#include "mnodeShow.h"
#include "mnodeStable.h"
#include "mnodeSync.h"
......
......@@ -2,10 +2,13 @@ aux_source_directory(src MNODE_SRC)
add_library(sdb ${MNODE_SRC})
target_include_directories(
sdb
PUBLIC "${CMAKE_SOURCE_DIR}/include/dnode/mnode/sdb/inc"
PUBLIC "${CMAKE_SOURCE_DIR}/include/dnode/mnode/sdb"
private "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
sdb
PUBLIC transport
PRIVATE os
PRIVATE common
PRIVATE util
PRIVATE cjson
)
\ No newline at end of file
......@@ -18,7 +18,21 @@
#include "thash.h"
#include "tglobal.h"
#include "cJSON.h"
#include "mnodeSdb.h"
#include "sdb.h"
#include "os.h"
#include "taosmsg.h"
#include "tlog.h"
extern int32_t mDebugFlag;
// mnode log function
#define mFatal(...) { if (mDebugFlag & DEBUG_FATAL) { taosPrintLog("MND FATAL ", 255, __VA_ARGS__); }}
#define mError(...) { if (mDebugFlag & DEBUG_ERROR) { taosPrintLog("MND ERROR ", 255, __VA_ARGS__); }}
#define mWarn(...) { if (mDebugFlag & DEBUG_WARN) { taosPrintLog("MND WARN ", 255, __VA_ARGS__); }}
#define mInfo(...) { if (mDebugFlag & DEBUG_INFO) { taosPrintLog("MND ", 255, __VA_ARGS__); }}
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND ", mDebugFlag, __VA_ARGS__); }}
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", mDebugFlag, __VA_ARGS__); }}
static struct {
char currDir[PATH_MAX];
......
......@@ -2,7 +2,7 @@ aux_source_directory(src MNODE_SRC)
add_library(transaction ${MNODE_SRC})
target_include_directories(
transaction
PUBLIC "${CMAKE_SOURCE_DIR}/include/dnode/mnode/transaction/inc"
PUBLIC "${CMAKE_SOURCE_DIR}/include/dnode/mnode/transaction"
private "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册