Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6211f281
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
提交
6211f281
编写于
6月 13, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more work
上级
996ded19
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
90 addition
and
31 deletion
+90
-31
include/common/tdataformat.h
include/common/tdataformat.h
+3
-1
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+7
-7
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+40
-20
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+38
-1
未找到文件。
include/common/tdataformat.h
浏览文件 @
6211f281
...
@@ -42,6 +42,8 @@ int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t nCols, STSchema *
...
@@ -42,6 +42,8 @@ int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t nCols, STSchema *
void
tTSchemaDestroy
(
STSchema
*
pTSchema
);
void
tTSchemaDestroy
(
STSchema
*
pTSchema
);
// SValue
// SValue
int32_t
tPutValue
(
uint8_t
*
p
,
SValue
*
pValue
,
int8_t
type
);
int32_t
tGetValue
(
uint8_t
*
p
,
SValue
*
pValue
,
int8_t
type
);
int
tValueCmprFn
(
const
SValue
*
pValue1
,
const
SValue
*
pValue2
,
int8_t
type
);
int
tValueCmprFn
(
const
SValue
*
pValue1
,
const
SValue
*
pValue2
,
int8_t
type
);
// STSRow2
// STSRow2
...
...
source/common/src/tdataformat.c
浏览文件 @
6211f281
...
@@ -37,7 +37,7 @@ typedef struct {
...
@@ -37,7 +37,7 @@ typedef struct {
#define GET_BIT2(p, i) (((p)[(i) / 4] >> ((i) % 4)) & ((uint8_t)3))
#define GET_BIT2(p, i) (((p)[(i) / 4] >> ((i) % 4)) & ((uint8_t)3))
// SValue
// SValue
static
FORCE_INLINE
int32_t
tPutValue
(
uint8_t
*
p
,
SValue
*
pValue
,
int8_t
type
)
{
int32_t
tPutValue
(
uint8_t
*
p
,
SValue
*
pValue
,
int8_t
type
)
{
int32_t
n
=
0
;
int32_t
n
=
0
;
if
(
IS_VAR_DATA_TYPE
(
type
))
{
if
(
IS_VAR_DATA_TYPE
(
type
))
{
...
@@ -88,7 +88,7 @@ static FORCE_INLINE int32_t tPutValue(uint8_t *p, SValue *pValue, int8_t type) {
...
@@ -88,7 +88,7 @@ static FORCE_INLINE int32_t tPutValue(uint8_t *p, SValue *pValue, int8_t type) {
return
n
;
return
n
;
}
}
static
FORCE_INLINE
int32_t
tGetValue
(
uint8_t
*
p
,
SValue
*
pValue
,
int8_t
type
)
{
int32_t
tGetValue
(
uint8_t
*
p
,
SValue
*
pValue
,
int8_t
type
)
{
int32_t
n
=
0
;
int32_t
n
=
0
;
if
(
IS_VAR_DATA_TYPE
(
type
))
{
if
(
IS_VAR_DATA_TYPE
(
type
))
{
...
...
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
6211f281
...
@@ -46,7 +46,8 @@ typedef struct SMergeInfo SMergeInfo;
...
@@ -46,7 +46,8 @@ typedef struct SMergeInfo SMergeInfo;
typedef
struct
STable
STable
;
typedef
struct
STable
STable
;
typedef
struct
SOffset
SOffset
;
typedef
struct
SOffset
SOffset
;
typedef
struct
SMapData
SMapData
;
typedef
struct
SMapData
SMapData
;
typedef
struct
SVDataCols
SVDataCols
;
typedef
struct
SColData
SColData
;
typedef
struct
SColDataBlock
SColDataBlock
;
// tsdbMemTable ==============================================================================================
// tsdbMemTable ==============================================================================================
...
@@ -270,8 +271,16 @@ int tsdbLockRepo(STsdb *pTsdb);
...
@@ -270,8 +271,16 @@ int tsdbLockRepo(STsdb *pTsdb);
int
tsdbUnlockRepo
(
STsdb
*
pTsdb
);
int
tsdbUnlockRepo
(
STsdb
*
pTsdb
);
struct
TSDBROW
{
struct
TSDBROW
{
union
{
struct
{
int64_t
version
;
int64_t
version
;
STSRow
*
pTSRow
;
STSRow
*
pTSRow
;
};
struct
{
SColDataBlock
*
pColDataBlock
;
int32_t
iRow
;
};
};
};
};
struct
SBlockIdxItem
{
struct
SBlockIdxItem
{
...
@@ -449,8 +458,19 @@ struct SMapData {
...
@@ -449,8 +458,19 @@ struct SMapData {
uint8_t
*
pData
;
uint8_t
*
pData
;
};
};
struct
SVDataCols
{
struct
SColData
{
int16_t
cid
;
uint8_t
flags
;
uint32_t
nData
;
uint8_t
*
pData
;
};
struct
SColDataBlock
{
int32_t
nRow
;
int64_t
*
aVersion
;
int64_t
*
aVersion
;
TSKEY
*
aTSKey
;
int32_t
nColData
;
SColData
*
aColData
;
};
};
#ifdef __cplusplus
#ifdef __cplusplus
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
6211f281
...
@@ -40,8 +40,8 @@ struct SCommitter {
...
@@ -40,8 +40,8 @@ struct SCommitter {
SBlockIdx
*
pBlockIdx
;
SBlockIdx
*
pBlockIdx
;
SMapData
oBlock
;
SMapData
oBlock
;
SMapData
nBlock
;
SMapData
nBlock
;
SColDataB
atch
oBatch
;
SColDataB
lock
oColDataBlock
;
SColDataB
atch
nBatch
;
SColDataB
lock
nColDataBlock
;
/* commit del */
/* commit del */
SDelFReader
*
pDelFReader
;
SDelFReader
*
pDelFReader
;
SDelFWriter
*
pDelFWriter
;
SDelFWriter
*
pDelFWriter
;
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
6211f281
...
@@ -726,4 +726,41 @@ int32_t tsdbKeyFid(TSKEY key, int32_t minutes, int8_t precision) {
...
@@ -726,4 +726,41 @@ int32_t tsdbKeyFid(TSKEY key, int32_t minutes, int8_t precision) {
}
}
}
}
// TSDBROW ======================================================
void
tsdbRowGetColVal
(
TSDBROW
*
pRow
,
STSchema
*
pTSchema
,
int32_t
iCol
,
SColVal
*
pColVal
)
{
// TODO
}
// SColDataBlock ======================================================
// SColDataBlock ======================================================
int32_t
tsdbColDataBlockAppend
(
SColDataBlock
*
pColDataBlock
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
)
{
int32_t
code
=
0
;
int32_t
nRow
=
pColDataBlock
->
nRow
;
STColumn
*
pTColumn
;
SColData
*
pColData
;
SColVal
colVal
;
pColDataBlock
->
nRow
++
;
// version
pColDataBlock
->
aVersion
[
nRow
]
=
pRow
->
version
;
// TODO
// ts
pColDataBlock
->
aTSKey
[
nRow
]
=
pRow
->
pTSRow
->
ts
;
// TODO
// other rows
for
(
int32_t
iCol
=
1
;
iCol
<
pTSchema
->
numOfCols
;
iCol
++
)
{
pTColumn
=
&
pTSchema
->
columns
[
iCol
];
tsdbRowGetColVal
(
pRow
,
pTSchema
,
iCol
,
&
colVal
);
if
(
colVal
.
isNone
)
{
// TODO
}
else
if
(
colVal
.
isNull
)
{
// TODO
}
else
{
pColData
->
nData
+=
tPutValue
(
pColData
->
pData
+
pColData
->
nData
,
&
colVal
.
value
,
pTColumn
->
type
);
}
}
return
code
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录