Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f10c5430
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看板
提交
f10c5430
编写于
11月 30, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more
上级
1545dc59
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
27 deletion
+36
-27
include/common/trow.h
include/common/trow.h
+27
-26
include/dnode/vnode/vnode.h
include/dnode/vnode/vnode.h
+4
-0
source/common/src/trow.c
source/common/src/trow.c
+3
-1
source/common/test/trowTest.cpp
source/common/test/trowTest.cpp
+2
-0
未找到文件。
include/common/trow.h
浏览文件 @
f10c5430
...
...
@@ -47,31 +47,32 @@ typedef struct {
typedef
struct
{
union
{
/// union field for encode and decode
uint
64
_t
info
;
uint
32
_t
info
;
struct
{
/// is deleted row
uint64_t
del
:
1
;
/// row type
uint
64_t
type
:
3
;
uint
32_t
type
:
2
;
/// row schema version
uint
64
_t
sver
:
16
;
///
row total length
uint
64_t
len
:
32
;
uint
32
_t
sver
:
16
;
///
is delete row
uint
32_t
del
:
1
;
/// reserved for back compatibility
uint
64_t
reserve
:
12
;
uint
32_t
reserve
:
13
;
};
};
/// row total length
uint32_t
len
;
/// row version
uint64_t
ver
;
/// timestamp
TSKEY
ts
;
char
content
[];
}
SRow
;
/// the inline data, maybe a tuple or a k-v tuple
char
data
[];
}
STSRow
;
typedef
struct
{
uint32_t
nRows
;
char
rows
[];
}
SRowBatch
;
}
S
TS
RowBatch
;
typedef
enum
{
/// ordinary row builder
...
...
@@ -88,36 +89,36 @@ typedef struct {
/// buffer writer
SBufferWriter
bw
;
/// target row
SRow
*
pRow
;
}
SRowBuilder
;
S
TS
Row
*
pRow
;
}
S
TS
RowBuilder
;
typedef
struct
{
STSchema
*
pSchema
;
SRow
*
pRow
;
}
SRowReader
;
S
TS
Row
*
pRow
;
}
S
TS
RowReader
;
typedef
struct
{
uint32_t
it
;
SRowBatch
*
pRowBatch
;
}
SRowBatchIter
;
S
TS
RowBatch
*
pRowBatch
;
}
S
TS
RowBatchIter
;
// SRowBuilder
// S
TS
RowBuilder
#define trbInit(rt, allocator, endian, target, size) \
{ .type = (rt), .bw = tbufInitWriter(allocator, endian), .pRow = (target) }
void
trbSetRowInfo
(
SRowBuilder
*
pRB
,
bool
del
,
uint16_t
sver
);
void
trbSetRowVersion
(
SRowBuilder
*
pRB
,
uint64_t
ver
);
void
trbSetRowTS
(
SRowBuilder
*
pRB
,
TSKEY
ts
);
int
trbWriteCol
(
SRowBuilder
*
pRB
,
void
*
pData
,
col_id_t
cid
);
void
trbSetRowInfo
(
S
TS
RowBuilder
*
pRB
,
bool
del
,
uint16_t
sver
);
void
trbSetRowVersion
(
S
TS
RowBuilder
*
pRB
,
uint64_t
ver
);
void
trbSetRowTS
(
S
TS
RowBuilder
*
pRB
,
TSKEY
ts
);
int
trbWriteCol
(
S
TS
RowBuilder
*
pRB
,
void
*
pData
,
col_id_t
cid
);
// SRowReader
// S
TS
RowReader
#define tRowReaderInit(schema, row) \
{ .schema = (schema), .row = (row) }
int
tRowReaderRead
(
SRowReader
*
pRowReader
,
col_id_t
cid
,
void
*
target
,
uint64_t
size
);
int
tRowReaderRead
(
S
TS
RowReader
*
pRowReader
,
col_id_t
cid
,
void
*
target
,
uint64_t
size
);
// SRowBatchIter
// S
TS
RowBatchIter
#define tRowBatchIterInit(pRB) \
{ .it = 0, .pRowBatch = (pRB) }
const
S
Row
*
tRowBatchIterNext
(
SRowBatchIter
*
pRowBatchIter
);
const
S
TSRow
*
tRowBatchIterNext
(
ST
SRowBatchIter
*
pRowBatchIter
);
#ifdef __cplusplus
}
...
...
include/dnode/vnode/vnode.h
浏览文件 @
f10c5430
...
...
@@ -149,6 +149,10 @@ typedef struct {
tb_uid_t
uid
;
}
SVDropTableReq
;
typedef
struct
{
// TODO
}
SVSubmitReq
;
typedef
struct
{
uint64_t
ver
;
union
{
...
...
source/common/src/trow.c
浏览文件 @
f10c5430
...
...
@@ -15,6 +15,7 @@
#include "trow.h"
#if 0
void trbSetRowInfo(SRowBuilder *pRB, bool del, uint16_t sver) {
// TODO
}
...
...
@@ -30,4 +31,5 @@ void trbSetRowTS(SRowBuilder *pRB, TSKEY ts) {
int trbWriteCol(SRowBuilder *pRB, void *pData, col_id_t cid) {
// TODO
return 0;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
source/common/test/trowTest.cpp
浏览文件 @
f10c5430
...
...
@@ -3,6 +3,7 @@
#include "trow.h"
TEST
(
td_row_test
,
build_row_to_target
)
{
#if 0
char dst[1024];
SRow* pRow = (SRow*)dst;
int ncols = 10;
...
...
@@ -18,4 +19,5 @@ TEST(td_row_test, build_row_to_target) {
// TODO
}
}
#endif
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录