Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b28dde67
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看板
提交
b28dde67
编写于
8月 21, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1067] update the tablemeta life time
上级
084cbca7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
15 deletion
+5
-15
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-2
src/util/inc/tcache.h
src/util/inc/tcache.h
+1
-11
src/util/src/tcache.c
src/util/src/tcache.c
+2
-2
未找到文件。
src/client/src/tscServer.c
浏览文件 @
b28dde67
...
...
@@ -1702,7 +1702,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
assert
(
pTableMetaInfo
->
pTableMeta
==
NULL
);
pTableMetaInfo
->
pTableMeta
=
(
STableMeta
*
)
taosCachePut
(
tscCacheHandle
,
pTableMetaInfo
->
name
,
strlen
(
pTableMetaInfo
->
name
),
pTableMeta
,
size
,
tsTableMetaKeepTimer
);
strlen
(
pTableMetaInfo
->
name
),
pTableMeta
,
size
,
tsTableMetaKeepTimer
*
1000
);
// todo handle out of memory case
if
(
pTableMetaInfo
->
pTableMeta
==
NULL
)
{
...
...
@@ -1906,7 +1906,7 @@ int tscProcessShowRsp(SSqlObj *pSql) {
STableMeta
*
pTableMeta
=
tscCreateTableMetaFromMsg
(
pMetaMsg
,
&
size
);
pTableMetaInfo
->
pTableMeta
=
taosCachePut
(
tscCacheHandle
,
key
,
strlen
(
key
),
(
char
*
)
pTableMeta
,
size
,
tsTableMetaKeepTimer
);
tsTableMetaKeepTimer
*
1000
);
SSchema
*
pTableSchema
=
tscGetTableSchema
(
pTableMetaInfo
->
pTableMeta
);
if
(
pQueryInfo
->
colList
==
NULL
)
{
...
...
src/util/inc/tcache.h
浏览文件 @
b28dde67
...
...
@@ -103,7 +103,7 @@ SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInSeconds, bool ext
* @param keepTime survival time in second
* @return cached element
*/
void
*
taosCachePut
(
SCacheObj
*
pCacheObj
,
const
void
*
key
,
size_t
keyLen
,
const
void
*
pData
,
size_t
dataSize
,
int
keepTimeInSeconds
);
void
*
taosCachePut
(
SCacheObj
*
pCacheObj
,
const
void
*
key
,
size_t
keyLen
,
const
void
*
pData
,
size_t
dataSize
,
int
durationMS
);
/**
* get data from cache
...
...
@@ -113,16 +113,6 @@ void *taosCachePut(SCacheObj *pCacheObj, const void *key, size_t keyLen, const v
*/
void
*
taosCacheAcquireByKey
(
SCacheObj
*
pCacheObj
,
const
void
*
key
,
size_t
keyLen
);
/**
* update the expire time of data in cache
* @param pCacheObj cache object
* @param key key
* @param keyLen keyLen
* @param expireTime new expire time of data
* @return
*/
//void* taosCacheUpdateExpireTimeByName(SCacheObj *pCacheObj, void *key, size_t keyLen, uint64_t expireTime);
/**
* Add one reference count for the exist data, and assign this data for a new owner.
* The new owner needs to invoke the taosCacheRelease when it does not need this data anymore.
...
...
src/util/src/tcache.c
浏览文件 @
b28dde67
...
...
@@ -189,12 +189,12 @@ SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInSeconds, bool ext
return
pCacheObj
;
}
void
*
taosCachePut
(
SCacheObj
*
pCacheObj
,
const
void
*
key
,
size_t
keyLen
,
const
void
*
pData
,
size_t
dataSize
,
int
duration
)
{
void
*
taosCachePut
(
SCacheObj
*
pCacheObj
,
const
void
*
key
,
size_t
keyLen
,
const
void
*
pData
,
size_t
dataSize
,
int
duration
MS
)
{
if
(
pCacheObj
==
NULL
||
pCacheObj
->
pHashTable
==
NULL
||
pCacheObj
->
deleting
==
1
)
{
return
NULL
;
}
SCacheDataNode
*
pNode1
=
taosCreateCacheNode
(
key
,
keyLen
,
pData
,
dataSize
,
duration
);
SCacheDataNode
*
pNode1
=
taosCreateCacheNode
(
key
,
keyLen
,
pData
,
dataSize
,
duration
MS
);
if
(
pNode1
==
NULL
)
{
uError
(
"cache:%s, key:%p, failed to added into cache, out of memory"
,
pCacheObj
->
name
,
key
);
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录