Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
bd2b9b2b
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bd2b9b2b
编写于
8月 04, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] add some logs.
上级
6f689629
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
37 addition
and
0 deletion
+37
-0
src/util/src/hash.c
src/util/src/hash.c
+37
-0
未找到文件。
src/util/src/hash.c
浏览文件 @
bd2b9b2b
...
...
@@ -284,6 +284,7 @@ void *taosHashGetCB(SHashObj *pHashObj, const void *key, size_t keyLen, void (*f
// no data, return directly
if
(
atomic_load_32
(
&
pe
->
num
)
==
0
)
{
__rd_unlock
(
&
pHashObj
->
lock
,
pHashObj
->
type
);
return
NULL
;
}
...
...
@@ -295,6 +296,12 @@ void *taosHashGetCB(SHashObj *pHashObj, const void *key, size_t keyLen, void (*f
taosRLockLatch
(
&
pe
->
latch
);
}
if
(
pe
->
num
>
0
)
{
assert
(
pe
->
next
!=
NULL
);
}
else
{
assert
(
pe
->
next
==
NULL
);
}
SHashNode
*
pNode
=
doSearchInEntryList
(
pe
,
key
,
keyLen
,
hashVal
);
if
(
pNode
!=
NULL
)
{
if
(
fp
!=
NULL
)
{
...
...
@@ -342,6 +349,8 @@ int32_t taosHashRemoveWithData(SHashObj *pHashObj, const void *key, size_t keyLe
// no data, return directly
if
(
pe
->
num
==
0
)
{
assert
(
pe
->
next
==
NULL
);
__rd_unlock
(
&
pHashObj
->
lock
,
pHashObj
->
type
);
return
-
1
;
}
...
...
@@ -374,6 +383,12 @@ int32_t taosHashRemoveWithData(SHashObj *pHashObj, const void *key, size_t keyLe
}
}
if
(
pe
->
num
==
0
)
{
assert
(
pe
->
next
==
NULL
);
}
else
{
assert
(
pe
->
next
!=
NULL
);
}
if
(
pHashObj
->
type
==
HASH_ENTRY_LOCK
)
{
taosWUnLockLatch
(
&
pe
->
latch
);
}
...
...
@@ -471,6 +486,8 @@ void taosHashCleanup(SHashObj *pHashObj) {
}
pNode
=
pEntry
->
next
;
assert
(
pNode
!=
NULL
);
while
(
pNode
)
{
pNext
=
pNode
->
next
;
FREE_HASH_NODE
(
pHashObj
,
pNode
);
...
...
@@ -655,6 +672,12 @@ void taosHashTableResize(SHashObj *pHashObj) {
pe
->
num
-=
1
;
pe
->
next
=
pNode
->
next
;
if
(
pe
->
num
==
0
)
{
assert
(
pe
->
next
==
NULL
);
}
else
{
assert
(
pe
->
next
!=
NULL
);
}
SHashEntry
*
pNewEntry
=
pHashObj
->
hashList
[
j
];
pushfrontNodeInEntryList
(
pNewEntry
,
pNode
);
}
else
{
...
...
@@ -671,11 +694,25 @@ void taosHashTableResize(SHashObj *pHashObj) {
// added into new slot
SHashEntry
*
pNewEntry
=
pHashObj
->
hashList
[
j
];
if
(
pNewEntry
->
num
==
0
)
{
assert
(
pNewEntry
->
next
==
NULL
);
}
else
{
assert
(
pNewEntry
->
next
!=
NULL
);
}
pushfrontNodeInEntryList
(
pNewEntry
,
pNext
);
}
else
{
pNode
=
pNext
;
}
}
if
(
pe
->
num
==
0
)
{
assert
(
pe
->
next
==
NULL
);
}
else
{
assert
(
pe
->
next
!=
NULL
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录