Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a05eb4b1
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a05eb4b1
编写于
2月 03, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor tag index
上级
151df3bf
变更
9
展开全部
显示空白变更内容
内联
并排
Showing
9 changed file
with
840 addition
and
12 deletion
+840
-12
include/util/taoserror.h
include/util/taoserror.h
+2
-1
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+12
-0
source/dnode/mnode/impl/inc/mndIdx.h
source/dnode/mnode/impl/inc/mndIdx.h
+22
-0
source/dnode/mnode/impl/inc/mndStb.h
source/dnode/mnode/impl/inc/mndStb.h
+5
-0
source/dnode/mnode/impl/src/mndIndex.c
source/dnode/mnode/impl/src/mndIndex.c
+785
-0
source/dnode/mnode/impl/src/mndMain.c
source/dnode/mnode/impl/src/mndMain.c
+2
-0
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+9
-10
source/dnode/mnode/sdb/inc/sdb.h
source/dnode/mnode/sdb/inc/sdb.h
+2
-1
source/util/src/terror.c
source/util/src/terror.c
+1
-0
未找到文件。
include/util/taoserror.h
浏览文件 @
a05eb4b1
...
...
@@ -264,7 +264,8 @@ int32_t* taosGetErrno();
// #define TSDB_CODE_MND_INVALID_COLUMN_LENGTH TAOS_DEF_ERROR_CODE(0, 0x0377) // 2.x
#define TSDB_CODE_MND_INVALID_FUNC_COMMENT TAOS_DEF_ERROR_CODE(0, 0x0378)
#define TSDB_CODE_MND_INVALID_FUNC_RETRIEVE TAOS_DEF_ERROR_CODE(0, 0x0379)
#define TSDB_CODE_MND_TAG_INDEX_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0,0x037A)
#define TSDB_CODE_MND_TAG_INDEX_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x037A)
#define TSDB_CODE_MND_TAG_INDEX_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x037B)
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
a05eb4b1
...
...
@@ -388,6 +388,18 @@ typedef struct {
SSchemaWrapper
schemaTag
;
// for dstVgroup
}
SSmaObj
;
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
stb
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
char
dstTbName
[
TSDB_TABLE_FNAME_LEN
];
char
colName
[
TSDB_COL_NAME_LEN
];
int64_t
createdTime
;
int64_t
uid
;
int64_t
stbUid
;
int64_t
dbUid
;
}
SIdxObj
;
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
...
...
source/dnode/mnode/impl/inc/mndIdx.h
0 → 100644
浏览文件 @
a05eb4b1
#ifndef _TD_MND_IDX_H_
#define _TD_MND_IDX_H_
#include "mndInt.h"
#ifdef __cplusplus
extern
"C"
{
#endif
int32_t
mndInitIdx
(
SMnode
*
pMnode
);
void
mndCleanupIdx
(
SMnode
*
pMnode
);
SIdxObj
*
mndAcquireIdx
(
SMnode
*
pMnode
,
char
*
Name
);
void
mndReleaseIdx
(
SMnode
*
pMnode
,
SIdxObj
*
pSma
);
int32_t
mndDropIdxsByStb
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SStbObj
*
pStb
);
int32_t
mndDropIdxsByDb
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
);
int32_t
mndGetTableIdx
(
SMnode
*
pMnode
,
char
*
tbFName
,
STableIndexRsp
*
rsp
,
bool
*
exist
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_MND_IDX_H_*/
\ No newline at end of file
source/dnode/mnode/impl/inc/mndStb.h
浏览文件 @
a05eb4b1
...
...
@@ -42,6 +42,11 @@ void mndExtractTbNameFromStbFullName(const char *stbFullName, char *dst, int32_t
const
char
*
mndGetStbStr
(
const
char
*
src
);
int32_t
mndAllocStbSchemas
(
const
SStbObj
*
pOld
,
SStbObj
*
pNew
);
int32_t
mndCheckColAndTagModifiable
(
SMnode
*
pMnode
,
const
char
*
stbFullName
,
int64_t
suid
,
col_id_t
colId
);
void
*
mndBuildVCreateStbReq
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SStbObj
*
pStb
,
int32_t
*
pContLen
,
void
*
alterOriData
,
int32_t
alterOriDataLen
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mnode/impl/src/mndIndex.c
0 → 100644
浏览文件 @
a05eb4b1
此差异已折叠。
点击以展开。
source/dnode/mnode/impl/src/mndMain.c
浏览文件 @
a05eb4b1
...
...
@@ -21,6 +21,7 @@
#include "mndDnode.h"
#include "mndFunc.h"
#include "mndGrant.h"
#include "mndIdx.h"
#include "mndInfoSchema.h"
#include "mndMnode.h"
#include "mndPerfSchema.h"
...
...
@@ -425,6 +426,7 @@ static int32_t mndInitSteps(SMnode *pMnode) {
if
(
mndAllocStep
(
pMnode
,
"mnode-vgroup"
,
mndInitVgroup
,
mndCleanupVgroup
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-stb"
,
mndInitStb
,
mndCleanupStb
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-sma"
,
mndInitSma
,
mndCleanupSma
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-idx"
,
mndInitIdx
,
mndCleanupIdx
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-infos"
,
mndInitInfos
,
mndCleanupInfos
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-perfs"
,
mndInitPerfs
,
mndCleanupPerfs
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-db"
,
mndInitDb
,
mndCleanupDb
)
!=
0
)
return
-
1
;
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
a05eb4b1
...
...
@@ -48,7 +48,6 @@ static void mndCancelGetNextStb(SMnode *pMnode, void *pIter);
static
int32_t
mndProcessTableCfgReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndAlterStbImp
(
SMnode
*
pMnode
,
SRpcMsg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
,
bool
needRsp
,
void
*
alterOriData
,
int32_t
alterOriDataLen
);
static
int32_t
mndCheckColAndTagModifiable
(
SMnode
*
pMnode
,
const
char
*
stbname
,
int64_t
suid
,
col_id_t
colId
);
static
int32_t
mndProcessCreateIndexReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessDropIndexReq
(
SRpcMsg
*
pReq
);
...
...
@@ -75,10 +74,10 @@ int32_t mndInitStb(SMnode *pMnode) {
mndSetMsgHandle
(
pMnode
,
TDMT_MND_TABLE_CFG
,
mndProcessTableCfgReq
);
// mndSetMsgHandle(pMnode, TDMT_MND_SYSTABLE_RETRIEVE, mndProcessRetrieveStbReq);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_INDEX
,
mndProcessCreateIndexReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_INDEX
,
mndProcessDropIndexReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_CREATE_INDEX_RSP
,
mndTransProcessRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_DROP_INDEX_RSP
,
mndTransProcessRsp
);
//
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_INDEX, mndProcessCreateIndexReq);
//
mndSetMsgHandle(pMnode, TDMT_MND_DROP_INDEX, mndProcessDropIndexReq);
//
mndSetMsgHandle(pMnode, TDMT_VND_CREATE_INDEX_RSP, mndTransProcessRsp);
//
mndSetMsgHandle(pMnode, TDMT_VND_DROP_INDEX_RSP, mndTransProcessRsp);
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_STB
,
mndRetrieveStb
);
mndAddShowFreeIterHandle
(
pMnode
,
TSDB_MGMT_TABLE_STB
,
mndCancelGetNextStb
);
...
...
@@ -432,8 +431,8 @@ static FORCE_INLINE int32_t schemaExColIdCompare(const void *colId, const void *
return
0
;
}
static
void
*
mndBuildVCreateStbReq
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SStbObj
*
pStb
,
int32_t
*
pContLen
,
void
*
alterOriData
,
int32_t
alterOriDataLen
)
{
void
*
mndBuildVCreateStbReq
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SStbObj
*
pStb
,
int32_t
*
pContLen
,
void
*
alterOriData
,
int32_t
alterOriDataLen
)
{
SEncoder
encoder
=
{
0
};
int32_t
contLen
;
SName
name
=
{
0
};
...
...
@@ -1093,7 +1092,7 @@ static int32_t mndCheckAlterStbReq(SMAlterStbReq *pAlter) {
return
0
;
}
static
int32_t
mndAllocStbSchemas
(
const
SStbObj
*
pOld
,
SStbObj
*
pNew
)
{
int32_t
mndAllocStbSchemas
(
const
SStbObj
*
pOld
,
SStbObj
*
pNew
)
{
pNew
->
pTags
=
taosMemoryCalloc
(
pNew
->
numOfTags
,
sizeof
(
SSchema
));
pNew
->
pColumns
=
taosMemoryCalloc
(
pNew
->
numOfColumns
,
sizeof
(
SSchema
));
if
(
pNew
->
pTags
==
NULL
||
pNew
->
pColumns
==
NULL
)
{
...
...
@@ -3127,7 +3126,7 @@ static int32_t mndCheckIndexReq(SCreateTagIndexReq *pReq) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
mndAddIndexImpl
(
SMnode
*
pMnode
,
SRpcMsg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
,
bool
needRsp
,
void
*
sql
,
/*
int32_t mndAddIndexImpl(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SStbObj *pStb, bool needRsp, void *sql,
int32_t len) {
// impl later
int32_t code = 0;
...
...
@@ -3253,4 +3252,4 @@ static int32_t mndProcessDropIndexReq(SRpcMsg *pReq) {
return TSDB_CODE_SUCCESS;
_OVER:
return code;
}
}
*/
source/dnode/mnode/sdb/inc/sdb.h
浏览文件 @
a05eb4b1
...
...
@@ -147,7 +147,8 @@ typedef enum {
SDB_STB
=
18
,
SDB_DB
=
19
,
SDB_FUNC
=
20
,
SDB_MAX
=
21
SDB_IDX
=
21
,
SDB_MAX
=
22
}
ESdbType
;
typedef
struct
SSdbRaw
{
...
...
source/util/src/terror.c
浏览文件 @
a05eb4b1
...
...
@@ -208,6 +208,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_FUNC_COMMENT, "Invalid func comment"
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_FUNC_RETRIEVE
,
"Invalid func retrieve msg"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_INDEX_ALREADY_EXIST
,
"Tag index already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_INDEX_NOT_EXIST
,
"Tag index not exists"
)
// mnode-db
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录