Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5cee5bc4
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
5cee5bc4
编写于
11月 29, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
25ec924c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
47 deletion
+40
-47
include/common/tmsg.h
include/common/tmsg.h
+1
-2
source/common/src/tmsg.c
source/common/src/tmsg.c
+30
-44
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+9
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
5cee5bc4
...
...
@@ -3232,10 +3232,9 @@ typedef struct {
SArray
*
aCreateTbRsp
;
// SArray<SVCreateTbRsp>
}
SSubmitRsp2
;
int32_t
tCreateSSubmitRsp2
(
SSubmitRsp2
**
ppRsp
);
void
tDestroySSubmitRsp2
(
SSubmitRsp2
*
pRsp
,
int32_t
flag
);
int32_t
tEncodeSSubmitRsp2
(
SEncoder
*
pCoder
,
const
SSubmitRsp2
*
pRsp
);
int32_t
tDecodeSSubmitRsp2
(
SDecoder
*
pCoder
,
SSubmitRsp2
*
pRsp
);
void
tDestroySSubmitRsp2
(
SSubmitRsp2
*
pRsp
,
int32_t
flag
);
#define TSDB_MSG_FLG_ENCODE 0x1
#define TSDB_MSG_FLG_DECODE 0x2
...
...
source/common/src/tmsg.c
浏览文件 @
5cee5bc4
...
...
@@ -6835,7 +6835,8 @@ int32_t tEncodeSSubmitRsp2(SEncoder *pCoder, const SSubmitRsp2 *pRsp) {
if
(
tEncodeI32v
(
pCoder
,
pRsp
->
code
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pCoder
,
pRsp
->
affectedRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pCoder
,
taosArrayGetSize
(
pRsp
->
aCreateTbRsp
))
<
0
)
return
-
1
;
if
(
tEncodeU64v
(
pCoder
,
taosArrayGetSize
(
pRsp
->
aCreateTbRsp
))
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pRsp
->
aCreateTbRsp
);
++
i
)
{
if
(
tEncodeSVCreateTbRsp
(
pCoder
,
taosArrayGet
(
pRsp
->
aCreateTbRsp
,
i
))
<
0
)
return
-
1
;
}
...
...
@@ -6865,24 +6866,26 @@ int32_t tDecodeSSubmitRsp2(SDecoder *pCoder, SSubmitRsp2 *pRsp) {
goto
_exit
;
}
int32
_t
nCreateTbRsp
;
if
(
tDecode
I32
v
(
pCoder
,
&
nCreateTbRsp
)
<
0
)
{
uint64
_t
nCreateTbRsp
;
if
(
tDecode
U64
v
(
pCoder
,
&
nCreateTbRsp
)
<
0
)
{
code
=
TSDB_CODE_INVALID_MSG
;
goto
_exit
;
}
pRsp
->
aCreateTbRsp
=
taosArrayInit
(
nCreateTbRsp
,
sizeof
(
SVCreateTbRsp
));
if
(
pRsp
->
aCreateTbRsp
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_exit
;
}
for
(
int32_t
i
=
0
;
i
<
nCreateTbRsp
;
++
i
)
{
SVCreateTbRsp
*
pCreateTbRsp
=
taosArrayReserve
(
pRsp
->
aCreateTbRsp
,
1
);
if
(
tDecodeSVCreateTbRsp
(
pCoder
,
pCreateTbRsp
)
<
0
)
{
code
=
TSDB_CODE_INVALID_MSG
;
if
(
nCreateTbRsp
)
{
pRsp
->
aCreateTbRsp
=
taosArrayInit
(
nCreateTbRsp
,
sizeof
(
SVCreateTbRsp
));
if
(
pRsp
->
aCreateTbRsp
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_exit
;
}
for
(
int32_t
i
=
0
;
i
<
nCreateTbRsp
;
++
i
)
{
SVCreateTbRsp
*
pCreateTbRsp
=
taosArrayReserve
(
pRsp
->
aCreateTbRsp
,
1
);
if
(
tDecodeSVCreateTbRsp
(
pCoder
,
pCreateTbRsp
)
<
0
)
{
code
=
TSDB_CODE_INVALID_MSG
;
goto
_exit
;
}
}
}
tEndDecode
(
pCoder
);
...
...
@@ -6896,37 +6899,20 @@ _exit:
return
code
;
}
int32_t
tCreateSSubmitRsp2
(
SSubmitRsp2
**
ppRsp
)
{
int32_t
code
=
0
;
SSubmitRsp2
*
pRsp
=
(
SSubmitRsp2
*
)
taosMemoryCalloc
(
1
,
sizeof
(
*
pRsp
));
if
(
pRsp
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_exit
;
}
pRsp
->
aCreateTbRsp
=
taosArrayInit
(
16
,
sizeof
(
SVCreateTbRsp
));
if
(
pRsp
->
aCreateTbRsp
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_exit
;
}
_exit:
if
(
code
)
{
*
ppRsp
=
NULL
;
if
(
pRsp
)
{
if
(
pRsp
->
aCreateTbRsp
)
taosArrayDestroy
(
pRsp
->
aCreateTbRsp
);
taosMemoryFree
(
pRsp
);
}
}
else
{
*
ppRsp
=
pRsp
;
}
return
code
;
}
void
tDestroySSubmitRsp2
(
SSubmitRsp2
*
pRsp
,
int32_t
flag
)
{
if
(
pRsp
)
{
taosArrayDestroyEx
(
pRsp
->
aCreateTbRsp
,
NULL
/* TODO: set according to flag */
);
taosMemoryFree
(
pRsp
);
if
(
TSDB_MSG_FLG_ENCODE
)
{
if
(
pRsp
->
aCreateTbRsp
)
{
int32_t
nCreateTbRsp
=
TARRAY_SIZE
(
pRsp
->
aCreateTbRsp
);
SVCreateTbRsp
*
aCreateTbRsp
=
TARRAY_DATA
(
pRsp
->
aCreateTbRsp
);
for
(
int32_t
i
=
0
;
i
<
nCreateTbRsp
;
++
i
)
{
if
(
aCreateTbRsp
[
i
].
pMeta
)
{
taosMemoryFree
(
aCreateTbRsp
[
i
].
pMeta
);
}
}
taosArrayDestroy
(
pRsp
->
aCreateTbRsp
);
}
}
else
if
(
TSDB_MSG_FLG_DECODE
)
{
// TODO
taosArrayDestroy
(
pRsp
->
aCreateTbRsp
);
}
}
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
5cee5bc4
...
...
@@ -968,10 +968,18 @@ _exit:
tEncodeSSubmitRsp2
(
&
ec
,
pSubmitRsp
);
tEncoderClear
(
&
ec
);
// update statistics
atomic_add_fetch_64
(
&
pVnode
->
statis
.
nInsert
,
pSubmitRsp
->
affectedRows
);
atomic_add_fetch_64
(
&
pVnode
->
statis
.
nInsertSuccess
,
pSubmitRsp
->
affectedRows
);
atomic_add_fetch_64
(
&
pVnode
->
statis
.
nBatchInsert
,
1
);
if
(
code
==
0
)
{
atomic_add_fetch_64
(
&
pVnode
->
statis
.
nBatchInsertSuccess
,
1
);
}
// clear
taosArrayDestroy
(
newTbUids
);
tDestroySSubmitReq2
(
pSubmitReq
);
tDestroySSubmitRsp2
(
pSubmitRsp
);
tDestroySSubmitRsp2
(
pSubmitRsp
,
TSDB_MSG_FLG_ENCODE
);
return
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录