Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
72c4f4ef
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
72c4f4ef
编写于
1月 06, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor code
上级
1facebba
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
7 addition
and
13 deletion
+7
-13
source/libs/index/inc/indexInt.h
source/libs/index/inc/indexInt.h
+1
-1
source/libs/index/inc/index_cache.h
source/libs/index/inc/index_cache.h
+2
-3
source/libs/index/src/index.c
source/libs/index/src/index.c
+1
-2
source/libs/index/src/index_cache.c
source/libs/index/src/index_cache.c
+3
-5
source/libs/index/src/index_fst_counting_writer.c
source/libs/index/src/index_fst_counting_writer.c
+0
-2
未找到文件。
source/libs/index/inc/indexInt.h
浏览文件 @
72c4f4ef
...
...
@@ -115,7 +115,7 @@ typedef struct TFileCacheKey {
int32_t
nColName
;
}
ICacheKey
;
int
indexFlushCacheTFile
(
SIndex
*
sIdx
,
void
*
);
int
indexFlushCacheT
oT
File
(
SIndex
*
sIdx
,
void
*
);
int32_t
indexSerialCacheKey
(
ICacheKey
*
key
,
char
*
buf
);
...
...
source/libs/index/inc/index_cache.h
浏览文件 @
72c4f4ef
...
...
@@ -21,9 +21,8 @@
#include "tskiplist.h"
// ----------------- key structure in skiplist ---------------------
/* A data row, the format is like below:
* content: |<--totalLen-->|<-- value len--->|<-- value -->|<--uid -->|<--version--->|<-- itermType -->|
* len : |<--int32_t -->|<--- int32_t --->|<--valuelen->|<--uint64_t->|<-- int32_t-->|<-- int8_t --->|
/* A data row, the format is like below
* content: |<---colVal---->|<-- version--->|<-- uid--->|<-- colType --->|<--operaType--->|
*/
#ifdef __cplusplus
...
...
source/libs/index/src/index.c
浏览文件 @
72c4f4ef
...
...
@@ -384,7 +384,6 @@ static void indexMergeSameKey(SArray* result, TFileValue* tv) {
}
}
else
{
taosArrayPush
(
result
,
&
tv
);
// indexError("merge colVal: %s", tv->colVal);
}
}
static
void
indexDestroyTempResult
(
SArray
*
result
)
{
...
...
@@ -395,7 +394,7 @@ static void indexDestroyTempResult(SArray* result) {
}
taosArrayDestroy
(
result
);
}
int
indexFlushCacheTFile
(
SIndex
*
sIdx
,
void
*
cache
)
{
int
indexFlushCacheT
oT
File
(
SIndex
*
sIdx
,
void
*
cache
)
{
if
(
sIdx
==
NULL
)
{
return
-
1
;
}
indexInfo
(
"suid %"
PRIu64
" merge cache into tindex"
,
sIdx
->
suid
);
...
...
source/libs/index/src/index_cache.c
浏览文件 @
72c4f4ef
...
...
@@ -45,9 +45,7 @@ IndexCache* indexCacheCreate(SIndex* idx, uint64_t suid, const char* colName, in
return
NULL
;
};
cache
->
mem
=
indexInternalCacheCreate
(
type
);
cache
->
colName
=
calloc
(
1
,
strlen
(
colName
)
+
1
);
memcpy
(
cache
->
colName
,
colName
,
strlen
(
colName
));
cache
->
colName
=
tstrdup
(
colName
);
cache
->
type
=
type
;
cache
->
index
=
idx
;
cache
->
version
=
0
;
...
...
@@ -187,8 +185,8 @@ static void indexCacheMakeRoomForWrite(IndexCache* cache) {
break
;
}
else
if
(
cache
->
imm
!=
NULL
)
{
// TODO: wake up by condition variable
// pthread_mutex_unlock(&cache->mtx);
pthread_cond_wait
(
&
cache
->
finished
,
&
cache
->
mtx
);
// pthread_mutex_unlock(&cache->mtx);
// taosMsleep(50);
// pthread_mutex_lock(&cache->mtx);
}
else
{
...
...
@@ -353,7 +351,7 @@ static MemTable* indexInternalCacheCreate(int8_t type) {
static
void
doMergeWork
(
SSchedMsg
*
msg
)
{
IndexCache
*
pCache
=
msg
->
ahandle
;
SIndex
*
sidx
=
(
SIndex
*
)
pCache
->
index
;
indexFlushCacheTFile
(
sidx
,
pCache
);
indexFlushCacheT
oT
File
(
sidx
,
pCache
);
}
static
bool
indexCacheIteratorNext
(
Iterate
*
itera
)
{
SSkipListIterator
*
iter
=
itera
->
iter
;
...
...
source/libs/index/src/index_fst_counting_writer.c
浏览文件 @
72c4f4ef
...
...
@@ -18,8 +18,6 @@
#include "tutil.h"
static
int
writeCtxDoWrite
(
WriterCtx
*
ctx
,
uint8_t
*
buf
,
int
len
)
{
// if (ctx->offset + len > ctx->limit) { return -1; }
if
(
ctx
->
type
==
TFile
)
{
assert
(
len
==
tfWrite
(
ctx
->
file
.
fd
,
buf
,
len
));
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录