Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
63d9b856
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,发现更多精彩内容 >>
提交
63d9b856
编写于
10月 13, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code format
上级
d5255f1e
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
115 addition
and
108 deletion
+115
-108
source/libs/index/test/index_executor_tests.cpp
source/libs/index/test/index_executor_tests.cpp
+7
-7
source/libs/monitor/src/monMain.c
source/libs/monitor/src/monMain.c
+1
-1
source/libs/parser/inc/parInsertData.h
source/libs/parser/inc/parInsertData.h
+1
-1
source/libs/stream/src/streamUpdate.c
source/libs/stream/src/streamUpdate.c
+7
-6
source/libs/stream/test/tstreamUpdateTest.cpp
source/libs/stream/test/tstreamUpdateTest.cpp
+57
-58
source/libs/transport/test/transUT.cpp
source/libs/transport/test/transUT.cpp
+4
-4
source/libs/transport/test/uv.c
source/libs/transport/test/uv.c
+5
-5
tools/scripts/codeFormat.sh
tools/scripts/codeFormat.sh
+33
-26
未找到文件。
source/libs/index/test/index_executor_tests.cpp
浏览文件 @
63d9b856
...
...
@@ -48,7 +48,7 @@ double sifLeftVd = 21.0, sifRightVd = 10.0;
void
sifFreeDataBlock
(
void
*
block
)
{
blockDataDestroy
(
*
(
SSDataBlock
**
)
block
);
}
void
sifInitLogFile
()
{
const
char
*
defaultLogFileNamePrefix
=
"taoslog"
;
const
char
*
defaultLogFileNamePrefix
=
"taoslog"
;
const
int32_t
maxLogFileNum
=
10
;
tsAsyncLog
=
0
;
...
...
@@ -96,7 +96,7 @@ void sifAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t *sl
}
void
sifMakeValueNode
(
SNode
**
pNode
,
int32_t
dataType
,
void
*
value
)
{
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
SValueNode
*
vnode
=
(
SValueNode
*
)
node
;
vnode
->
node
.
resType
.
type
=
dataType
;
...
...
@@ -113,7 +113,7 @@ void sifMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
}
void
sifMakeColumnNode
(
SNode
**
pNode
,
const
char
*
db
,
const
char
*
colName
,
EColumnType
colType
,
uint8_t
colValType
)
{
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_COLUMN
);
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_COLUMN
);
SColumnNode
*
rnode
=
(
SColumnNode
*
)
node
;
memcpy
(
rnode
->
dbName
,
db
,
strlen
(
db
));
memcpy
(
rnode
->
colName
,
colName
,
strlen
(
colName
));
...
...
@@ -125,7 +125,7 @@ void sifMakeColumnNode(SNode **pNode, const char *db, const char *colName, EColu
}
void
sifMakeOpNode
(
SNode
**
pNode
,
EOperatorType
opType
,
int32_t
resType
,
SNode
*
pLeft
,
SNode
*
pRight
)
{
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_OPERATOR
);
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_OPERATOR
);
SOperatorNode
*
onode
=
(
SOperatorNode
*
)
node
;
onode
->
node
.
resType
.
type
=
resType
;
onode
->
node
.
resType
.
bytes
=
tDataTypes
[
resType
].
bytes
;
...
...
@@ -138,7 +138,7 @@ void sifMakeOpNode(SNode **pNode, EOperatorType opType, int32_t resType, SNode *
}
void
sifMakeListNode
(
SNode
**
pNode
,
SNodeList
*
list
,
int32_t
resType
)
{
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_NODE_LIST
);
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_NODE_LIST
);
SNodeListNode
*
lnode
=
(
SNodeListNode
*
)
node
;
lnode
->
dataType
.
type
=
resType
;
lnode
->
pNodeList
=
list
;
...
...
@@ -147,7 +147,7 @@ void sifMakeListNode(SNode **pNode, SNodeList *list, int32_t resType) {
}
void
sifMakeLogicNode
(
SNode
**
pNode
,
ELogicConditionType
opType
,
SNode
**
nodeList
,
int32_t
nodeNum
)
{
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_LOGIC_CONDITION
);
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_LOGIC_CONDITION
);
SLogicConditionNode
*
onode
=
(
SLogicConditionNode
*
)
node
;
onode
->
condType
=
opType
;
onode
->
node
.
resType
.
type
=
TSDB_DATA_TYPE_BOOL
;
...
...
@@ -162,7 +162,7 @@ void sifMakeLogicNode(SNode **pNode, ELogicConditionType opType, SNode **nodeLis
}
void
sifMakeTargetNode
(
SNode
**
pNode
,
int16_t
dataBlockId
,
int16_t
slotId
,
SNode
*
snode
)
{
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_TARGET
);
SNode
*
node
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_TARGET
);
STargetNode
*
onode
=
(
STargetNode
*
)
node
;
onode
->
pExpr
=
snode
;
onode
->
dataBlockId
=
dataBlockId
;
...
...
source/libs/monitor/src/monMain.c
浏览文件 @
63d9b856
source/libs/parser/inc/parInsertData.h
浏览文件 @
63d9b856
...
...
@@ -18,9 +18,9 @@
#include "catalog.h"
#include "os.h"
#include "query.h"
#include "tname.h"
#include "ttypes.h"
#include "query.h"
#define IS_DATA_COL_ORDERED(spd) ((spd->orderStatus) == (int8_t)ORDER_STATUS_ORDERED)
...
...
source/libs/stream/src/streamUpdate.c
浏览文件 @
63d9b856
...
...
@@ -174,13 +174,14 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) {
if
(
res
==
TSDB_CODE_SUCCESS
)
{
return
false
;
}
else
{
qDebug
(
"===stream===Update close window sbf. tableId:%"
PRIu64
", maxTs:%"
PRIu64
", mapMaxTs:%"
PRIu64
", ts:%"
PRIu64
,
tableId
,
maxTs
,
*
pMapMaxTs
,
ts
);
qDebug
(
"===stream===Update close window sbf. tableId:%"
PRIu64
", maxTs:%"
PRIu64
", mapMaxTs:%"
PRIu64
", ts:%"
PRIu64
,
tableId
,
maxTs
,
*
pMapMaxTs
,
ts
);
return
true
;
}
}
qDebug
(
"===stream===Update close window. tableId:%"
PRIu64
", maxTs:%"
PRIu64
", mapMaxTs:%"
PRIu64
", ts:%"
PRIu64
,
tableId
,
maxTs
,
*
pMapMaxTs
,
ts
);
qDebug
(
"===stream===Update close window. tableId:%"
PRIu64
", maxTs:%"
PRIu64
", mapMaxTs:%"
PRIu64
", ts:%"
PRIu64
,
tableId
,
maxTs
,
*
pMapMaxTs
,
ts
);
return
true
;
}
...
...
@@ -202,8 +203,8 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) {
}
if
(
ts
<
pInfo
->
minTS
)
{
qDebug
(
"===stream===Update min ts. tableId:%"
PRIu64
", maxTs:%"
PRIu64
", mapMaxTs:%"
PRIu64
", ts:%"
PRIu64
,
tableId
,
maxTs
,
*
pMapMaxTs
,
ts
);
qDebug
(
"===stream===Update min ts. tableId:%"
PRIu64
", maxTs:%"
PRIu64
", mapMaxTs:%"
PRIu64
", ts:%"
PRIu64
,
tableId
,
maxTs
,
*
pMapMaxTs
,
ts
);
return
true
;
}
else
if
(
res
==
TSDB_CODE_SUCCESS
)
{
return
false
;
...
...
source/libs/stream/test/tstreamUpdateTest.cpp
浏览文件 @
63d9b856
...
...
@@ -6,15 +6,15 @@
using
namespace
std
;
#define MAX_NUM_SCALABLE_BF 100000
bool
equalSBF
(
SScalableBf
*
left
,
SScalableBf
*
right
)
{
bool
equalSBF
(
SScalableBf
*
left
,
SScalableBf
*
right
)
{
if
(
left
->
growth
!=
right
->
growth
)
return
false
;
if
(
left
->
numBits
!=
right
->
numBits
)
return
false
;
int
lsize
=
taosArrayGetSize
(
left
->
bfArray
);
int
rsize
=
taosArrayGetSize
(
right
->
bfArray
);
if
(
lsize
!=
rsize
)
return
false
;
for
(
int32_t
i
=
0
;
i
<
lsize
;
i
++
)
{
SBloomFilter
*
pLeftBF
=
(
SBloomFilter
*
)
taosArrayGetP
(
left
->
bfArray
,
i
);
SBloomFilter
*
pRightBF
=
(
SBloomFilter
*
)
taosArrayGetP
(
right
->
bfArray
,
i
);
SBloomFilter
*
pLeftBF
=
(
SBloomFilter
*
)
taosArrayGetP
(
left
->
bfArray
,
i
);
SBloomFilter
*
pRightBF
=
(
SBloomFilter
*
)
taosArrayGetP
(
right
->
bfArray
,
i
);
if
(
pLeftBF
->
errorRate
!=
pRightBF
->
errorRate
)
return
false
;
if
(
pLeftBF
->
expectedEntries
!=
pRightBF
->
expectedEntries
)
return
false
;
if
(
pLeftBF
->
hashFn1
!=
pRightBF
->
hashFn1
)
return
false
;
...
...
@@ -23,8 +23,8 @@ bool equalSBF(SScalableBf* left, SScalableBf* right) {
if
(
pLeftBF
->
numBits
!=
pRightBF
->
numBits
)
return
false
;
if
(
pLeftBF
->
numUnits
!=
pRightBF
->
numUnits
)
return
false
;
if
(
pLeftBF
->
size
!=
pRightBF
->
size
)
return
false
;
uint64_t
*
leftUint
=
(
uint64_t
*
)
pLeftBF
->
buffer
;
uint64_t
*
rightUint
=
(
uint64_t
*
)
pRightBF
->
buffer
;
uint64_t
*
leftUint
=
(
uint64_t
*
)
pLeftBF
->
buffer
;
uint64_t
*
rightUint
=
(
uint64_t
*
)
pRightBF
->
buffer
;
for
(
int32_t
j
=
0
;
j
<
pLeftBF
->
numUnits
;
j
++
)
{
if
(
leftUint
[
j
]
!=
rightUint
[
j
])
return
false
;
}
...
...
@@ -36,84 +36,84 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
const
int64_t
interval
=
20
*
1000
;
const
int64_t
watermark
=
10
*
60
*
1000
;
SUpdateInfo
*
pSU
=
updateInfoInit
(
interval
,
TSDB_TIME_PRECISION_MILLI
,
watermark
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
1
,
0
),
false
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
1
,
-
1
),
true
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
1
,
0
),
false
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
1
,
-
1
),
true
);
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
1
),
false
);
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
1
),
false
);
}
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
1
),
true
);
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
1
),
true
);
}
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
2
),
false
);
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
2
),
false
);
}
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
2
),
true
);
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
2
),
true
);
}
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
1
),
true
);
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
i
,
1
),
true
);
}
TSKEY
uid
=
0
;
for
(
int
i
=
3
;
i
<
1024
;
i
++
)
{
for
(
int
i
=
3
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
uid
,
i
),
false
);
}
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU
->
pMap
,
&
uid
,
sizeof
(
uint64_t
)),
1023
);
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU
->
pMap
,
&
uid
,
sizeof
(
uint64_t
)),
1023
);
for
(
int
i
=
3
;
i
<
1024
;
i
++
)
{
for
(
int
i
=
3
;
i
<
1024
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU
,
uid
,
i
),
true
);
}
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU
->
pMap
,
&
uid
,
sizeof
(
uint64_t
)),
1023
);
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU
->
pMap
,
&
uid
,
sizeof
(
uint64_t
)),
1023
);
SUpdateInfo
*
pSU1
=
updateInfoInit
(
interval
,
TSDB_TIME_PRECISION_MILLI
,
watermark
);
for
(
int
i
=
1
;
i
<=
watermark
/
interval
;
i
++
)
{
for
(
int
i
=
1
;
i
<=
watermark
/
interval
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU1
,
1
,
i
*
interval
+
5
),
false
);
GTEST_ASSERT_EQ
(
pSU1
->
minTS
,
interval
);
GTEST_ASSERT_EQ
(
pSU1
->
numSBFs
,
watermark
/
interval
);
}
for
(
int
i
=
0
;
i
<
pSU1
->
numSBFs
;
i
++
)
{
for
(
int
i
=
0
;
i
<
pSU1
->
numSBFs
;
i
++
)
{
SScalableBf
*
pSBF
=
(
SScalableBf
*
)
taosArrayGetP
(
pSU1
->
pTsSBFs
,
i
);
SBloomFilter
*
pBF
=
(
SBloomFilter
*
)
taosArrayGetP
(
pSBF
->
bfArray
,
0
);
GTEST_ASSERT_EQ
(
pBF
->
size
,
1
);
}
for
(
int
i
=
watermark
/
interval
+
1
,
j
=
2
;
i
<=
watermark
/
interval
+
10
;
i
++
,
j
++
)
{
for
(
int
i
=
watermark
/
interval
+
1
,
j
=
2
;
i
<=
watermark
/
interval
+
10
;
i
++
,
j
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU1
,
1
,
i
*
interval
+
5
),
false
);
GTEST_ASSERT_EQ
(
pSU1
->
minTS
,
interval
*
j
);
GTEST_ASSERT_EQ
(
pSU1
->
minTS
,
interval
*
j
);
GTEST_ASSERT_EQ
(
pSU1
->
numSBFs
,
watermark
/
interval
);
SScalableBf
*
pSBF
=
(
SScalableBf
*
)
taosArrayGetP
(
pSU1
->
pTsSBFs
,
pSU1
->
numSBFs
-
1
);
SBloomFilter
*
pBF
=
(
SBloomFilter
*
)
taosArrayGetP
(
pSBF
->
bfArray
,
0
);
GTEST_ASSERT_EQ
(
pBF
->
size
,
1
);
}
for
(
int
i
=
watermark
/
interval
*
100
,
j
=
0
;
j
<
10
;
i
+=
(
watermark
/
interval
*
2
),
j
++
)
{
for
(
int
i
=
watermark
/
interval
*
100
,
j
=
0
;
j
<
10
;
i
+=
(
watermark
/
interval
*
2
),
j
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU1
,
1
,
i
*
interval
+
5
),
false
);
GTEST_ASSERT_EQ
(
pSU1
->
minTS
,
(
i
-
(
pSU1
->
numSBFs
-
1
))
*
interval
);
GTEST_ASSERT_EQ
(
pSU1
->
minTS
,
(
i
-
(
pSU1
->
numSBFs
-
1
))
*
interval
);
GTEST_ASSERT_EQ
(
pSU1
->
numSBFs
,
watermark
/
interval
);
}
SUpdateInfo
*
pSU2
=
updateInfoInit
(
interval
,
TSDB_TIME_PRECISION_MILLI
,
watermark
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU2
,
1
,
1
*
interval
+
5
),
false
);
GTEST_ASSERT_EQ
(
pSU2
->
minTS
,
interval
);
for
(
int
i
=
watermark
/
interval
*
100
,
j
=
0
;
j
<
10
;
i
+=
(
watermark
/
interval
*
10
),
j
++
)
{
for
(
int
i
=
watermark
/
interval
*
100
,
j
=
0
;
j
<
10
;
i
+=
(
watermark
/
interval
*
10
),
j
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU2
,
1
,
i
*
interval
+
5
),
false
);
GTEST_ASSERT_EQ
(
pSU2
->
minTS
,
(
i
-
(
pSU2
->
numSBFs
-
1
))
*
interval
);
GTEST_ASSERT_EQ
(
pSU2
->
minTS
,
(
i
-
(
pSU2
->
numSBFs
-
1
))
*
interval
);
GTEST_ASSERT_EQ
(
pSU2
->
numSBFs
,
watermark
/
interval
);
TSKEY
uid2
=
1
;
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU2
->
pMap
,
&
uid2
,
sizeof
(
uint64_t
)),
i
*
interval
+
5
);
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU2
->
pMap
,
&
uid2
,
sizeof
(
uint64_t
)),
i
*
interval
+
5
);
}
SUpdateInfo
*
pSU3
=
updateInfoInit
(
interval
,
TSDB_TIME_PRECISION_MILLI
,
watermark
);
for
(
int
j
=
1
;
j
<
100
;
j
++
)
{
for
(
int
i
=
0
;
i
<
pSU3
->
numSBFs
;
i
++
)
{
for
(
int
j
=
1
;
j
<
100
;
j
++
)
{
for
(
int
i
=
0
;
i
<
pSU3
->
numSBFs
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU3
,
i
,
i
*
interval
+
5
*
j
),
false
);
GTEST_ASSERT_EQ
(
pSU3
->
minTS
,
0
);
GTEST_ASSERT_EQ
(
pSU3
->
numSBFs
,
watermark
/
interval
);
uint64_t
uid3
=
i
;
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU3
->
pMap
,
&
uid3
,
sizeof
(
uint64_t
)),
i
*
interval
+
5
*
j
);
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
taosHashGet
(
pSU3
->
pMap
,
&
uid3
,
sizeof
(
uint64_t
)),
i
*
interval
+
5
*
j
);
SScalableBf
*
pSBF
=
(
SScalableBf
*
)
taosArrayGetP
(
pSU3
->
pTsSBFs
,
i
);
SBloomFilter
*
pBF
=
(
SBloomFilter
*
)
taosArrayGetP
(
pSBF
->
bfArray
,
0
);
GTEST_ASSERT_EQ
(
pBF
->
size
,
j
);
...
...
@@ -130,15 +130,15 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
SUpdateInfo
*
pSU7
=
updateInfoInit
(
interval
,
TSDB_TIME_PRECISION_MILLI
,
watermark
);
updateInfoAddCloseWindowSBF
(
pSU7
);
for
(
int64_t
i
=
1
;
i
<
2048000
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
i
,
i
),
false
);
for
(
int64_t
i
=
1
;
i
<
2048000
;
i
++
)
{
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
i
,
i
),
false
);
}
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
100
,
1
),
true
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
110
,
10
),
true
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
200
,
20
),
true
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
100
,
1
),
true
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
110
,
10
),
true
);
GTEST_ASSERT_EQ
(
updateInfoIsUpdated
(
pSU7
,
200
,
20
),
true
);
int32_t
bufLen
=
updateInfoSerialize
(
NULL
,
0
,
pSU7
);
void
*
buf
=
taosMemoryCalloc
(
1
,
bufLen
);
void
*
buf
=
taosMemoryCalloc
(
1
,
bufLen
);
int32_t
resSize
=
updateInfoSerialize
(
buf
,
bufLen
,
pSU7
);
SUpdateInfo
*
pSU6
=
updateInfoInit
(
0
,
TSDB_TIME_PRECISION_MILLI
,
0
);
...
...
@@ -158,27 +158,27 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
int32_t
mapSize
=
taosHashGetSize
(
pSU7
->
pMap
);
GTEST_ASSERT_EQ
(
mapSize
,
taosHashGetSize
(
pSU6
->
pMap
));
void
*
pIte
=
NULL
;
void
*
pIte
=
NULL
;
size_t
keyLen
=
0
;
while
((
pIte
=
taosHashIterate
(
pSU7
->
pMap
,
pIte
))
!=
NULL
)
{
void
*
key
=
taosHashGetKey
(
pIte
,
&
keyLen
);
void
*
value6
=
taosHashGet
(
pSU6
->
pMap
,
key
,
keyLen
);
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
pIte
,
*
(
TSKEY
*
)
value6
);
void
*
key
=
taosHashGetKey
(
pIte
,
&
keyLen
);
void
*
value6
=
taosHashGet
(
pSU6
->
pMap
,
key
,
keyLen
);
GTEST_ASSERT_EQ
(
*
(
TSKEY
*
)
pIte
,
*
(
TSKEY
*
)
value6
);
}
int32_t
buSize
=
taosArrayGetSize
(
pSU7
->
pTsBuckets
);
GTEST_ASSERT_EQ
(
buSize
,
taosArrayGetSize
(
pSU6
->
pTsBuckets
));
for
(
int32_t
i
=
0
;
i
<
buSize
;
i
++
)
{
TSKEY
ts1
=
*
(
TSKEY
*
)
taosArrayGet
(
pSU7
->
pTsBuckets
,
i
);
TSKEY
ts2
=
*
(
TSKEY
*
)
taosArrayGet
(
pSU6
->
pTsBuckets
,
i
);
TSKEY
ts1
=
*
(
TSKEY
*
)
taosArrayGet
(
pSU7
->
pTsBuckets
,
i
);
TSKEY
ts2
=
*
(
TSKEY
*
)
taosArrayGet
(
pSU6
->
pTsBuckets
,
i
);
GTEST_ASSERT_EQ
(
ts1
,
ts2
);
}
int32_t
lSize
=
taosArrayGetSize
(
pSU7
->
pTsSBFs
);
int32_t
rSize
=
taosArrayGetSize
(
pSU6
->
pTsSBFs
);
GTEST_ASSERT_EQ
(
lSize
,
rSize
);
for
(
int32_t
i
=
0
;
i
<
lSize
;
i
++
)
{
SScalableBf
*
pLeftSBF
=
(
SScalableBf
*
)
taosArrayGetP
(
pSU7
->
pTsSBFs
,
i
);
SScalableBf
*
pRightSBF
=
(
SScalableBf
*
)
taosArrayGetP
(
pSU6
->
pTsSBFs
,
i
);
SScalableBf
*
pLeftSBF
=
(
SScalableBf
*
)
taosArrayGetP
(
pSU7
->
pTsSBFs
,
i
);
SScalableBf
*
pRightSBF
=
(
SScalableBf
*
)
taosArrayGetP
(
pSU6
->
pTsSBFs
,
i
);
GTEST_ASSERT_EQ
(
equalSBF
(
pLeftSBF
,
pRightSBF
),
true
);
}
...
...
@@ -190,10 +190,9 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
updateInfoDestroy
(
pSU5
);
updateInfoDestroy
(
pSU6
);
updateInfoDestroy
(
pSU7
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
\ No newline at end of file
source/libs/transport/test/transUT.cpp
浏览文件 @
63d9b856
...
...
@@ -99,7 +99,7 @@ class Client {
private:
tsem_t
sem
;
SRpcInit
rpcInit_
;
void
*
transCli
;
void
*
transCli
;
SRpcMsg
resp
;
};
class
Server
{
...
...
@@ -146,7 +146,7 @@ class Server {
private:
SRpcInit
rpcInit_
;
void
*
transSrv
;
void
*
transSrv
;
};
static
void
processReq
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SRpcMsg
rpcMsg
=
{
0
};
...
...
@@ -330,7 +330,7 @@ TEST_F(TransEnv, clientUserDefined) {
TEST_F
(
TransEnv
,
cliPersistHandle
)
{
SRpcMsg
resp
=
{
0
};
void
*
handle
=
NULL
;
void
*
handle
=
NULL
;
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
SRpcMsg
req
=
{
0
};
req
.
info
=
resp
.
info
;
...
...
@@ -366,7 +366,7 @@ TEST_F(TransEnv, srvReleaseHandle) {
SRpcMsg
resp
=
{
0
};
tr
->
SetSrvContinueSend
(
processReleaseHandleCb
);
// tr->Restart(processReleaseHandleCb);
void
*
handle
=
NULL
;
void
*
handle
=
NULL
;
SRpcMsg
req
=
{
0
};
for
(
int
i
=
0
;
i
<
1
;
i
++
)
{
memset
(
&
req
,
0
,
sizeof
(
req
));
...
...
source/libs/transport/test/uv.c
浏览文件 @
63d9b856
...
...
@@ -11,23 +11,23 @@
typedef
struct
SThreadObj
{
TdThread
thread
;
uv_pipe_t
*
pipe
;
uv_loop_t
*
loop
;
uv_pipe_t
*
pipe
;
uv_loop_t
*
loop
;
uv_async_t
*
workerAsync
;
//
int
fd
;
}
SThreadObj
;
typedef
struct
SServerObj
{
uv_tcp_t
server
;
uv_loop_t
*
loop
;
uv_loop_t
*
loop
;
int
workerIdx
;
int
numOfThread
;
SThreadObj
**
pThreadObj
;
uv_pipe_t
**
pipe
;
uv_pipe_t
**
pipe
;
}
SServerObj
;
typedef
struct
SConnCtx
{
uv_tcp_t
*
pClient
;
uv_tcp_t
*
pClient
;
uv_timer_t
*
pTimer
;
uv_async_t
*
pWorkerAsync
;
int
ref
;
...
...
tools/scripts/codeFormat.sh
浏览文件 @
63d9b856
...
...
@@ -8,35 +8,42 @@ ORIGIN_DIR=$(pwd)
cd
${
PRJ_ROOT_DIR
}
FORMAT_DIR_LIST
=(
"include"
"source/os"
"source/util"
"source/common"
"source/libs/cache"
"source/libs/catalog"
"source/libs/command"
"source/libs/executor"
# "source/libs/function"
# "source/libs/index"
# "source/libs/monitor"
# "source/libs/nodes"
# "source/libs/parser"
# "source/libs/planner"
# "source/libs/qcom"
# "source/libs/qworker"
# "source/libs/scalar"
# "source/libs/stream"
# "source/libs/sync"
"source/libs/tdb"
"source/libs/tfs"
# "source/libs/transport"
"source/libs/wal"
# "source/client"
"source/dnode"
"
${
PRJ_ROOT_DIR
}
/include"
"
${
PRJ_ROOT_DIR
}
/source/os"
"
${
PRJ_ROOT_DIR
}
/source/util"
"
${
PRJ_ROOT_DIR
}
/source/common"
"
${
PRJ_ROOT_DIR
}
/source/libs/cache"
"
${
PRJ_ROOT_DIR
}
/source/libs/catalog"
"
${
PRJ_ROOT_DIR
}
/source/libs/command"
"
${
PRJ_ROOT_DIR
}
/source/libs/executor"
# "${PRJ_ROOT_DIR}/source/libs/function"
"
${
PRJ_ROOT_DIR
}
/source/libs/index"
"
${
PRJ_ROOT_DIR
}
/source/libs/monitor"
"
${
PRJ_ROOT_DIR
}
/source/libs/nodes"
# "${PRJ_ROOT_DIR}/source/libs/parser"
"
${
PRJ_ROOT_DIR
}
/source/libs/planner"
# "${PRJ_ROOT_DIR}/source/libs/qcom"
# "${PRJ_ROOT_DIR}/source/libs/qworker"
# "${PRJ_ROOT_DIR}/source/libs/scalar"
"
${
PRJ_ROOT_DIR
}
/source/libs/stream"
# "${PRJ_ROOT_DIR}/source/libs/sync"
"
${
PRJ_ROOT_DIR
}
/source/libs/tdb"
"
${
PRJ_ROOT_DIR
}
/source/libs/tfs"
"
${
PRJ_ROOT_DIR
}
/source/libs/transport"
"
${
PRJ_ROOT_DIR
}
/source/libs/wal"
# "${PRJ_ROOT_DIR}/source/client"
"
${
PRJ_ROOT_DIR
}
/source/dnode"
)
EXCLUDE_DIR_LIST
=(
)
EXCLUDE_FILE_LIST
=(
"source/libs/parser/sql.c"
)
for
d
in
${
FORMAT_DIR_LIST
[@]
}
;
do
for
f
in
$(
find
$
{
PRJ_ROOT_DIR
}
/
$d
/
-regex
'.*\.\(cpp\|hpp\|c\|h\)'
)
;
do
for
f
in
$(
find
$
d
-regex
'.*\.\(cpp\|hpp\|c\|h\)'
)
;
do
${
FORMAT_BIN
}
-i
$f
done
done
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录