Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
be7aaccb
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看板
提交
be7aaccb
编写于
10月 13, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor more code
上级
0ba880d1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
16 deletion
+37
-16
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+14
-14
src/tsdb/src/tsdbMemTable.c
src/tsdb/src/tsdbMemTable.c
+2
-2
src/tsdb/src/tsdbReadUtil.c
src/tsdb/src/tsdbReadUtil.c
+21
-0
未找到文件。
src/tsdb/inc/tsdbMain.h
浏览文件 @
be7aaccb
...
@@ -237,19 +237,19 @@ typedef struct {
...
@@ -237,19 +237,19 @@ typedef struct {
int32_t
algorithm
:
8
;
int32_t
algorithm
:
8
;
int32_t
numOfRows
:
24
;
int32_t
numOfRows
:
24
;
int32_t
len
;
int32_t
len
;
int32_t
keyLen
;
// key column length, keyOffset = offset+sizeof(S
CompData)+sizeof(SComp
Col)*numOfCols
int32_t
keyLen
;
// key column length, keyOffset = offset+sizeof(S
BlockData)+sizeof(SBlock
Col)*numOfCols
int16_t
numOfSubBlocks
;
int16_t
numOfSubBlocks
;
int16_t
numOfCols
;
// not including timestamp column
int16_t
numOfCols
;
// not including timestamp column
TSKEY
keyFirst
;
TSKEY
keyFirst
;
TSKEY
keyLast
;
TSKEY
keyLast
;
}
S
Comp
Block
;
}
SBlock
;
typedef
struct
{
typedef
struct
{
int32_t
delimiter
;
// For recovery usage
int32_t
delimiter
;
// For recovery usage
int32_t
tid
;
int32_t
tid
;
uint64_t
uid
;
uint64_t
uid
;
S
Comp
Block
blocks
[];
SBlock
blocks
[];
}
S
Comp
Info
;
}
S
Block
Info
;
typedef
struct
{
typedef
struct
{
int16_t
colId
;
int16_t
colId
;
...
@@ -263,14 +263,14 @@ typedef struct {
...
@@ -263,14 +263,14 @@ typedef struct {
int16_t
minIndex
;
int16_t
minIndex
;
int16_t
numOfNull
;
int16_t
numOfNull
;
char
padding
[
2
];
char
padding
[
2
];
}
S
Comp
Col
;
}
S
Block
Col
;
typedef
struct
{
typedef
struct
{
int32_t
delimiter
;
// For recovery usage
int32_t
delimiter
;
// For recovery usage
int32_t
numOfCols
;
// For recovery usage
int32_t
numOfCols
;
// For recovery usage
uint64_t
uid
;
// For recovery usage
uint64_t
uid
;
// For recovery usage
S
Comp
Col
cols
[];
S
Block
Col
cols
[];
}
S
Comp
Data
;
}
S
Block
Data
;
typedef
enum
{
TSDB_WRITE_HELPER
,
TSDB_READ_HELPER
}
tsdb_rw_helper_t
;
typedef
enum
{
TSDB_WRITE_HELPER
,
TSDB_READ_HELPER
}
tsdb_rw_helper_t
;
...
@@ -305,10 +305,10 @@ typedef struct {
...
@@ -305,10 +305,10 @@ typedef struct {
void
*
pWIdx
;
void
*
pWIdx
;
// For table set usage
// For table set usage
SHelperTable
tableInfo
;
SHelperTable
tableInfo
;
S
Comp
Info
*
pCompInfo
;
S
Block
Info
*
pCompInfo
;
bool
hasOldLastBlock
;
bool
hasOldLastBlock
;
// For block set usage
// For block set usage
S
Comp
Data
*
pCompData
;
S
Block
Data
*
pCompData
;
SDataCols
*
pDataCols
[
2
];
SDataCols
*
pDataCols
[
2
];
void
*
pBuffer
;
// Buffer to hold the whole data block
void
*
pBuffer
;
// Buffer to hold the whole data block
void
*
compBuffer
;
// Buffer for temperary compress/decompress purpose
void
*
compBuffer
;
// Buffer for temperary compress/decompress purpose
...
@@ -319,7 +319,7 @@ typedef struct {
...
@@ -319,7 +319,7 @@ typedef struct {
SFileGroup
fGroup
;
SFileGroup
fGroup
;
int
numOfIdx
;
int
numOfIdx
;
SCompIdx
*
pCompIdx
;
SCompIdx
*
pCompIdx
;
S
Comp
Info
*
pCompInfo
;
S
Block
Info
*
pCompInfo
;
void
*
pBuf
;
void
*
pBuf
;
FILE
*
tLogStream
;
FILE
*
tLogStream
;
}
STsdbScanHandle
;
}
STsdbScanHandle
;
...
@@ -523,13 +523,13 @@ int tsdbWriteCompIdx(SRWHelper* pHelper);
...
@@ -523,13 +523,13 @@ int tsdbWriteCompIdx(SRWHelper* pHelper);
int
tsdbLoadCompIdxImpl
(
SFile
*
pFile
,
uint32_t
offset
,
uint32_t
len
,
void
*
buffer
);
int
tsdbLoadCompIdxImpl
(
SFile
*
pFile
,
uint32_t
offset
,
uint32_t
len
,
void
*
buffer
);
int
tsdbDecodeSCompIdxImpl
(
void
*
buffer
,
uint32_t
len
,
SCompIdx
**
ppCompIdx
,
int
*
numOfIdx
);
int
tsdbDecodeSCompIdxImpl
(
void
*
buffer
,
uint32_t
len
,
SCompIdx
**
ppCompIdx
,
int
*
numOfIdx
);
int
tsdbLoadCompIdx
(
SRWHelper
*
pHelper
,
void
*
target
);
int
tsdbLoadCompIdx
(
SRWHelper
*
pHelper
,
void
*
target
);
int
tsdbLoadCompInfoImpl
(
SFile
*
pFile
,
SCompIdx
*
pIdx
,
S
Comp
Info
**
ppCompInfo
);
int
tsdbLoadCompInfoImpl
(
SFile
*
pFile
,
SCompIdx
*
pIdx
,
S
Block
Info
**
ppCompInfo
);
int
tsdbLoadCompInfo
(
SRWHelper
*
pHelper
,
void
*
target
);
int
tsdbLoadCompInfo
(
SRWHelper
*
pHelper
,
void
*
target
);
int
tsdbLoadCompData
(
SRWHelper
*
phelper
,
S
Comp
Block
*
pcompblock
,
void
*
target
);
int
tsdbLoadCompData
(
SRWHelper
*
phelper
,
SBlock
*
pcompblock
,
void
*
target
);
void
tsdbGetDataStatis
(
SRWHelper
*
pHelper
,
SDataStatis
*
pStatis
,
int
numOfCols
);
void
tsdbGetDataStatis
(
SRWHelper
*
pHelper
,
SDataStatis
*
pStatis
,
int
numOfCols
);
int
tsdbLoadBlockDataCols
(
SRWHelper
*
pHelper
,
S
CompBlock
*
pCompBlock
,
SComp
Info
*
pCompInfo
,
int16_t
*
colIds
,
int
tsdbLoadBlockDataCols
(
SRWHelper
*
pHelper
,
S
Block
*
pCompBlock
,
SBlock
Info
*
pCompInfo
,
int16_t
*
colIds
,
int
numOfColIds
);
int
numOfColIds
);
int
tsdbLoadBlockData
(
SRWHelper
*
pHelper
,
S
CompBlock
*
pCompBlock
,
SComp
Info
*
pCompInfo
);
int
tsdbLoadBlockData
(
SRWHelper
*
pHelper
,
S
Block
*
pCompBlock
,
SBlock
Info
*
pCompInfo
);
static
FORCE_INLINE
int
compTSKEY
(
const
void
*
key1
,
const
void
*
key2
)
{
static
FORCE_INLINE
int
compTSKEY
(
const
void
*
key1
,
const
void
*
key2
)
{
if
(
*
(
TSKEY
*
)
key1
>
*
(
TSKEY
*
)
key2
)
{
if
(
*
(
TSKEY
*
)
key1
>
*
(
TSKEY
*
)
key2
)
{
...
...
src/tsdb/src/tsdbMemTable.c
浏览文件 @
be7aaccb
...
@@ -645,7 +645,7 @@ void tsdbGetFidKeyRange(int daysPerFile, int8_t precision, int fileId, TSKEY *mi
...
@@ -645,7 +645,7 @@ void tsdbGetFidKeyRange(int daysPerFile, int8_t precision, int fileId, TSKEY *mi
// newLast = TSDB_NLAST_FILE_OPENED(pHelper);
// newLast = TSDB_NLAST_FILE_OPENED(pHelper);
// if (tsdbLoadCompIdx(pHelper, NULL) < 0) {
// if (tsdbLoadCompIdx(pHelper, NULL) < 0) {
// tsdbError("vgId:%d failed to load S
Comp
Idx part since %s", REPO_ID(pRepo), tstrerror(terrno));
// tsdbError("vgId:%d failed to load S
Block
Idx part since %s", REPO_ID(pRepo), tstrerror(terrno));
// goto _err;
// goto _err;
// }
// }
...
@@ -681,7 +681,7 @@ void tsdbGetFidKeyRange(int daysPerFile, int8_t precision, int fileId, TSKEY *mi
...
@@ -681,7 +681,7 @@ void tsdbGetFidKeyRange(int daysPerFile, int8_t precision, int fileId, TSKEY *mi
// goto _err;
// goto _err;
// }
// }
// // Write the S
Comp
Block part
// // Write the SBlock part
// if (tsdbWriteCompInfo(pHelper) < 0) {
// if (tsdbWriteCompInfo(pHelper) < 0) {
// tsdbError("vgId:%d, failed to write compInfo part since %s", REPO_ID(pRepo), tstrerror(terrno));
// tsdbError("vgId:%d, failed to write compInfo part since %s", REPO_ID(pRepo), tstrerror(terrno));
// goto _err;
// goto _err;
...
...
src/tsdb/src/tsdbReadUtil.c
0 → 100644
浏览文件 @
be7aaccb
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tsdbMain.h"
typedef
struct
{
SFileGroup
fGroup
;
TSKEY
minKey
;
TSKEY
maxKey
;
}
SReadHandle
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录