Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a06bf6e5
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
a06bf6e5
编写于
5月 07, 2022
作者:
H
Hongze Cheng
提交者:
GitHub
5月 07, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12206 from taosdata/feature/vnode_refact1
refact: vnode
上级
6ce36a08
20854de4
变更
31
展开全部
显示空白变更内容
内联
并排
Showing
31 changed file
with
1101 addition
and
1940 deletion
+1101
-1940
include/common/tmsg.h
include/common/tmsg.h
+45
-45
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+2
-2
include/util/tencode.h
include/util/tencode.h
+203
-216
source/client/src/tmq.c
source/client/src/tmq.c
+6
-6
source/common/src/tmsg.c
source/common/src/tmsg.c
+467
-467
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-2
source/dnode/mnode/impl/src/mndDef.c
source/dnode/mnode/impl/src/mndDef.c
+2
-2
source/dnode/mnode/impl/src/mndOffset.c
source/dnode/mnode/impl/src/mndOffset.c
+2
-2
source/dnode/mnode/impl/src/mndScheduler.c
source/dnode/mnode/impl/src/mndScheduler.c
+5
-5
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+8
-8
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+9
-9
source/dnode/snode/src/snode.c
source/dnode/snode/src/snode.c
+3
-3
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+14
-14
source/dnode/vnode/src/inc/meta.h
source/dnode/vnode/src/inc/meta.h
+2
-2
source/dnode/vnode/src/meta/metaEntry.c
source/dnode/vnode/src/meta/metaEntry.c
+3
-3
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+5
-5
source/dnode/vnode/src/meta/metaTDBImpl.c
source/dnode/vnode/src/meta/metaTDBImpl.c
+0
-843
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+9
-10
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+3
-3
source/dnode/vnode/src/tsdb/tsdbMemTable2.c
source/dnode/vnode/src/tsdb/tsdbMemTable2.c
+66
-59
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+29
-26
source/libs/executor/CMakeLists.txt
source/libs/executor/CMakeLists.txt
+2
-2
source/libs/monitor/src/monMsg.c
source/libs/monitor/src/monMsg.c
+58
-58
source/libs/parser/src/parInsertData.c
source/libs/parser/src/parInsertData.c
+3
-3
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+8
-8
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+8
-8
source/libs/stream/src/tstream.c
source/libs/stream/src/tstream.c
+2
-2
source/libs/sync/src/syncMessage.c
source/libs/sync/src/syncMessage.c
+16
-16
source/util/src/tencode.c
source/util/src/tencode.c
+59
-52
source/util/test/CMakeLists.txt
source/util/test/CMakeLists.txt
+3
-3
source/util/test/encodeTest.cpp
source/util/test/encodeTest.cpp
+57
-56
未找到文件。
include/common/tmsg.h
浏览文件 @
a06bf6e5
...
@@ -338,8 +338,8 @@ typedef struct SEpSet {
...
@@ -338,8 +338,8 @@ typedef struct SEpSet {
SEp
eps
[
TSDB_MAX_REPLICA
];
SEp
eps
[
TSDB_MAX_REPLICA
];
}
SEpSet
;
}
SEpSet
;
int32_t
tEncodeSEpSet
(
S
C
oder
*
pEncoder
,
const
SEpSet
*
pEp
);
int32_t
tEncodeSEpSet
(
S
Enc
oder
*
pEncoder
,
const
SEpSet
*
pEp
);
int32_t
tDecodeSEpSet
(
S
C
oder
*
pDecoder
,
SEpSet
*
pEp
);
int32_t
tDecodeSEpSet
(
S
Dec
oder
*
pDecoder
,
SEpSet
*
pEp
);
int32_t
taosEncodeSEpSet
(
void
**
buf
,
const
SEpSet
*
pEp
);
int32_t
taosEncodeSEpSet
(
void
**
buf
,
const
SEpSet
*
pEp
);
void
*
taosDecodeSEpSet
(
const
void
*
buf
,
SEpSet
*
pEp
);
void
*
taosDecodeSEpSet
(
const
void
*
buf
,
SEpSet
*
pEp
);
...
@@ -611,8 +611,8 @@ typedef struct {
...
@@ -611,8 +611,8 @@ typedef struct {
int32_t
tSerializeSUseDbRsp
(
void
*
buf
,
int32_t
bufLen
,
const
SUseDbRsp
*
pRsp
);
int32_t
tSerializeSUseDbRsp
(
void
*
buf
,
int32_t
bufLen
,
const
SUseDbRsp
*
pRsp
);
int32_t
tDeserializeSUseDbRsp
(
void
*
buf
,
int32_t
bufLen
,
SUseDbRsp
*
pRsp
);
int32_t
tDeserializeSUseDbRsp
(
void
*
buf
,
int32_t
bufLen
,
SUseDbRsp
*
pRsp
);
int32_t
tSerializeSUseDbRspImp
(
S
C
oder
*
pEncoder
,
const
SUseDbRsp
*
pRsp
);
int32_t
tSerializeSUseDbRspImp
(
S
Enc
oder
*
pEncoder
,
const
SUseDbRsp
*
pRsp
);
int32_t
tDeserializeSUseDbRspImp
(
S
C
oder
*
pDecoder
,
SUseDbRsp
*
pRsp
);
int32_t
tDeserializeSUseDbRspImp
(
S
Dec
oder
*
pDecoder
,
SUseDbRsp
*
pRsp
);
void
tFreeSUsedbRsp
(
SUseDbRsp
*
pRsp
);
void
tFreeSUsedbRsp
(
SUseDbRsp
*
pRsp
);
typedef
struct
{
typedef
struct
{
...
@@ -1527,8 +1527,8 @@ typedef struct {
...
@@ -1527,8 +1527,8 @@ typedef struct {
char
*
qmsg2
;
// pAst2:qmsg2:SRetention2 => trigger aggr task2
char
*
qmsg2
;
// pAst2:qmsg2:SRetention2 => trigger aggr task2
}
SRSmaParam
;
}
SRSmaParam
;
int32_t
tEncodeSRSmaParam
(
S
C
oder
*
pCoder
,
const
SRSmaParam
*
pRSmaParam
);
int32_t
tEncodeSRSmaParam
(
S
Enc
oder
*
pCoder
,
const
SRSmaParam
*
pRSmaParam
);
int32_t
tDecodeSRSmaParam
(
S
C
oder
*
pCoder
,
SRSmaParam
*
pRSmaParam
);
int32_t
tDecodeSRSmaParam
(
S
Dec
oder
*
pCoder
,
SRSmaParam
*
pRSmaParam
);
// TDMT_VND_CREATE_STB ==============
// TDMT_VND_CREATE_STB ==============
typedef
struct
SVCreateStbReq
{
typedef
struct
SVCreateStbReq
{
...
@@ -1540,8 +1540,8 @@ typedef struct SVCreateStbReq {
...
@@ -1540,8 +1540,8 @@ typedef struct SVCreateStbReq {
SRSmaParam
pRSmaParam
;
SRSmaParam
pRSmaParam
;
}
SVCreateStbReq
;
}
SVCreateStbReq
;
int
tEncodeSVCreateStbReq
(
S
C
oder
*
pCoder
,
const
SVCreateStbReq
*
pReq
);
int
tEncodeSVCreateStbReq
(
S
Enc
oder
*
pCoder
,
const
SVCreateStbReq
*
pReq
);
int
tDecodeSVCreateStbReq
(
S
C
oder
*
pCoder
,
SVCreateStbReq
*
pReq
);
int
tDecodeSVCreateStbReq
(
S
Dec
oder
*
pCoder
,
SVCreateStbReq
*
pReq
);
// TDMT_VND_DROP_STB ==============
// TDMT_VND_DROP_STB ==============
typedef
struct
SVDropStbReq
{
typedef
struct
SVDropStbReq
{
...
@@ -1549,8 +1549,8 @@ typedef struct SVDropStbReq {
...
@@ -1549,8 +1549,8 @@ typedef struct SVDropStbReq {
tb_uid_t
suid
;
tb_uid_t
suid
;
}
SVDropStbReq
;
}
SVDropStbReq
;
int32_t
tEncodeSVDropStbReq
(
S
C
oder
*
pCoder
,
const
SVDropStbReq
*
pReq
);
int32_t
tEncodeSVDropStbReq
(
S
Enc
oder
*
pCoder
,
const
SVDropStbReq
*
pReq
);
int32_t
tDecodeSVDropStbReq
(
S
C
oder
*
pCoder
,
SVDropStbReq
*
pReq
);
int32_t
tDecodeSVDropStbReq
(
S
Dec
oder
*
pCoder
,
SVDropStbReq
*
pReq
);
#define TD_CREATE_IF_NOT_EXISTS 0x1
#define TD_CREATE_IF_NOT_EXISTS 0x1
typedef
struct
SVCreateTbReq
{
typedef
struct
SVCreateTbReq
{
...
@@ -1563,7 +1563,7 @@ typedef struct SVCreateTbReq {
...
@@ -1563,7 +1563,7 @@ typedef struct SVCreateTbReq {
union
{
union
{
struct
{
struct
{
tb_uid_t
suid
;
tb_uid_t
suid
;
const
void
*
pTag
;
const
uint8_t
*
pTag
;
}
ctb
;
}
ctb
;
struct
{
struct
{
SSchemaWrapper
schema
;
SSchemaWrapper
schema
;
...
@@ -1571,8 +1571,8 @@ typedef struct SVCreateTbReq {
...
@@ -1571,8 +1571,8 @@ typedef struct SVCreateTbReq {
};
};
}
SVCreateTbReq
;
}
SVCreateTbReq
;
int
tEncodeSVCreateTbReq
(
S
C
oder
*
pCoder
,
const
SVCreateTbReq
*
pReq
);
int
tEncodeSVCreateTbReq
(
S
Enc
oder
*
pCoder
,
const
SVCreateTbReq
*
pReq
);
int
tDecodeSVCreateTbReq
(
S
C
oder
*
pCoder
,
SVCreateTbReq
*
pReq
);
int
tDecodeSVCreateTbReq
(
S
Dec
oder
*
pCoder
,
SVCreateTbReq
*
pReq
);
typedef
struct
{
typedef
struct
{
int32_t
nReqs
;
int32_t
nReqs
;
...
@@ -1582,15 +1582,15 @@ typedef struct {
...
@@ -1582,15 +1582,15 @@ typedef struct {
};
};
}
SVCreateTbBatchReq
;
}
SVCreateTbBatchReq
;
int
tEncodeSVCreateTbBatchReq
(
S
C
oder
*
pCoder
,
const
SVCreateTbBatchReq
*
pReq
);
int
tEncodeSVCreateTbBatchReq
(
S
Enc
oder
*
pCoder
,
const
SVCreateTbBatchReq
*
pReq
);
int
tDecodeSVCreateTbBatchReq
(
S
C
oder
*
pCoder
,
SVCreateTbBatchReq
*
pReq
);
int
tDecodeSVCreateTbBatchReq
(
S
Dec
oder
*
pCoder
,
SVCreateTbBatchReq
*
pReq
);
typedef
struct
{
typedef
struct
{
int32_t
code
;
int32_t
code
;
}
SVCreateTbRsp
,
SVUpdateTbRsp
;
}
SVCreateTbRsp
,
SVUpdateTbRsp
;
int
tEncodeSVCreateTbRsp
(
S
C
oder
*
pCoder
,
const
SVCreateTbRsp
*
pRsp
);
int
tEncodeSVCreateTbRsp
(
S
Enc
oder
*
pCoder
,
const
SVCreateTbRsp
*
pRsp
);
int
tDecodeSVCreateTbRsp
(
S
C
oder
*
pCoder
,
SVCreateTbRsp
*
pRsp
);
int
tDecodeSVCreateTbRsp
(
S
Dec
oder
*
pCoder
,
SVCreateTbRsp
*
pRsp
);
int32_t
tSerializeSVCreateTbReq
(
void
**
buf
,
SVCreateTbReq
*
pReq
);
int32_t
tSerializeSVCreateTbReq
(
void
**
buf
,
SVCreateTbReq
*
pReq
);
void
*
tDeserializeSVCreateTbReq
(
void
*
buf
,
SVCreateTbReq
*
pReq
);
void
*
tDeserializeSVCreateTbReq
(
void
*
buf
,
SVCreateTbReq
*
pReq
);
...
@@ -1603,8 +1603,8 @@ typedef struct {
...
@@ -1603,8 +1603,8 @@ typedef struct {
};
};
}
SVCreateTbBatchRsp
;
}
SVCreateTbBatchRsp
;
int
tEncodeSVCreateTbBatchRsp
(
S
C
oder
*
pCoder
,
const
SVCreateTbBatchRsp
*
pRsp
);
int
tEncodeSVCreateTbBatchRsp
(
S
Enc
oder
*
pCoder
,
const
SVCreateTbBatchRsp
*
pRsp
);
int
tDecodeSVCreateTbBatchRsp
(
S
C
oder
*
pCoder
,
SVCreateTbBatchRsp
*
pRsp
);
int
tDecodeSVCreateTbBatchRsp
(
S
Dec
oder
*
pCoder
,
SVCreateTbBatchRsp
*
pRsp
);
int32_t
tSerializeSVCreateTbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SVCreateTbBatchRsp
*
pRsp
);
int32_t
tSerializeSVCreateTbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SVCreateTbBatchRsp
*
pRsp
);
int32_t
tDeserializeSVCreateTbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SVCreateTbBatchRsp
*
pRsp
);
int32_t
tDeserializeSVCreateTbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SVCreateTbBatchRsp
*
pRsp
);
...
@@ -1627,8 +1627,8 @@ typedef struct {
...
@@ -1627,8 +1627,8 @@ typedef struct {
};
};
}
SVDropTbBatchReq
;
}
SVDropTbBatchReq
;
int32_t
tEncodeSVDropTbBatchReq
(
S
C
oder
*
pCoder
,
const
SVDropTbBatchReq
*
pReq
);
int32_t
tEncodeSVDropTbBatchReq
(
S
Enc
oder
*
pCoder
,
const
SVDropTbBatchReq
*
pReq
);
int32_t
tDecodeSVDropTbBatchReq
(
S
C
oder
*
pCoder
,
SVDropTbBatchReq
*
pReq
);
int32_t
tDecodeSVDropTbBatchReq
(
S
Dec
oder
*
pCoder
,
SVDropTbBatchReq
*
pReq
);
typedef
struct
{
typedef
struct
{
int32_t
nRsps
;
int32_t
nRsps
;
...
@@ -1638,8 +1638,8 @@ typedef struct {
...
@@ -1638,8 +1638,8 @@ typedef struct {
};
};
}
SVDropTbBatchRsp
;
}
SVDropTbBatchRsp
;
int32_t
tEncodeSVDropTbBatchRsp
(
S
C
oder
*
pCoder
,
const
SVDropTbBatchRsp
*
pRsp
);
int32_t
tEncodeSVDropTbBatchRsp
(
S
Enc
oder
*
pCoder
,
const
SVDropTbBatchRsp
*
pRsp
);
int32_t
tDecodeSVDropTbBatchRsp
(
S
C
oder
*
pCoder
,
SVDropTbBatchRsp
*
pRsp
);
int32_t
tDecodeSVDropTbBatchRsp
(
S
Dec
oder
*
pCoder
,
SVDropTbBatchRsp
*
pRsp
);
typedef
struct
{
typedef
struct
{
SMsgHead
head
;
SMsgHead
head
;
...
@@ -1821,14 +1821,14 @@ static FORCE_INLINE void tFreeClientHbBatchRsp(void* pRsp) {
...
@@ -1821,14 +1821,14 @@ static FORCE_INLINE void tFreeClientHbBatchRsp(void* pRsp) {
int32_t
tSerializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchRsp
*
pBatchRsp
);
int32_t
tSerializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchRsp
*
pBatchRsp
);
int32_t
tDeserializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchRsp
*
pBatchRsp
);
int32_t
tDeserializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchRsp
*
pBatchRsp
);
static
FORCE_INLINE
int32_t
tEncodeSKv
(
S
C
oder
*
pEncoder
,
const
SKv
*
pKv
)
{
static
FORCE_INLINE
int32_t
tEncodeSKv
(
S
Enc
oder
*
pEncoder
,
const
SKv
*
pKv
)
{
if
(
tEncodeI32
(
pEncoder
,
pKv
->
key
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pKv
->
key
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pKv
->
valueLen
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pKv
->
valueLen
)
<
0
)
return
-
1
;
if
(
tEncodeBinary
(
pEncoder
,
(
const
char
*
)
pKv
->
value
,
pKv
->
valueLen
)
<
0
)
return
-
1
;
if
(
tEncodeBinary
(
pEncoder
,
(
uint8_t
*
)
pKv
->
value
,
pKv
->
valueLen
)
<
0
)
return
-
1
;
return
0
;
return
0
;
}
}
static
FORCE_INLINE
int32_t
tDecodeSKv
(
S
C
oder
*
pDecoder
,
SKv
*
pKv
)
{
static
FORCE_INLINE
int32_t
tDecodeSKv
(
S
Dec
oder
*
pDecoder
,
SKv
*
pKv
)
{
if
(
tDecodeI32
(
pDecoder
,
&
pKv
->
key
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pKv
->
key
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pKv
->
valueLen
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pKv
->
valueLen
)
<
0
)
return
-
1
;
pKv
->
value
=
taosMemoryMalloc
(
pKv
->
valueLen
+
1
);
pKv
->
value
=
taosMemoryMalloc
(
pKv
->
valueLen
+
1
);
...
@@ -1837,13 +1837,13 @@ static FORCE_INLINE int32_t tDecodeSKv(SCoder* pDecoder, SKv* pKv) {
...
@@ -1837,13 +1837,13 @@ static FORCE_INLINE int32_t tDecodeSKv(SCoder* pDecoder, SKv* pKv) {
return
0
;
return
0
;
}
}
static
FORCE_INLINE
int32_t
tEncodeSClientHbKey
(
S
C
oder
*
pEncoder
,
const
SClientHbKey
*
pKey
)
{
static
FORCE_INLINE
int32_t
tEncodeSClientHbKey
(
S
Enc
oder
*
pEncoder
,
const
SClientHbKey
*
pKey
)
{
if
(
tEncodeI64
(
pEncoder
,
pKey
->
tscRid
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pKey
->
tscRid
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pKey
->
connType
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pKey
->
connType
)
<
0
)
return
-
1
;
return
0
;
return
0
;
}
}
static
FORCE_INLINE
int32_t
tDecodeSClientHbKey
(
S
C
oder
*
pDecoder
,
SClientHbKey
*
pKey
)
{
static
FORCE_INLINE
int32_t
tDecodeSClientHbKey
(
S
Dec
oder
*
pDecoder
,
SClientHbKey
*
pKey
)
{
if
(
tDecodeI64
(
pDecoder
,
&
pKey
->
tscRid
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pKey
->
tscRid
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pKey
->
connType
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pKey
->
connType
)
<
0
)
return
-
1
;
return
0
;
return
0
;
...
@@ -2046,10 +2046,10 @@ typedef struct {
...
@@ -2046,10 +2046,10 @@ typedef struct {
int32_t
reserved
;
int32_t
reserved
;
}
SMqCMCommitOffsetRsp
;
}
SMqCMCommitOffsetRsp
;
int32_t
tEncodeSMqOffset
(
S
C
oder
*
encoder
,
const
SMqOffset
*
pOffset
);
int32_t
tEncodeSMqOffset
(
S
Enc
oder
*
encoder
,
const
SMqOffset
*
pOffset
);
int32_t
tDecodeSMqOffset
(
S
C
oder
*
decoder
,
SMqOffset
*
pOffset
);
int32_t
tDecodeSMqOffset
(
S
Dec
oder
*
decoder
,
SMqOffset
*
pOffset
);
int32_t
tEncodeSMqCMCommitOffsetReq
(
S
C
oder
*
encoder
,
const
SMqCMCommitOffsetReq
*
pReq
);
int32_t
tEncodeSMqCMCommitOffsetReq
(
S
Enc
oder
*
encoder
,
const
SMqCMCommitOffsetReq
*
pReq
);
int32_t
tDecodeSMqCMCommitOffsetReq
(
S
C
oder
*
decoder
,
SMqCMCommitOffsetReq
*
pReq
);
int32_t
tDecodeSMqCMCommitOffsetReq
(
S
Dec
oder
*
decoder
,
SMqCMCommitOffsetReq
*
pReq
);
static
FORCE_INLINE
SSchemaWrapper
*
tCloneSSchemaWrapper
(
const
SSchemaWrapper
*
pSchemaWrapper
)
{
static
FORCE_INLINE
SSchemaWrapper
*
tCloneSSchemaWrapper
(
const
SSchemaWrapper
*
pSchemaWrapper
)
{
SSchemaWrapper
*
pSW
=
(
SSchemaWrapper
*
)
taosMemoryMalloc
(
sizeof
(
SSchemaWrapper
));
SSchemaWrapper
*
pSW
=
(
SSchemaWrapper
*
)
taosMemoryMalloc
(
sizeof
(
SSchemaWrapper
));
...
@@ -2089,7 +2089,7 @@ static FORCE_INLINE void* taosDecodeSSchema(const void* buf, SSchema* pSchema) {
...
@@ -2089,7 +2089,7 @@ static FORCE_INLINE void* taosDecodeSSchema(const void* buf, SSchema* pSchema) {
return
(
void
*
)
buf
;
return
(
void
*
)
buf
;
}
}
static
FORCE_INLINE
int32_t
tEncodeSSchema
(
S
C
oder
*
pEncoder
,
const
SSchema
*
pSchema
)
{
static
FORCE_INLINE
int32_t
tEncodeSSchema
(
S
Enc
oder
*
pEncoder
,
const
SSchema
*
pSchema
)
{
if
(
tEncodeI8
(
pEncoder
,
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pSchema
->
flags
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pSchema
->
flags
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pEncoder
,
pSchema
->
bytes
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pEncoder
,
pSchema
->
bytes
)
<
0
)
return
-
1
;
...
@@ -2098,7 +2098,7 @@ static FORCE_INLINE int32_t tEncodeSSchema(SCoder* pEncoder, const SSchema* pSch
...
@@ -2098,7 +2098,7 @@ static FORCE_INLINE int32_t tEncodeSSchema(SCoder* pEncoder, const SSchema* pSch
return
0
;
return
0
;
}
}
static
FORCE_INLINE
int32_t
tDecodeSSchema
(
S
C
oder
*
pDecoder
,
SSchema
*
pSchema
)
{
static
FORCE_INLINE
int32_t
tDecodeSSchema
(
S
Dec
oder
*
pDecoder
,
SSchema
*
pSchema
)
{
if
(
tDecodeI8
(
pDecoder
,
&
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pSchema
->
flags
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pSchema
->
flags
)
<
0
)
return
-
1
;
if
(
tDecodeI32v
(
pDecoder
,
&
pSchema
->
bytes
)
<
0
)
return
-
1
;
if
(
tDecodeI32v
(
pDecoder
,
&
pSchema
->
bytes
)
<
0
)
return
-
1
;
...
@@ -2131,7 +2131,7 @@ static FORCE_INLINE void* taosDecodeSSchemaWrapper(const void* buf, SSchemaWrapp
...
@@ -2131,7 +2131,7 @@ static FORCE_INLINE void* taosDecodeSSchemaWrapper(const void* buf, SSchemaWrapp
return
(
void
*
)
buf
;
return
(
void
*
)
buf
;
}
}
static
FORCE_INLINE
int32_t
tEncodeSSchemaWrapper
(
S
C
oder
*
pEncoder
,
const
SSchemaWrapper
*
pSW
)
{
static
FORCE_INLINE
int32_t
tEncodeSSchemaWrapper
(
S
Enc
oder
*
pEncoder
,
const
SSchemaWrapper
*
pSW
)
{
if
(
tEncodeI32v
(
pEncoder
,
pSW
->
nCols
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pEncoder
,
pSW
->
nCols
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pEncoder
,
pSW
->
sver
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pEncoder
,
pSW
->
sver
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
pSW
->
nCols
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
pSW
->
nCols
;
i
++
)
{
...
@@ -2141,7 +2141,7 @@ static FORCE_INLINE int32_t tEncodeSSchemaWrapper(SCoder* pEncoder, const SSchem
...
@@ -2141,7 +2141,7 @@ static FORCE_INLINE int32_t tEncodeSSchemaWrapper(SCoder* pEncoder, const SSchem
return
0
;
return
0
;
}
}
static
FORCE_INLINE
int32_t
tDecodeSSchemaWrapper
(
S
C
oder
*
pDecoder
,
SSchemaWrapper
*
pSW
)
{
static
FORCE_INLINE
int32_t
tDecodeSSchemaWrapper
(
S
Dec
oder
*
pDecoder
,
SSchemaWrapper
*
pSW
)
{
if
(
tDecodeI32v
(
pDecoder
,
&
pSW
->
nCols
)
<
0
)
return
-
1
;
if
(
tDecodeI32v
(
pDecoder
,
&
pSW
->
nCols
)
<
0
)
return
-
1
;
if
(
tDecodeI32v
(
pDecoder
,
&
pSW
->
sver
)
<
0
)
return
-
1
;
if
(
tDecodeI32v
(
pDecoder
,
&
pSW
->
sver
)
<
0
)
return
-
1
;
...
@@ -2596,8 +2596,8 @@ typedef struct {
...
@@ -2596,8 +2596,8 @@ typedef struct {
int64_t
suid
;
int64_t
suid
;
int64_t
uid
;
int64_t
uid
;
int32_t
sver
;
int32_t
sver
;
uint
64_t
nData
;
uint
32_t
nData
;
const
void
*
pData
;
const
uint8_t
*
pData
;
SVCreateTbReq
cTbReq
;
SVCreateTbReq
cTbReq
;
}
SVSubmitBlk
;
}
SVSubmitBlk
;
...
@@ -2610,8 +2610,8 @@ typedef struct {
...
@@ -2610,8 +2610,8 @@ typedef struct {
};
};
}
SVSubmitReq
;
}
SVSubmitReq
;
int32_t
tEncodeSVSubmitReq
(
S
C
oder
*
pCoder
,
const
SVSubmitReq
*
pReq
);
int32_t
tEncodeSVSubmitReq
(
S
Enc
oder
*
pCoder
,
const
SVSubmitReq
*
pReq
);
int32_t
tDecodeSVSubmitReq
(
S
C
oder
*
pCoder
,
SVSubmitReq
*
pReq
);
int32_t
tDecodeSVSubmitReq
(
S
Dec
oder
*
pCoder
,
SVSubmitReq
*
pReq
);
#pragma pack(pop)
#pragma pack(pop)
...
...
include/libs/stream/tstream.h
浏览文件 @
a06bf6e5
...
@@ -154,8 +154,8 @@ typedef struct {
...
@@ -154,8 +154,8 @@ typedef struct {
}
SStreamTask
;
}
SStreamTask
;
SStreamTask
*
tNewSStreamTask
(
int64_t
streamId
);
SStreamTask
*
tNewSStreamTask
(
int64_t
streamId
);
int32_t
tEncodeSStreamTask
(
S
C
oder
*
pEncoder
,
const
SStreamTask
*
pTask
);
int32_t
tEncodeSStreamTask
(
S
Enc
oder
*
pEncoder
,
const
SStreamTask
*
pTask
);
int32_t
tDecodeSStreamTask
(
S
C
oder
*
pDecoder
,
SStreamTask
*
pTask
);
int32_t
tDecodeSStreamTask
(
S
Dec
oder
*
pDecoder
,
SStreamTask
*
pTask
);
void
tFreeSStreamTask
(
SStreamTask
*
pTask
);
void
tFreeSStreamTask
(
SStreamTask
*
pTask
);
typedef
struct
{
typedef
struct
{
...
...
include/util/tencode.h
浏览文件 @
a06bf6e5
此差异已折叠。
点击以展开。
source/client/src/tmq.c
浏览文件 @
a06bf6e5
...
@@ -547,21 +547,21 @@ tmq_resp_err_t tmq_commit(tmq_t* tmq, const tmq_topic_vgroup_list_t* offsets, in
...
@@ -547,21 +547,21 @@ tmq_resp_err_t tmq_commit(tmq_t* tmq, const tmq_topic_vgroup_list_t* offsets, in
req
.
offsets
=
(
SMqOffset
*
)
offsets
->
container
.
pData
;
req
.
offsets
=
(
SMqOffset
*
)
offsets
->
container
.
pData
;
}
}
S
C
oder
encoder
;
S
Enc
oder
encoder
;
t
CoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
NULL
,
0
,
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
NULL
,
0
);
tEncodeSMqCMCommitOffsetReq
(
&
encoder
,
&
req
);
tEncodeSMqCMCommitOffsetReq
(
&
encoder
,
&
req
);
int32_t
tlen
=
encoder
.
pos
;
int32_t
tlen
=
encoder
.
pos
;
void
*
buf
=
taosMemoryMalloc
(
tlen
);
void
*
buf
=
taosMemoryMalloc
(
tlen
);
if
(
buf
==
NULL
)
{
if
(
buf
==
NULL
)
{
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
return
-
1
;
return
-
1
;
}
}
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
t
CoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
tlen
,
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
buf
,
tlen
);
tEncodeSMqCMCommitOffsetReq
(
&
encoder
,
&
req
);
tEncodeSMqCMCommitOffsetReq
(
&
encoder
,
&
req
);
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
pRequest
=
createRequest
(
tmq
->
pTscObj
,
NULL
,
NULL
,
TDMT_MND_MQ_COMMIT_OFFSET
);
pRequest
=
createRequest
(
tmq
->
pTscObj
,
NULL
,
NULL
,
TDMT_MND_MQ_COMMIT_OFFSET
);
if
(
pRequest
==
NULL
)
{
if
(
pRequest
==
NULL
)
{
...
...
source/common/src/tmsg.c
浏览文件 @
a06bf6e5
此差异已折叠。
点击以展开。
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
a06bf6e5
...
@@ -594,8 +594,8 @@ typedef struct {
...
@@ -594,8 +594,8 @@ typedef struct {
SSchemaWrapper
outputSchema
;
SSchemaWrapper
outputSchema
;
}
SStreamObj
;
}
SStreamObj
;
int32_t
tEncodeSStreamObj
(
S
C
oder
*
pEncoder
,
const
SStreamObj
*
pObj
);
int32_t
tEncodeSStreamObj
(
S
Enc
oder
*
pEncoder
,
const
SStreamObj
*
pObj
);
int32_t
tDecodeSStreamObj
(
S
C
oder
*
pDecoder
,
SStreamObj
*
pObj
);
int32_t
tDecodeSStreamObj
(
S
Dec
oder
*
pDecoder
,
SStreamObj
*
pObj
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/mnode/impl/src/mndDef.c
浏览文件 @
a06bf6e5
...
@@ -411,7 +411,7 @@ void *tDecodeSMqSubActionLogObj(const void *buf, SMqSubActionLogObj *pLog) {
...
@@ -411,7 +411,7 @@ void *tDecodeSMqSubActionLogObj(const void *buf, SMqSubActionLogObj *pLog) {
return
(
void
*
)
buf
;
return
(
void
*
)
buf
;
}
}
int32_t
tEncodeSStreamObj
(
S
C
oder
*
pEncoder
,
const
SStreamObj
*
pObj
)
{
int32_t
tEncodeSStreamObj
(
S
Enc
oder
*
pEncoder
,
const
SStreamObj
*
pObj
)
{
int32_t
sz
=
0
;
int32_t
sz
=
0
;
/*int32_t outputNameSz = 0;*/
/*int32_t outputNameSz = 0;*/
if
(
tEncodeCStr
(
pEncoder
,
pObj
->
name
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
pObj
->
name
)
<
0
)
return
-
1
;
...
@@ -462,7 +462,7 @@ int32_t tEncodeSStreamObj(SCoder *pEncoder, const SStreamObj *pObj) {
...
@@ -462,7 +462,7 @@ int32_t tEncodeSStreamObj(SCoder *pEncoder, const SStreamObj *pObj) {
return
pEncoder
->
pos
;
return
pEncoder
->
pos
;
}
}
int32_t
tDecodeSStreamObj
(
S
C
oder
*
pDecoder
,
SStreamObj
*
pObj
)
{
int32_t
tDecodeSStreamObj
(
S
Dec
oder
*
pDecoder
,
SStreamObj
*
pObj
)
{
if
(
tDecodeCStrTo
(
pDecoder
,
pObj
->
name
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pObj
->
name
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pObj
->
sourceDb
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pObj
->
sourceDb
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pObj
->
createTime
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pObj
->
createTime
)
<
0
)
return
-
1
;
...
...
source/dnode/mnode/impl/src/mndOffset.c
浏览文件 @
a06bf6e5
...
@@ -157,8 +157,8 @@ static int32_t mndProcessCommitOffsetReq(SNodeMsg *pMsg) {
...
@@ -157,8 +157,8 @@ static int32_t mndProcessCommitOffsetReq(SNodeMsg *pMsg) {
SMnode
*
pMnode
=
pMsg
->
pNode
;
SMnode
*
pMnode
=
pMsg
->
pNode
;
char
*
msgStr
=
pMsg
->
rpcMsg
.
pCont
;
char
*
msgStr
=
pMsg
->
rpcMsg
.
pCont
;
SMqCMCommitOffsetReq
commitOffsetReq
;
SMqCMCommitOffsetReq
commitOffsetReq
;
S
Coder
decoder
;
S
Decoder
decoder
;
t
CoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
msgStr
,
pMsg
->
rpcMsg
.
contLen
,
TD_DECODER
);
t
DecoderInit
(
&
decoder
,
msgStr
,
pMsg
->
rpcMsg
.
contLen
);
tDecodeSMqCMCommitOffsetReq
(
&
decoder
,
&
commitOffsetReq
);
tDecodeSMqCMCommitOffsetReq
(
&
decoder
,
&
commitOffsetReq
);
...
...
source/dnode/mnode/impl/src/mndScheduler.c
浏览文件 @
a06bf6e5
...
@@ -83,12 +83,12 @@ END:
...
@@ -83,12 +83,12 @@ END:
}
}
int32_t
mndPersistTaskDeployReq
(
STrans
*
pTrans
,
SStreamTask
*
pTask
,
const
SEpSet
*
pEpSet
,
tmsg_t
type
,
int32_t
nodeId
)
{
int32_t
mndPersistTaskDeployReq
(
STrans
*
pTrans
,
SStreamTask
*
pTask
,
const
SEpSet
*
pEpSet
,
tmsg_t
type
,
int32_t
nodeId
)
{
S
C
oder
encoder
;
S
Enc
oder
encoder
;
t
CoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
NULL
,
0
,
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
NULL
,
0
);
tEncodeSStreamTask
(
&
encoder
,
pTask
);
tEncodeSStreamTask
(
&
encoder
,
pTask
);
int32_t
size
=
encoder
.
pos
;
int32_t
size
=
encoder
.
pos
;
int32_t
tlen
=
sizeof
(
SMsgHead
)
+
size
;
int32_t
tlen
=
sizeof
(
SMsgHead
)
+
size
;
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
void
*
buf
=
taosMemoryMalloc
(
tlen
);
void
*
buf
=
taosMemoryMalloc
(
tlen
);
if
(
buf
==
NULL
)
{
if
(
buf
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
@@ -96,9 +96,9 @@ int32_t mndPersistTaskDeployReq(STrans* pTrans, SStreamTask* pTask, const SEpSet
...
@@ -96,9 +96,9 @@ int32_t mndPersistTaskDeployReq(STrans* pTrans, SStreamTask* pTask, const SEpSet
}
}
((
SMsgHead
*
)
buf
)
->
vgId
=
htonl
(
nodeId
);
((
SMsgHead
*
)
buf
)
->
vgId
=
htonl
(
nodeId
);
void
*
abuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
void
*
abuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
t
CoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
abuf
,
size
,
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
abuf
,
size
);
tEncodeSStreamTask
(
&
encoder
,
pTask
);
tEncodeSStreamTask
(
&
encoder
,
pTask
);
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
STransAction
action
=
{
0
};
STransAction
action
=
{
0
};
memcpy
(
&
action
.
epSet
,
pEpSet
,
sizeof
(
SEpSet
));
memcpy
(
&
action
.
epSet
,
pEpSet
,
sizeof
(
SEpSet
));
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
a06bf6e5
...
@@ -369,7 +369,7 @@ static FORCE_INLINE int schemaExColIdCompare(const void *colId, const void *pSch
...
@@ -369,7 +369,7 @@ static FORCE_INLINE int schemaExColIdCompare(const void *colId, const void *pSch
}
}
static
void
*
mndBuildVCreateStbReq
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SStbObj
*
pStb
,
int32_t
*
pContLen
)
{
static
void
*
mndBuildVCreateStbReq
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SStbObj
*
pStb
,
int32_t
*
pContLen
)
{
S
Coder
coder
=
{
0
};
S
Encoder
en
coder
=
{
0
};
int32_t
contLen
;
int32_t
contLen
;
SName
name
=
{
0
};
SName
name
=
{
0
};
SVCreateStbReq
req
=
{
0
};
SVCreateStbReq
req
=
{
0
};
...
@@ -422,11 +422,11 @@ static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pSt
...
@@ -422,11 +422,11 @@ static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pSt
pHead
->
vgId
=
htonl
(
pVgroup
->
vgId
);
pHead
->
vgId
=
htonl
(
pVgroup
->
vgId
);
void
*
pBuf
=
POINTER_SHIFT
(
pHead
,
sizeof
(
SMsgHead
));
void
*
pBuf
=
POINTER_SHIFT
(
pHead
,
sizeof
(
SMsgHead
));
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pBuf
,
contLen
-
sizeof
(
SMsgHead
),
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
pBuf
,
contLen
-
sizeof
(
SMsgHead
)
);
if
(
tEncodeSVCreateStbReq
(
&
coder
,
&
req
)
<
0
)
{
if
(
tEncodeSVCreateStbReq
(
&
en
coder
,
&
req
)
<
0
)
{
return
NULL
;
return
NULL
;
}
}
t
CoderClear
(
&
coder
);
t
EncoderClear
(
&
en
coder
);
*
pContLen
=
contLen
;
*
pContLen
=
contLen
;
taosMemoryFreeClear
(
req
.
pRSmaParam
.
qmsg1
);
taosMemoryFreeClear
(
req
.
pRSmaParam
.
qmsg1
);
...
@@ -440,7 +440,7 @@ static void *mndBuildVDropStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb,
...
@@ -440,7 +440,7 @@ static void *mndBuildVDropStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb,
int32_t
contLen
=
0
;
int32_t
contLen
=
0
;
int32_t
ret
=
0
;
int32_t
ret
=
0
;
SMsgHead
*
pHead
=
NULL
;
SMsgHead
*
pHead
=
NULL
;
S
Coder
coder
=
{
0
};
S
Encoder
en
coder
=
{
0
};
tNameFromString
(
&
name
,
pStb
->
name
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
tNameFromString
(
&
name
,
pStb
->
name
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
...
@@ -462,9 +462,9 @@ static void *mndBuildVDropStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb,
...
@@ -462,9 +462,9 @@ static void *mndBuildVDropStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb,
void
*
pBuf
=
POINTER_SHIFT
(
pHead
,
sizeof
(
SMsgHead
));
void
*
pBuf
=
POINTER_SHIFT
(
pHead
,
sizeof
(
SMsgHead
));
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pBuf
,
contLen
-
sizeof
(
SMsgHead
),
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
pBuf
,
contLen
-
sizeof
(
SMsgHead
)
);
tEncodeSVDropStbReq
(
&
coder
,
&
req
);
tEncodeSVDropStbReq
(
&
en
coder
,
&
req
);
t
CoderClear
(
&
coder
);
t
EncoderClear
(
&
en
coder
);
*
pContLen
=
contLen
;
*
pContLen
=
contLen
;
return
pHead
;
return
pHead
;
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
a06bf6e5
...
@@ -70,14 +70,14 @@ SSdbRaw *mndStreamActionEncode(SStreamObj *pStream) {
...
@@ -70,14 +70,14 @@ SSdbRaw *mndStreamActionEncode(SStreamObj *pStream) {
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
void
*
buf
=
NULL
;
void
*
buf
=
NULL
;
S
C
oder
encoder
;
S
Enc
oder
encoder
;
t
CoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
NULL
,
0
,
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
NULL
,
0
);
if
(
tEncodeSStreamObj
(
&
encoder
,
pStream
)
<
0
)
{
if
(
tEncodeSStreamObj
(
&
encoder
,
pStream
)
<
0
)
{
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
goto
STREAM_ENCODE_OVER
;
goto
STREAM_ENCODE_OVER
;
}
}
int32_t
tlen
=
encoder
.
pos
;
int32_t
tlen
=
encoder
.
pos
;
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
int32_t
size
=
sizeof
(
int32_t
)
+
tlen
+
MND_STREAM_RESERVE_SIZE
;
int32_t
size
=
sizeof
(
int32_t
)
+
tlen
+
MND_STREAM_RESERVE_SIZE
;
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_STREAM
,
MND_STREAM_VER_NUMBER
,
size
);
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_STREAM
,
MND_STREAM_VER_NUMBER
,
size
);
...
@@ -86,12 +86,12 @@ SSdbRaw *mndStreamActionEncode(SStreamObj *pStream) {
...
@@ -86,12 +86,12 @@ SSdbRaw *mndStreamActionEncode(SStreamObj *pStream) {
buf
=
taosMemoryMalloc
(
tlen
);
buf
=
taosMemoryMalloc
(
tlen
);
if
(
buf
==
NULL
)
goto
STREAM_ENCODE_OVER
;
if
(
buf
==
NULL
)
goto
STREAM_ENCODE_OVER
;
t
CoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
tlen
,
TD_ENCODER
);
t
EncoderInit
(
&
encoder
,
buf
,
tlen
);
if
(
tEncodeSStreamObj
(
&
encoder
,
pStream
)
<
0
)
{
if
(
tEncodeSStreamObj
(
&
encoder
,
pStream
)
<
0
)
{
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
goto
STREAM_ENCODE_OVER
;
goto
STREAM_ENCODE_OVER
;
}
}
t
C
oderClear
(
&
encoder
);
t
Enc
oderClear
(
&
encoder
);
int32_t
dataPos
=
0
;
int32_t
dataPos
=
0
;
SDB_SET_INT32
(
pRaw
,
dataPos
,
tlen
,
STREAM_ENCODE_OVER
);
SDB_SET_INT32
(
pRaw
,
dataPos
,
tlen
,
STREAM_ENCODE_OVER
);
...
@@ -138,8 +138,8 @@ SSdbRow *mndStreamActionDecode(SSdbRaw *pRaw) {
...
@@ -138,8 +138,8 @@ SSdbRow *mndStreamActionDecode(SSdbRaw *pRaw) {
if
(
buf
==
NULL
)
goto
STREAM_DECODE_OVER
;
if
(
buf
==
NULL
)
goto
STREAM_DECODE_OVER
;
SDB_GET_BINARY
(
pRaw
,
dataPos
,
buf
,
tlen
,
STREAM_DECODE_OVER
);
SDB_GET_BINARY
(
pRaw
,
dataPos
,
buf
,
tlen
,
STREAM_DECODE_OVER
);
S
C
oder
decoder
;
S
Dec
oder
decoder
;
t
CoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
buf
,
tlen
+
1
,
TD_DECODER
);
t
DecoderInit
(
&
decoder
,
buf
,
tlen
+
1
);
if
(
tDecodeSStreamObj
(
&
decoder
,
pStream
)
<
0
)
{
if
(
tDecodeSStreamObj
(
&
decoder
,
pStream
)
<
0
)
{
goto
STREAM_DECODE_OVER
;
goto
STREAM_DECODE_OVER
;
}
}
...
...
source/dnode/snode/src/snode.c
浏览文件 @
a06bf6e5
...
@@ -99,10 +99,10 @@ void sndProcessUMsg(SSnode *pSnode, SRpcMsg *pMsg) {
...
@@ -99,10 +99,10 @@ void sndProcessUMsg(SSnode *pSnode, SRpcMsg *pMsg) {
ASSERT
(
0
);
ASSERT
(
0
);
return
;
return
;
}
}
S
C
oder
decoder
;
S
Dec
oder
decoder
;
t
CoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
msg
,
pMsg
->
contLen
-
sizeof
(
SMsgHead
),
TD_DECODER
);
t
DecoderInit
(
&
decoder
,
msg
,
pMsg
->
contLen
-
sizeof
(
SMsgHead
)
);
tDecodeSStreamTask
(
&
decoder
,
pTask
);
tDecodeSStreamTask
(
&
decoder
,
pTask
);
t
C
oderClear
(
&
decoder
);
t
Dec
oderClear
(
&
decoder
);
sndMetaDeployTask
(
pSnode
->
pMeta
,
pTask
);
sndMetaDeployTask
(
pSnode
->
pMeta
,
pTask
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SND_TASK_EXEC
)
{
}
else
if
(
pMsg
->
msgType
==
TDMT_SND_TASK_EXEC
)
{
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
a06bf6e5
...
@@ -108,7 +108,7 @@ int32_t tsdbQuerySTableByTagCond(void *pMeta, uint64_t uid, TSKEY skey, con
...
@@ -108,7 +108,7 @@ int32_t tsdbQuerySTableByTagCond(void *pMeta, uint64_t uid, TSKEY skey, con
int64_t
tsdbGetNumOfRowsInMemTable
(
tsdbReaderT
*
pHandle
);
int64_t
tsdbGetNumOfRowsInMemTable
(
tsdbReaderT
*
pHandle
);
bool
tsdbNextDataBlock
(
tsdbReaderT
pTsdbReadHandle
);
bool
tsdbNextDataBlock
(
tsdbReaderT
pTsdbReadHandle
);
void
tsdbRetrieveDataBlockInfo
(
tsdbReaderT
*
pTsdbReadHandle
,
SDataBlockInfo
*
pBlockInfo
);
void
tsdbRetrieveDataBlockInfo
(
tsdbReaderT
*
pTsdbReadHandle
,
SDataBlockInfo
*
pBlockInfo
);
int32_t
tsdbRetrieveDataBlockStatisInfo
(
tsdbReaderT
*
pTsdbReadHandle
,
SColumnDataAgg
***
pBlockStatis
,
bool
*
allHave
);
int32_t
tsdbRetrieveDataBlockStatisInfo
(
tsdbReaderT
*
pTsdbReadHandle
,
SColumnDataAgg
***
pBlockStatis
,
bool
*
allHave
);
SArray
*
tsdbRetrieveDataBlock
(
tsdbReaderT
*
pTsdbReadHandle
,
SArray
*
pColumnIdList
);
SArray
*
tsdbRetrieveDataBlock
(
tsdbReaderT
*
pTsdbReadHandle
,
SArray
*
pColumnIdList
);
void
tsdbResetReadHandle
(
tsdbReaderT
queryHandle
,
SQueryTableDataCond
*
pCond
);
void
tsdbResetReadHandle
(
tsdbReaderT
queryHandle
,
SQueryTableDataCond
*
pCond
);
void
tsdbDestroyTableGroup
(
STableGroupInfo
*
pGroupList
);
void
tsdbDestroyTableGroup
(
STableGroupInfo
*
pGroupList
);
...
@@ -126,8 +126,8 @@ int tqReadHandleSetTbUidList(STqReadHandle *pHandle, const SArray *tbUidList
...
@@ -126,8 +126,8 @@ int tqReadHandleSetTbUidList(STqReadHandle *pHandle, const SArray *tbUidList
int
tqReadHandleAddTbUidList
(
STqReadHandle
*
pHandle
,
const
SArray
*
tbUidList
);
int
tqReadHandleAddTbUidList
(
STqReadHandle
*
pHandle
,
const
SArray
*
tbUidList
);
int32_t
tqReadHandleSetMsg
(
STqReadHandle
*
pHandle
,
SSubmitReq
*
pMsg
,
int64_t
ver
);
int32_t
tqReadHandleSetMsg
(
STqReadHandle
*
pHandle
,
SSubmitReq
*
pMsg
,
int64_t
ver
);
bool
tqNextDataBlock
(
STqReadHandle
*
pHandle
);
bool
tqNextDataBlock
(
STqReadHandle
*
pHandle
);
int32_t
tqRetrieveDataBlock
(
SArray
**
ppCols
,
STqReadHandle
*
pHandle
,
uint64_t
*
pGroupId
,
uint64_t
*
pUid
,
int32_t
*
pNumOfRows
,
int32_t
tqRetrieveDataBlock
(
SArray
**
ppCols
,
STqReadHandle
*
pHandle
,
uint64_t
*
pGroupId
,
uint64_t
*
pUid
,
int16_t
*
pNumOfCols
);
int
32_t
*
pNumOfRows
,
int
16_t
*
pNumOfCols
);
// need to reposition
// need to reposition
...
@@ -192,7 +192,7 @@ struct SMetaEntry {
...
@@ -192,7 +192,7 @@ struct SMetaEntry {
int64_t
ctime
;
int64_t
ctime
;
int32_t
ttlDays
;
int32_t
ttlDays
;
tb_uid_t
suid
;
tb_uid_t
suid
;
const
void
*
pTags
;
const
uint8_t
*
pTags
;
}
ctbEntry
;
}
ctbEntry
;
struct
{
struct
{
int64_t
ctime
;
int64_t
ctime
;
...
@@ -205,7 +205,7 @@ struct SMetaEntry {
...
@@ -205,7 +205,7 @@ struct SMetaEntry {
struct
SMetaReader
{
struct
SMetaReader
{
int32_t
flags
;
int32_t
flags
;
SMeta
*
pMeta
;
SMeta
*
pMeta
;
S
Coder
coder
;
S
Decoder
coder
;
SMetaEntry
me
;
SMetaEntry
me
;
void
*
pBuf
;
void
*
pBuf
;
int
szBuf
;
int
szBuf
;
...
...
source/dnode/vnode/src/inc/meta.h
浏览文件 @
a06bf6e5
...
@@ -39,8 +39,8 @@ typedef struct SMSmaCursor SMSmaCursor;
...
@@ -39,8 +39,8 @@ typedef struct SMSmaCursor SMSmaCursor;
// metaOpen ==================
// metaOpen ==================
// metaEntry ==================
// metaEntry ==================
int
metaEncodeEntry
(
S
C
oder
*
pCoder
,
const
SMetaEntry
*
pME
);
int
metaEncodeEntry
(
S
Enc
oder
*
pCoder
,
const
SMetaEntry
*
pME
);
int
metaDecodeEntry
(
S
C
oder
*
pCoder
,
SMetaEntry
*
pME
);
int
metaDecodeEntry
(
S
Dec
oder
*
pCoder
,
SMetaEntry
*
pME
);
// metaTable ==================
// metaTable ==================
...
...
source/dnode/vnode/src/meta/metaEntry.c
浏览文件 @
a06bf6e5
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include "meta.h"
#include "meta.h"
int
metaEncodeEntry
(
S
C
oder
*
pCoder
,
const
SMetaEntry
*
pME
)
{
int
metaEncodeEntry
(
S
Enc
oder
*
pCoder
,
const
SMetaEntry
*
pME
)
{
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pME
->
version
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pME
->
version
)
<
0
)
return
-
1
;
...
@@ -43,8 +43,8 @@ int metaEncodeEntry(SCoder *pCoder, const SMetaEntry *pME) {
...
@@ -43,8 +43,8 @@ int metaEncodeEntry(SCoder *pCoder, const SMetaEntry *pME) {
return
0
;
return
0
;
}
}
int
metaDecodeEntry
(
S
C
oder
*
pCoder
,
SMetaEntry
*
pME
)
{
int
metaDecodeEntry
(
S
Dec
oder
*
pCoder
,
SMetaEntry
*
pME
)
{
uint
64
_t
len
;
uint
32
_t
len
;
if
(
tStartDecode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tStartDecode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pME
->
version
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pME
->
version
)
<
0
)
return
-
1
;
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
a06bf6e5
...
@@ -22,7 +22,7 @@ void metaReaderInit(SMetaReader *pReader, SMeta *pMeta, int32_t flags) {
...
@@ -22,7 +22,7 @@ void metaReaderInit(SMetaReader *pReader, SMeta *pMeta, int32_t flags) {
}
}
void
metaReaderClear
(
SMetaReader
*
pReader
)
{
void
metaReaderClear
(
SMetaReader
*
pReader
)
{
t
C
oderClear
(
&
pReader
->
coder
);
t
Dec
oderClear
(
&
pReader
->
coder
);
tdbFree
(
pReader
->
pBuf
);
tdbFree
(
pReader
->
pBuf
);
}
}
...
@@ -37,7 +37,7 @@ int metaGetTableEntryByVersion(SMetaReader *pReader, int64_t version, tb_uid_t u
...
@@ -37,7 +37,7 @@ int metaGetTableEntryByVersion(SMetaReader *pReader, int64_t version, tb_uid_t u
}
}
// decode the entry
// decode the entry
t
CoderInit
(
&
pReader
->
coder
,
TD_LITTLE_ENDIAN
,
pReader
->
pBuf
,
pReader
->
szBuf
,
TD_DECODER
);
t
DecoderInit
(
&
pReader
->
coder
,
pReader
->
pBuf
,
pReader
->
szBuf
);
if
(
metaDecodeEntry
(
&
pReader
->
coder
,
&
pReader
->
me
)
<
0
)
{
if
(
metaDecodeEntry
(
&
pReader
->
coder
,
&
pReader
->
me
)
<
0
)
{
goto
_err
;
goto
_err
;
...
@@ -147,7 +147,7 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
...
@@ -147,7 +147,7 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
SSchemaWrapper
*
pSW
=
NULL
;
SSchemaWrapper
*
pSW
=
NULL
;
SSchema
*
pSchema
=
NULL
;
SSchema
*
pSchema
=
NULL
;
void
*
pBuf
;
void
*
pBuf
;
S
Coder
coder
=
{
0
};
S
Decoder
coder
=
{
0
};
// fetch
// fetch
skmDbKey
.
uid
=
uid
;
skmDbKey
.
uid
=
uid
;
...
@@ -163,11 +163,11 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
...
@@ -163,11 +163,11 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
pBuf
=
pVal
;
pBuf
=
pVal
;
pSW
=
taosMemoryMalloc
(
sizeof
(
SSchemaWrapper
));
pSW
=
taosMemoryMalloc
(
sizeof
(
SSchemaWrapper
));
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pVal
,
vLen
,
TD_DECODER
);
t
DecoderInit
(
&
coder
,
pVal
,
vLen
);
tDecodeSSchemaWrapper
(
&
coder
,
pSW
);
tDecodeSSchemaWrapper
(
&
coder
,
pSW
);
pSchema
=
taosMemoryMalloc
(
sizeof
(
SSchema
)
*
pSW
->
nCols
);
pSchema
=
taosMemoryMalloc
(
sizeof
(
SSchema
)
*
pSW
->
nCols
);
memcpy
(
pSchema
,
pSW
->
pSchema
,
sizeof
(
SSchema
)
*
pSW
->
nCols
);
memcpy
(
pSchema
,
pSW
->
pSchema
,
sizeof
(
SSchema
)
*
pSW
->
nCols
);
t
C
oderClear
(
&
coder
);
t
Dec
oderClear
(
&
coder
);
pSW
->
pSchema
=
pSchema
;
pSW
->
pSchema
=
pSchema
;
...
...
source/dnode/vnode/src/meta/metaTDBImpl.c
已删除
100644 → 0
浏览文件 @
6ce36a08
此差异已折叠。
点击以展开。
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
a06bf6e5
...
@@ -33,7 +33,6 @@ int metaCreateSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
...
@@ -33,7 +33,6 @@ int metaCreateSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
void
*
pBuf
=
NULL
;
void
*
pBuf
=
NULL
;
int32_t
szBuf
=
0
;
int32_t
szBuf
=
0
;
void
*
p
=
NULL
;
void
*
p
=
NULL
;
SCoder
coder
=
{
0
};
SMetaReader
mr
=
{
0
};
SMetaReader
mr
=
{
0
};
// validate req
// validate req
...
@@ -192,7 +191,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq) {
...
@@ -192,7 +191,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq) {
tb_uid_t
uid
;
tb_uid_t
uid
;
int64_t
tver
;
int64_t
tver
;
SMetaEntry
me
=
{
0
};
SMetaEntry
me
=
{
0
};
S
Coder
coder
=
{
0
};
S
Decoder
coder
=
{
0
};
int8_t
type
;
int8_t
type
;
int64_t
ctime
;
int64_t
ctime
;
tb_uid_t
suid
;
tb_uid_t
suid
;
...
@@ -253,7 +252,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq) {
...
@@ -253,7 +252,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq) {
// decode entry
// decode entry
void
*
pDataCopy
=
taosMemoryMalloc
(
nData
);
// remove the copy (todo)
void
*
pDataCopy
=
taosMemoryMalloc
(
nData
);
// remove the copy (todo)
memcpy
(
pDataCopy
,
pData
,
nData
);
memcpy
(
pDataCopy
,
pData
,
nData
);
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pDataCopy
,
nData
,
TD_DECODER
);
t
DecoderInit
(
&
coder
,
pDataCopy
,
nData
);
ret
=
metaDecodeEntry
(
&
coder
,
&
me
);
ret
=
metaDecodeEntry
(
&
coder
,
&
me
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ASSERT
(
0
);
ASSERT
(
0
);
...
@@ -272,7 +271,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq) {
...
@@ -272,7 +271,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq) {
}
}
taosMemoryFree
(
pDataCopy
);
taosMemoryFree
(
pDataCopy
);
t
C
oderClear
(
&
coder
);
t
Dec
oderClear
(
&
coder
);
tdbDbcClose
(
pTbDbc
);
tdbDbcClose
(
pTbDbc
);
if
(
type
==
TSDB_CHILD_TABLE
)
{
if
(
type
==
TSDB_CHILD_TABLE
)
{
...
@@ -309,7 +308,7 @@ static int metaSaveToTbDb(SMeta *pMeta, const SMetaEntry *pME) {
...
@@ -309,7 +308,7 @@ static int metaSaveToTbDb(SMeta *pMeta, const SMetaEntry *pME) {
void
*
pVal
=
NULL
;
void
*
pVal
=
NULL
;
int
kLen
=
0
;
int
kLen
=
0
;
int
vLen
=
0
;
int
vLen
=
0
;
S
Coder
coder
=
{
0
};
S
Encoder
coder
=
{
0
};
// set key and value
// set key and value
tbDbKey
.
version
=
pME
->
version
;
tbDbKey
.
version
=
pME
->
version
;
...
@@ -330,13 +329,13 @@ static int metaSaveToTbDb(SMeta *pMeta, const SMetaEntry *pME) {
...
@@ -330,13 +329,13 @@ static int metaSaveToTbDb(SMeta *pMeta, const SMetaEntry *pME) {
goto
_err
;
goto
_err
;
}
}
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pVal
,
vLen
,
TD_ENCODER
);
t
EncoderInit
(
&
coder
,
pVal
,
vLen
);
if
(
metaEncodeEntry
(
&
coder
,
pME
)
<
0
)
{
if
(
metaEncodeEntry
(
&
coder
,
pME
)
<
0
)
{
goto
_err
;
goto
_err
;
}
}
t
C
oderClear
(
&
coder
);
t
Enc
oderClear
(
&
coder
);
// write to table.db
// write to table.db
if
(
tdbDbInsert
(
pMeta
->
pTbDb
,
pKey
,
kLen
,
pVal
,
vLen
,
&
pMeta
->
txn
)
<
0
)
{
if
(
tdbDbInsert
(
pMeta
->
pTbDb
,
pKey
,
kLen
,
pVal
,
vLen
,
&
pMeta
->
txn
)
<
0
)
{
...
@@ -393,7 +392,7 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pME) {
...
@@ -393,7 +392,7 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pME) {
}
}
static
int
metaSaveToSkmDb
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
static
int
metaSaveToSkmDb
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
S
Coder
coder
=
{
0
};
S
Encoder
coder
=
{
0
};
void
*
pVal
=
NULL
;
void
*
pVal
=
NULL
;
int
vLen
=
0
;
int
vLen
=
0
;
int
rcode
=
0
;
int
rcode
=
0
;
...
@@ -422,7 +421,7 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
...
@@ -422,7 +421,7 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
goto
_exit
;
goto
_exit
;
}
}
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pVal
,
vLen
,
TD_ENCODER
);
t
EncoderInit
(
&
coder
,
pVal
,
vLen
);
tEncodeSSchemaWrapper
(
&
coder
,
pSW
);
tEncodeSSchemaWrapper
(
&
coder
,
pSW
);
if
(
tdbDbInsert
(
pMeta
->
pSkmDb
,
&
skmDbKey
,
sizeof
(
skmDbKey
),
pVal
,
vLen
,
&
pMeta
->
txn
)
<
0
)
{
if
(
tdbDbInsert
(
pMeta
->
pSkmDb
,
&
skmDbKey
,
sizeof
(
skmDbKey
),
pVal
,
vLen
,
&
pMeta
->
txn
)
<
0
)
{
...
@@ -432,7 +431,7 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
...
@@ -432,7 +431,7 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
_exit:
_exit:
taosMemoryFree
(
pVal
);
taosMemoryFree
(
pVal
);
t
C
oderClear
(
&
coder
);
t
Enc
oderClear
(
&
coder
);
return
rcode
;
return
rcode
;
}
}
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
a06bf6e5
...
@@ -910,12 +910,12 @@ int32_t tqProcessTaskDeploy(STQ* pTq, char* msg, int32_t msgLen) {
...
@@ -910,12 +910,12 @@ int32_t tqProcessTaskDeploy(STQ* pTq, char* msg, int32_t msgLen) {
if
(
pTask
==
NULL
)
{
if
(
pTask
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
S
C
oder
decoder
;
S
Dec
oder
decoder
;
t
CoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
(
uint8_t
*
)
msg
,
msgLen
,
TD_DECODER
);
t
DecoderInit
(
&
decoder
,
(
uint8_t
*
)
msg
,
msgLen
);
if
(
tDecodeSStreamTask
(
&
decoder
,
pTask
)
<
0
)
{
if
(
tDecodeSStreamTask
(
&
decoder
,
pTask
)
<
0
)
{
ASSERT
(
0
);
ASSERT
(
0
);
}
}
t
C
oderClear
(
&
decoder
);
t
Dec
oderClear
(
&
decoder
);
// exec
// exec
if
(
tqExpandTask
(
pTq
,
pTask
,
4
)
<
0
)
{
if
(
tqExpandTask
(
pTq
,
pTask
,
4
)
<
0
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbMemTable2.c
浏览文件 @
a06bf6e5
...
@@ -63,6 +63,8 @@ struct SMemSkipListCurosr {
...
@@ -63,6 +63,8 @@ struct SMemSkipListCurosr {
SMemSkipListNode
*
pNodeC
;
SMemSkipListNode
*
pNodeC
;
};
};
#define HASH_BUCKET(SUID, UID, NBUCKET) (TABS((SUID) + (UID)) % (NBUCKET))
#define SL_NODE_SIZE(l) (sizeof(SMemSkipListNode) + sizeof(SMemSkipListNode *) * (l)*2)
#define SL_NODE_SIZE(l) (sizeof(SMemSkipListNode) + sizeof(SMemSkipListNode *) * (l)*2)
#define SL_NODE_HALF_SIZE(l) (sizeof(SMemSkipListNode) + sizeof(SMemSkipListNode *) * (l))
#define SL_NODE_HALF_SIZE(l) (sizeof(SMemSkipListNode) + sizeof(SMemSkipListNode *) * (l))
#define SL_NODE_FORWARD(n, l) ((n)->forwards[l])
#define SL_NODE_FORWARD(n, l) ((n)->forwards[l])
...
@@ -71,6 +73,8 @@ struct SMemSkipListCurosr {
...
@@ -71,6 +73,8 @@ struct SMemSkipListCurosr {
#define SL_HEAD_NODE(sl) ((sl)->pHead)
#define SL_HEAD_NODE(sl) ((sl)->pHead)
#define SL_TAIL_NODE(sl) ((SMemSkipListNode *)&SL_NODE_FORWARD(SL_HEAD_NODE(sl), (sl)->maxLevel))
#define SL_TAIL_NODE(sl) ((SMemSkipListNode *)&SL_NODE_FORWARD(SL_HEAD_NODE(sl), (sl)->maxLevel))
#define SL_HEAD_NODE_FORWARD(n, l) SL_NODE_FORWARD(n, l)
#define SL_TAIL_NODE_BACKWARD(n, l) SL_NODE_FORWARD(n, l)
// SMemTable
// SMemTable
int32_t
tsdbMemTableCreate2
(
STsdb
*
pTsdb
,
SMemTable
**
ppMemTb
)
{
int32_t
tsdbMemTableCreate2
(
STsdb
*
pTsdb
,
SMemTable
**
ppMemTb
)
{
...
@@ -115,19 +119,14 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
...
@@ -115,19 +119,14 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
STsdb
*
pTsdb
=
pMemTb
->
pTsdb
;
STsdb
*
pTsdb
=
pMemTb
->
pTsdb
;
SVnode
*
pVnode
=
pTsdb
->
pVnode
;
SVnode
*
pVnode
=
pTsdb
->
pVnode
;
SVBufPool
*
pPool
=
pVnode
->
inUse
;
SVBufPool
*
pPool
=
pVnode
->
inUse
;
int32_t
hash
;
tb_uid_t
suid
=
pSubmitBlk
->
suid
;
int32_t
tlen
;
tb_uid_t
uid
=
pSubmitBlk
->
uid
;
uint8_t
buf
[
16
];
int32_t
iBucket
;
int32_t
rlen
;
const
uint8_t
*
p
;
// search SMemData by hash
SMemSkipListNode
*
pSlNode
;
iBucket
=
HASH_BUCKET
(
suid
,
uid
,
pMemTb
->
nBucket
);
const
STSRow
*
pTSRow
;
for
(
pMemData
=
pMemTb
->
pBuckets
[
iBucket
];
pMemData
;
pMemData
=
pMemData
->
pHashNext
)
{
SMemSkipListCurosr
slc
=
{
0
};
if
(
pMemData
->
suid
==
suid
&&
pMemData
->
uid
==
uid
)
break
;
// search hash
hash
=
(
pSubmitBlk
->
suid
+
pSubmitBlk
->
uid
)
%
pMemTb
->
nBucket
;
for
(
pMemData
=
pMemTb
->
pBuckets
[
hash
];
pMemData
;
pMemData
=
pMemData
->
pHashNext
)
{
if
(
pMemData
->
suid
==
pSubmitBlk
->
suid
&&
pMemData
->
uid
==
pSubmitBlk
->
uid
)
break
;
}
}
// create pMemData if need
// create pMemData if need
...
@@ -143,8 +142,8 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
...
@@ -143,8 +142,8 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
}
}
pMemData
->
pHashNext
=
NULL
;
pMemData
->
pHashNext
=
NULL
;
pMemData
->
suid
=
pSubmitBlk
->
suid
;
pMemData
->
suid
=
suid
;
pMemData
->
uid
=
pSubmitBlk
->
uid
;
pMemData
->
uid
=
uid
;
pMemData
->
minKey
=
TSKEY_MAX
;
pMemData
->
minKey
=
TSKEY_MAX
;
pMemData
->
maxKey
=
TSKEY_MIN
;
pMemData
->
maxKey
=
TSKEY_MIN
;
pMemData
->
minVer
=
-
1
;
pMemData
->
minVer
=
-
1
;
...
@@ -159,55 +158,67 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
...
@@ -159,55 +158,67 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
pHead
->
level
=
maxLevel
;
pHead
->
level
=
maxLevel
;
pTail
->
level
=
maxLevel
;
pTail
->
level
=
maxLevel
;
for
(
int
iLevel
=
0
;
iLevel
<
maxLevel
;
iLevel
++
)
{
for
(
int
iLevel
=
0
;
iLevel
<
maxLevel
;
iLevel
++
)
{
SL_NODE_FORWARD
(
pHead
,
iLevel
)
=
pTail
;
SL_
HEAD_
NODE_FORWARD
(
pHead
,
iLevel
)
=
pTail
;
SL_
NODE_FOR
WARD
(
pTail
,
iLevel
)
=
pHead
;
SL_
TAIL_NODE_BACK
WARD
(
pTail
,
iLevel
)
=
pHead
;
}
}
// add to MemTable
// add to hash
hash
=
(
pMemData
->
suid
+
pMemData
->
uid
)
%
pMemTb
->
nBucket
;
if
(
pMemTb
->
nHash
>=
pMemTb
->
nBucket
)
{
pMemData
->
pHashNext
=
pMemTb
->
pBuckets
[
hash
];
// rehash (todo)
pMemTb
->
pBuckets
[
hash
]
=
pMemData
;
}
iBucket
=
HASH_BUCKET
(
suid
,
uid
,
pMemTb
->
nBucket
);
pMemData
->
pHashNext
=
pMemTb
->
pBuckets
[
iBucket
];
pMemTb
->
pBuckets
[
iBucket
]
=
pMemData
;
pMemTb
->
nHash
++
;
pMemTb
->
nHash
++
;
// sort organize (todo)
}
}
// loop to insert data to skiplist
// do insert data to SMemData
#if 0
SMemSkipListCurosr
slc
=
{
0
};
tsdbMemSkipListCursorOpen(&slc, &pMemData->sl);
const
uint8_t
*
p
=
pSubmitBlk
->
pData
;
p = pSubmitBlk->pData;
const
uint8_t
*
pt
;
for (;;) {
const
STSRow
*
pRow
;
if (p - (uint8_t *)pSubmitBlk->pData >= pSubmitBlk->nData) break;
uint64_t
szRow
;
SDecoder
decoder
=
{
0
};
const uint8_t *pt = p;
// tCoderInit(&coder, TD_LITTLE_ENDIAN, pSubmitBlk->pData, pSubmitBlk->nData, TD_DECODER);
p = tGetBinary(p, &pTSRow, &rlen);
for
(;;)
{
// if (tDecodeIsEnd(&coder)) break;
// if (tDecodeBinary(&coder, (const uint8_t **)&pRow, &szRow) < 0) {
// terrno = TSDB_CODE_INVALID_MSG;
// return -1;
// }
// check the row (todo)
// check the row (todo)
// move the cursor to position to write (todo)
//
//
move the cursor to position to write (todo)
int32_t c;
//
int32_t c;
tsdbMemSkipListCursorMoveTo(&slc, pTSRow, version, &c);
//
tsdbMemSkipListCursorMoveTo(&slc, pTSRow, version, &c);
ASSERT(c);
//
ASSERT(c);
// encode row
//
//
encode row
int8_t level = tsdbMemSkipListRandLevel(&pMemData->sl);
//
int8_t level = tsdbMemSkipListRandLevel(&pMemData->sl);
int32_t tsize = SL_NODE_SIZE(level) + sizeof(version) + (p - pt);
//
int32_t tsize = SL_NODE_SIZE(level) + sizeof(version) + (p - pt);
pSlNode = vnodeBufPoolMalloc(pPool, tsize);
//
pSlNode = vnodeBufPoolMalloc(pPool, tsize);
pSlNode->level = level;
//
pSlNode->level = level;
uint8_t *pData = SL_NODE_DATA(pSlNode);
//
uint8_t *pData = SL_NODE_DATA(pSlNode);
*(int64_t *)pData = version;
//
*(int64_t *)pData = version;
pData += sizeof(version);
//
pData += sizeof(version);
memcpy(pData, pt, p - pt);
//
memcpy(pData, pt, p - pt);
// insert row
//
//
insert row
tsdbMemSkipListCursorPut(&slc, pSlNode);
//
tsdbMemSkipListCursorPut(&slc, pSlNode);
// update status
// update status
if (p
TSRow->ts < pMemData->minKey) pMemData->minKey = pTS
Row->ts;
if
(
p
Row
->
ts
<
pMemData
->
minKey
)
pMemData
->
minKey
=
p
Row
->
ts
;
if (p
TSRow->ts > pMemData->maxKey) pMemData->maxKey = pTS
Row->ts;
if
(
p
Row
->
ts
>
pMemData
->
maxKey
)
pMemData
->
maxKey
=
p
Row
->
ts
;
}
}
tsdbMemSkipListCursorClose(&slc
);
// tCoderClear(&coder
);
#endif
// tsdbMemSkipListCursorClose(&slc);
// update status
if
(
pMemData
->
minVer
==
-
1
)
pMemData
->
minVer
=
version
;
if
(
pMemData
->
minVer
==
-
1
)
pMemData
->
minVer
=
version
;
if
(
pMemData
->
maxVer
==
-
1
||
pMemData
->
maxVer
<
version
)
pMemData
->
maxVer
=
version
;
if
(
pMemData
->
maxVer
==
-
1
||
pMemData
->
maxVer
<
version
)
pMemData
->
maxVer
=
version
;
...
@@ -218,7 +229,3 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
...
@@ -218,7 +229,3 @@ int32_t tsdbInsertData2(SMemTable *pMemTb, int64_t version, const SVSubmitBlk *p
return
0
;
return
0
;
}
}
\ No newline at end of file
// SMemData
// SMemSkipList
\ No newline at end of file
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
a06bf6e5
此差异已折叠。
点击以展开。
source/libs/executor/CMakeLists.txt
浏览文件 @
a06bf6e5
...
@@ -17,6 +17,6 @@ target_include_directories(
...
@@ -17,6 +17,6 @@ target_include_directories(
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
)
#
if(${BUILD_TEST})
if
(
${
BUILD_TEST
}
)
ADD_SUBDIRECTORY
(
test
)
ADD_SUBDIRECTORY
(
test
)
#
endif(${BUILD_TEST})
endif
(
${
BUILD_TEST
}
)
source/libs/monitor/src/monMsg.c
浏览文件 @
a06bf6e5
此差异已折叠。
点击以展开。
source/libs/parser/src/parInsertData.c
浏览文件 @
a06bf6e5
...
@@ -156,7 +156,7 @@ static int32_t createDataBlock(size_t defaultSize, int32_t rowSize, int32_t star
...
@@ -156,7 +156,7 @@ static int32_t createDataBlock(size_t defaultSize, int32_t rowSize, int32_t star
}
}
int32_t
buildCreateTbMsg
(
STableDataBlocks
*
pBlocks
,
SVCreateTbReq
*
pCreateTbReq
)
{
int32_t
buildCreateTbMsg
(
STableDataBlocks
*
pBlocks
,
SVCreateTbReq
*
pCreateTbReq
)
{
S
C
oder
coder
=
{
0
};
S
Enc
oder
coder
=
{
0
};
char
*
pBuf
;
char
*
pBuf
;
int32_t
len
;
int32_t
len
;
...
@@ -176,9 +176,9 @@ int32_t buildCreateTbMsg(STableDataBlocks* pBlocks, SVCreateTbReq* pCreateTbReq)
...
@@ -176,9 +176,9 @@ int32_t buildCreateTbMsg(STableDataBlocks* pBlocks, SVCreateTbReq* pCreateTbReq)
pBuf
=
pBlocks
->
pData
+
pBlocks
->
size
;
pBuf
=
pBlocks
->
pData
+
pBlocks
->
size
;
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pBuf
,
len
,
TD_ENCODER
);
t
EncoderInit
(
&
coder
,
pBuf
,
len
);
tEncodeSVCreateTbReq
(
&
coder
,
pCreateTbReq
);
tEncodeSVCreateTbReq
(
&
coder
,
pCreateTbReq
);
t
C
oderClear
(
&
coder
);
t
Enc
oderClear
(
&
coder
);
pBlocks
->
size
+=
len
;
pBlocks
->
size
+=
len
;
pBlocks
->
createTbReqLen
=
len
;
pBlocks
->
createTbReqLen
=
len
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
a06bf6e5
...
@@ -3558,7 +3558,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
...
@@ -3558,7 +3558,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
static
int32_t
serializeVgroupCreateTableBatch
(
SVgroupCreateTableBatch
*
pTbBatch
,
SArray
*
pBufArray
)
{
static
int32_t
serializeVgroupCreateTableBatch
(
SVgroupCreateTableBatch
*
pTbBatch
,
SArray
*
pBufArray
)
{
int
tlen
;
int
tlen
;
S
C
oder
coder
=
{
0
};
S
Enc
oder
coder
=
{
0
};
int32_t
ret
=
0
;
int32_t
ret
=
0
;
tEncodeSize
(
tEncodeSVCreateTbBatchReq
,
&
pTbBatch
->
req
,
tlen
,
ret
);
tEncodeSize
(
tEncodeSVCreateTbBatchReq
,
&
pTbBatch
->
req
,
tlen
,
ret
);
...
@@ -3571,9 +3571,9 @@ static int32_t serializeVgroupCreateTableBatch(SVgroupCreateTableBatch* pTbBatch
...
@@ -3571,9 +3571,9 @@ static int32_t serializeVgroupCreateTableBatch(SVgroupCreateTableBatch* pTbBatch
((
SMsgHead
*
)
buf
)
->
contLen
=
htonl
(
tlen
);
((
SMsgHead
*
)
buf
)
->
contLen
=
htonl
(
tlen
);
void
*
pBuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
void
*
pBuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pBuf
,
tlen
-
sizeof
(
SMsgHead
),
TD_ENCODER
);
t
EncoderInit
(
&
coder
,
pBuf
,
tlen
-
sizeof
(
SMsgHead
)
);
tEncodeSVCreateTbBatchReq
(
&
coder
,
&
pTbBatch
->
req
);
tEncodeSVCreateTbBatchReq
(
&
coder
,
&
pTbBatch
->
req
);
t
C
oderClear
(
&
coder
);
t
Enc
oderClear
(
&
coder
);
SVgDataBlocks
*
pVgData
=
taosMemoryCalloc
(
1
,
sizeof
(
SVgDataBlocks
));
SVgDataBlocks
*
pVgData
=
taosMemoryCalloc
(
1
,
sizeof
(
SVgDataBlocks
));
if
(
NULL
==
pVgData
)
{
if
(
NULL
==
pVgData
)
{
...
@@ -3958,7 +3958,7 @@ static void destroyDropTbReqBatch(SVgroupDropTableBatch* pTbBatch) { taosArrayDe
...
@@ -3958,7 +3958,7 @@ static void destroyDropTbReqBatch(SVgroupDropTableBatch* pTbBatch) { taosArrayDe
static
int32_t
serializeVgroupDropTableBatch
(
SVgroupDropTableBatch
*
pTbBatch
,
SArray
*
pBufArray
)
{
static
int32_t
serializeVgroupDropTableBatch
(
SVgroupDropTableBatch
*
pTbBatch
,
SArray
*
pBufArray
)
{
int
tlen
;
int
tlen
;
S
C
oder
coder
=
{
0
};
S
Enc
oder
coder
=
{
0
};
int32_t
ret
=
0
;
int32_t
ret
=
0
;
tEncodeSize
(
tEncodeSVDropTbBatchReq
,
&
pTbBatch
->
req
,
tlen
,
ret
);
tEncodeSize
(
tEncodeSVDropTbBatchReq
,
&
pTbBatch
->
req
,
tlen
,
ret
);
...
@@ -3971,9 +3971,9 @@ static int32_t serializeVgroupDropTableBatch(SVgroupDropTableBatch* pTbBatch, SA
...
@@ -3971,9 +3971,9 @@ static int32_t serializeVgroupDropTableBatch(SVgroupDropTableBatch* pTbBatch, SA
((
SMsgHead
*
)
buf
)
->
contLen
=
htonl
(
tlen
);
((
SMsgHead
*
)
buf
)
->
contLen
=
htonl
(
tlen
);
void
*
pBuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
void
*
pBuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
pBuf
,
tlen
-
sizeof
(
SMsgHead
),
TD_ENCODER
);
t
EncoderInit
(
&
coder
,
pBuf
,
tlen
-
sizeof
(
SMsgHead
)
);
tEncodeSVDropTbBatchReq
(
&
coder
,
&
pTbBatch
->
req
);
tEncodeSVDropTbBatchReq
(
&
coder
,
&
pTbBatch
->
req
);
t
C
oderClear
(
&
coder
);
t
Enc
oderClear
(
&
coder
);
SVgDataBlocks
*
pVgData
=
taosMemoryCalloc
(
1
,
sizeof
(
SVgDataBlocks
));
SVgDataBlocks
*
pVgData
=
taosMemoryCalloc
(
1
,
sizeof
(
SVgDataBlocks
));
if
(
NULL
==
pVgData
)
{
if
(
NULL
==
pVgData
)
{
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
a06bf6e5
...
@@ -1085,21 +1085,21 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
...
@@ -1085,21 +1085,21 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
case
TDMT_VND_CREATE_TABLE_RSP
:
{
case
TDMT_VND_CREATE_TABLE_RSP
:
{
SVCreateTbBatchRsp
batchRsp
=
{
0
};
SVCreateTbBatchRsp
batchRsp
=
{
0
};
if
(
msg
)
{
if
(
msg
)
{
S
C
oder
coder
=
{
0
};
S
Dec
oder
coder
=
{
0
};
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
msg
,
msgSize
,
TD_DECODER
);
t
DecoderInit
(
&
coder
,
msg
,
msgSize
);
code
=
tDecodeSVCreateTbBatchRsp
(
&
coder
,
&
batchRsp
);
code
=
tDecodeSVCreateTbBatchRsp
(
&
coder
,
&
batchRsp
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
batchRsp
.
nRsps
>
0
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
batchRsp
.
nRsps
>
0
)
{
for
(
int32_t
i
=
0
;
i
<
batchRsp
.
nRsps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
batchRsp
.
nRsps
;
++
i
)
{
SVCreateTbRsp
*
rsp
=
batchRsp
.
pRsps
+
i
;
SVCreateTbRsp
*
rsp
=
batchRsp
.
pRsps
+
i
;
if
(
NEED_CLIENT_HANDLE_ERROR
(
rsp
->
code
))
{
if
(
NEED_CLIENT_HANDLE_ERROR
(
rsp
->
code
))
{
t
C
oderClear
(
&
coder
);
t
Dec
oderClear
(
&
coder
);
SCH_ERR_JRET
(
rsp
->
code
);
SCH_ERR_JRET
(
rsp
->
code
);
}
else
if
(
TSDB_CODE_SUCCESS
!=
rsp
->
code
)
{
}
else
if
(
TSDB_CODE_SUCCESS
!=
rsp
->
code
)
{
code
=
rsp
->
code
;
code
=
rsp
->
code
;
}
}
}
}
}
}
t
C
oderClear
(
&
coder
);
t
Dec
oderClear
(
&
coder
);
SCH_ERR_JRET
(
code
);
SCH_ERR_JRET
(
code
);
}
}
...
@@ -1110,21 +1110,21 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
...
@@ -1110,21 +1110,21 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
case
TDMT_VND_DROP_TABLE_RSP
:
{
case
TDMT_VND_DROP_TABLE_RSP
:
{
SVDropTbBatchRsp
batchRsp
=
{
0
};
SVDropTbBatchRsp
batchRsp
=
{
0
};
if
(
msg
)
{
if
(
msg
)
{
S
C
oder
coder
=
{
0
};
S
Dec
oder
coder
=
{
0
};
t
CoderInit
(
&
coder
,
TD_LITTLE_ENDIAN
,
msg
,
msgSize
,
TD_DECODER
);
t
DecoderInit
(
&
coder
,
msg
,
msgSize
);
code
=
tDecodeSVDropTbBatchRsp
(
&
coder
,
&
batchRsp
);
code
=
tDecodeSVDropTbBatchRsp
(
&
coder
,
&
batchRsp
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
batchRsp
.
nRsps
>
0
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
batchRsp
.
nRsps
>
0
)
{
for
(
int32_t
i
=
0
;
i
<
batchRsp
.
nRsps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
batchRsp
.
nRsps
;
++
i
)
{
SVDropTbRsp
*
rsp
=
batchRsp
.
pRsps
+
i
;
SVDropTbRsp
*
rsp
=
batchRsp
.
pRsps
+
i
;
if
(
NEED_CLIENT_HANDLE_ERROR
(
rsp
->
code
))
{
if
(
NEED_CLIENT_HANDLE_ERROR
(
rsp
->
code
))
{
t
C
oderClear
(
&
coder
);
t
Dec
oderClear
(
&
coder
);
SCH_ERR_JRET
(
rsp
->
code
);
SCH_ERR_JRET
(
rsp
->
code
);
}
else
if
(
TSDB_CODE_SUCCESS
!=
rsp
->
code
)
{
}
else
if
(
TSDB_CODE_SUCCESS
!=
rsp
->
code
)
{
code
=
rsp
->
code
;
code
=
rsp
->
code
;
}
}
}
}
}
}
t
C
oderClear
(
&
coder
);
t
Dec
oderClear
(
&
coder
);
SCH_ERR_JRET
(
code
);
SCH_ERR_JRET
(
code
);
}
}
...
...
source/libs/stream/src/tstream.c
浏览文件 @
a06bf6e5
...
@@ -256,7 +256,7 @@ SStreamTask* tNewSStreamTask(int64_t streamId) {
...
@@ -256,7 +256,7 @@ SStreamTask* tNewSStreamTask(int64_t streamId) {
return
pTask
;
return
pTask
;
}
}
int32_t
tEncodeSStreamTask
(
S
C
oder
*
pEncoder
,
const
SStreamTask
*
pTask
)
{
int32_t
tEncodeSStreamTask
(
S
Enc
oder
*
pEncoder
,
const
SStreamTask
*
pTask
)
{
/*if (tStartEncode(pEncoder) < 0) return -1;*/
/*if (tStartEncode(pEncoder) < 0) return -1;*/
if
(
tEncodeI64
(
pEncoder
,
pTask
->
streamId
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
streamId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pTask
->
taskId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pTask
->
taskId
)
<
0
)
return
-
1
;
...
@@ -301,7 +301,7 @@ int32_t tEncodeSStreamTask(SCoder* pEncoder, const SStreamTask* pTask) {
...
@@ -301,7 +301,7 @@ int32_t tEncodeSStreamTask(SCoder* pEncoder, const SStreamTask* pTask) {
return
pEncoder
->
pos
;
return
pEncoder
->
pos
;
}
}
int32_t
tDecodeSStreamTask
(
S
C
oder
*
pDecoder
,
SStreamTask
*
pTask
)
{
int32_t
tDecodeSStreamTask
(
S
Dec
oder
*
pDecoder
,
SStreamTask
*
pTask
)
{
/*if (tStartDecode(pDecoder) < 0) return -1;*/
/*if (tStartDecode(pDecoder) < 0) return -1;*/
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
streamId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
streamId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pTask
->
taskId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pTask
->
taskId
)
<
0
)
return
-
1
;
...
...
source/libs/sync/src/syncMessage.c
浏览文件 @
a06bf6e5
此差异已折叠。
点击以展开。
source/util/src/tencode.c
浏览文件 @
a06bf6e5
此差异已折叠。
点击以展开。
source/util/test/CMakeLists.txt
浏览文件 @
a06bf6e5
...
@@ -41,9 +41,9 @@ target_sources(freelistTest
...
@@ -41,9 +41,9 @@ target_sources(freelistTest
)
)
target_link_libraries
(
freelistTest os util gtest gtest_main
)
target_link_libraries
(
freelistTest os util gtest gtest_main
)
# encodeTest
#
#
encodeTest
add_executable
(
encodeTest
"encodeTest.cpp"
)
#
add_executable(encodeTest "encodeTest.cpp")
target_link_libraries
(
encodeTest os util gtest gtest_main
)
#
target_link_libraries(encodeTest os util gtest gtest_main)
# queueTest
# queueTest
add_executable
(
procTest
"procTest.cpp"
)
add_executable
(
procTest
"procTest.cpp"
)
...
...
source/util/test/encodeTest.cpp
浏览文件 @
a06bf6e5
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录