Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c2446494
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
c2446494
编写于
9月 29, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1530
上级
283d144d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
17 deletion
+16
-17
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-3
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-2
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+5
-5
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+6
-6
未找到文件。
src/client/src/tscServer.c
浏览文件 @
c2446494
...
...
@@ -234,9 +234,8 @@ int tscSendMsgToServer(SSqlObj *pSql) {
}
void
tscProcessMsgFromServer
(
SRpcMsg
*
rpcMsg
,
SRpcEpSet
*
pEpSet
)
{
uint64_t
handle
=
(
uint64_t
)
rpcMsg
->
ahandle
;
void
**
p
=
taosCacheAcquireByKey
(
tscObjCache
,
&
handle
,
sizeof
(
uint64_t
));
TSDB_CACHE_PTR_TYPE
handle
=
(
TSDB_CACHE_PTR_TYPE
)
rpcMsg
->
ahandle
;
void
**
p
=
taosCacheAcquireByKey
(
tscObjCache
,
&
handle
,
sizeof
(
TSDB_CACHE_PTR_TYPE
));
if
(
p
==
NULL
)
{
rpcFreeCont
(
rpcMsg
->
pCont
);
return
;
...
...
src/client/src/tscSystem.c
浏览文件 @
c2446494
...
...
@@ -141,7 +141,7 @@ void taos_init_imp(void) {
int64_t
refreshTime
=
10
;
// 10 seconds by default
if
(
tscMetaCache
==
NULL
)
{
tscMetaCache
=
taosCacheInit
(
TSDB_DATA_TYPE_BINARY
,
refreshTime
,
false
,
NULL
,
"tableMeta"
);
tscObjCache
=
taosCacheInit
(
TSDB_
DATA_TYPE_BIGINT
,
refreshTime
/
2
,
false
,
tscFreeSqlObjInCache
,
"sqlObj"
);
tscObjCache
=
taosCacheInit
(
TSDB_
CACHE_PTR_KEY
,
refreshTime
/
2
,
false
,
tscFreeSqlObjInCache
,
"sqlObj"
);
}
tscDebug
(
"client is initialized successfully"
);
...
...
src/client/src/tscUtil.c
浏览文件 @
c2446494
...
...
@@ -1788,8 +1788,8 @@ void registerSqlObj(SSqlObj* pSql) {
int32_t
ref
=
T_REF_INC
(
pSql
->
pTscObj
);
tscDebug
(
"%p add to tscObj:%p, ref:%d"
,
pSql
,
pSql
->
pTscObj
,
ref
);
uint64_t
p
=
(
uint64_t
)
pSql
;
pSql
->
self
=
taosCachePut
(
tscObjCache
,
&
p
,
sizeof
(
uint64_t
),
&
p
,
sizeof
(
uint64_t
),
DEFAULT_LIFE_TIME
);
TSDB_CACHE_PTR_TYPE
p
=
(
TSDB_CACHE_PTR_TYPE
)
pSql
;
pSql
->
self
=
taosCachePut
(
tscObjCache
,
&
p
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
&
p
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
DEFAULT_LIFE_TIME
);
}
SSqlObj
*
createSimpleSubObj
(
SSqlObj
*
pSql
,
void
(
*
fp
)(),
void
*
param
,
int32_t
cmd
)
{
...
...
src/mnode/src/mnodeShow.c
浏览文件 @
c2446494
...
...
@@ -65,7 +65,7 @@ int32_t mnodeInitShow() {
mnodeAddReadMsgHandle
(
TSDB_MSG_TYPE_CM_CONNECT
,
mnodeProcessConnectMsg
);
mnodeAddReadMsgHandle
(
TSDB_MSG_TYPE_CM_USE_DB
,
mnodeProcessUseMsg
);
tsMnodeShowCache
=
taosCacheInit
(
TSDB_
DATA_TYPE_BIGINT
,
5
,
true
,
mnodeFreeShowObj
,
"show"
);
tsMnodeShowCache
=
taosCacheInit
(
TSDB_
CACHE_PTR_KEY
,
5
,
true
,
mnodeFreeShowObj
,
"show"
);
return
0
;
}
...
...
@@ -378,8 +378,8 @@ static bool mnodeCheckShowFinished(SShowObj *pShow) {
}
static
bool
mnodeAccquireShowObj
(
SShowObj
*
pShow
)
{
uint64_t
handleVal
=
(
uint64_t
)
pShow
;
SShowObj
**
ppShow
=
taosCacheAcquireByKey
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
int64_t
));
TSDB_CACHE_PTR_TYPE
handleVal
=
(
TSDB_CACHE_PTR_TYPE
)
pShow
;
SShowObj
**
ppShow
=
taosCacheAcquireByKey
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
TSDB_CACHE_PTR_TYPE
));
if
(
ppShow
)
{
mDebug
(
"%p, show is accquired from cache, data:%p, index:%d"
,
pShow
,
ppShow
,
pShow
->
index
);
return
true
;
...
...
@@ -393,8 +393,8 @@ static void* mnodePutShowObj(SShowObj *pShow) {
if
(
tsMnodeShowCache
!=
NULL
)
{
pShow
->
index
=
atomic_add_fetch_32
(
&
tsShowObjIndex
,
1
);
uint64_t
handleVal
=
(
uint64_t
)
pShow
;
SShowObj
**
ppShow
=
taosCachePut
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
int64_t
),
&
pShow
,
sizeof
(
int64_t
),
DEFAULT_SHOWHANDLE_LIFE_SPAN
);
TSDB_CACHE_PTR_TYPE
handleVal
=
(
TSDB_CACHE_PTR_TYPE
)
pShow
;
SShowObj
**
ppShow
=
taosCachePut
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
&
pShow
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
DEFAULT_SHOWHANDLE_LIFE_SPAN
);
pShow
->
ppShow
=
(
void
**
)
ppShow
;
mDebug
(
"%p, show is put into cache, data:%p index:%d"
,
pShow
,
ppShow
,
pShow
->
index
);
return
pShow
;
...
...
src/query/src/qExecutor.c
浏览文件 @
c2446494
...
...
@@ -7032,7 +7032,7 @@ void* qOpenQueryMgmt(int32_t vgId) {
return
NULL
;
}
pQueryMgmt
->
qinfoPool
=
taosCacheInit
(
TSDB_
DATA_TYPE_BIGINT
,
REFRESH_HANDLE_INTERVAL
,
true
,
freeqinfoFn
,
cacheName
);
pQueryMgmt
->
qinfoPool
=
taosCacheInit
(
TSDB_
CACHE_PTR_KEY
,
REFRESH_HANDLE_INTERVAL
,
true
,
freeqinfoFn
,
cacheName
);
pQueryMgmt
->
closed
=
false
;
pQueryMgmt
->
vgId
=
vgId
;
...
...
@@ -7101,23 +7101,23 @@ void** qRegisterQInfo(void* pMgmt, uint64_t qInfo) {
qError
(
"QInfo:%p failed to add qhandle into cache, since qMgmt is colsing"
,
(
void
*
)
qInfo
);
return
NULL
;
}
else
{
uint64_t
handleVal
=
(
uint64_t
)
qInfo
;
void
**
handle
=
taosCachePut
(
pQueryMgmt
->
qinfoPool
,
&
handleVal
,
sizeof
(
int64_t
),
&
qInfo
,
POINTER_BYTES
,
DEFAULT_QHANDLE_LIFE_SPAN
);
TSDB_CACHE_PTR_TYPE
handleVal
=
(
TSDB_CACHE_PTR_TYPE
)
qInfo
;
void
**
handle
=
taosCachePut
(
pQueryMgmt
->
qinfoPool
,
&
handleVal
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
&
qInfo
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
DEFAULT_QHANDLE_LIFE_SPAN
);
// pthread_mutex_unlock(&pQueryMgmt->lock);
return
handle
;
}
}
void
**
qAcquireQInfo
(
void
*
pMgmt
,
uint64_t
key
)
{
void
**
qAcquireQInfo
(
void
*
pMgmt
,
uint64_t
_
key
)
{
SQueryMgmt
*
pQueryMgmt
=
pMgmt
;
if
(
pQueryMgmt
->
qinfoPool
==
NULL
||
pQueryMgmt
->
closed
)
{
return
NULL
;
}
void
**
handle
=
taosCacheAcquireByKey
(
pQueryMgmt
->
qinfoPool
,
&
key
,
sizeof
(
uint64_t
));
TSDB_CACHE_PTR_TYPE
key
=
(
TSDB_CACHE_PTR_TYPE
)
_key
;
void
**
handle
=
taosCacheAcquireByKey
(
pQueryMgmt
->
qinfoPool
,
&
key
,
sizeof
(
TSDB_CACHE_PTR_TYPE
));
if
(
handle
==
NULL
||
*
handle
==
NULL
)
{
return
NULL
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录