Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a04663b7
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看板
提交
a04663b7
编写于
3月 05, 2020
作者:
H
hzcheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add more
上级
38d1d0e9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
18 deletion
+27
-18
src/vnode/common/inc/schema.h
src/vnode/common/inc/schema.h
+1
-1
src/vnode/common/src/schema.c
src/vnode/common/src/schema.c
+1
-1
src/vnode/tests/tsdb/tsdbTests.cpp
src/vnode/tests/tsdb/tsdbTests.cpp
+20
-0
src/vnode/tsdb/src/tsdbMeta.c
src/vnode/tsdb/src/tsdbMeta.c
+5
-16
未找到文件。
src/vnode/common/inc/schema.h
浏览文件 @
a04663b7
...
...
@@ -22,7 +22,7 @@ typedef struct {
int32_t
numOfCols
;
int32_t
numOfTags
;
int32_t
colIdCounter
;
SColumn
*
columns
;
SColumn
columns
[]
;
}
SSchema
;
/* Inline schema definition
...
...
src/vnode/common/src/schema.c
浏览文件 @
a04663b7
...
...
@@ -60,7 +60,7 @@ SISchema tdConvertSchemaToInline(SSchema *pSchema) {
TD_ISCHEMA_LEN
(
pISchema
)
=
(
int32_t
)
len
;
memcpy
((
void
*
)
TD_ISCHEMA_SCHEMA
(
pISchema
),
(
void
*
)
pSchema
,
sizeof
(
SSchema
));
TD_SCHEMA_COLS
(
TD_ISCHEMA_SCHEMA
(
pISchema
))
=
(
SColumn
*
)(
pISchema
+
TD_ISCHEMA_HEADER_SIZE
);
//
TD_SCHEMA_COLS(TD_ISCHEMA_SCHEMA(pISchema)) = (SColumn *)(pISchema + TD_ISCHEMA_HEADER_SIZE);
memcpy
((
void
*
)
TD_SCHEMA_COLS
(
TD_ISCHEMA_SCHEMA
(
pISchema
)),
(
void
*
)
TD_SCHEMA_COLS
(
pSchema
),
sizeof
(
SColumn
)
*
totalCols
);
...
...
src/vnode/tests/tsdb/tsdbTests.cpp
浏览文件 @
a04663b7
...
...
@@ -13,5 +13,25 @@ TEST(TsdbTest, createTsdbRepo) {
ASSERT_NE
(
pRepo
,
nullptr
);
STableCfg
config
;
config
.
tableId
.
tid
=
0
;
config
.
tableId
.
uid
=
10889498868728187539
;
config
.
numOfCols
=
2
;
config
.
schema
=
(
SSchema
*
)
malloc
(
sizeof
(
SSchema
)
+
sizeof
(
SColumn
)
*
config
.
numOfCols
);
config
.
schema
->
version
=
0
;
config
.
schema
->
numOfCols
=
2
;
config
.
schema
->
numOfTags
=
0
;
config
.
schema
->
colIdCounter
=
1
;
for
(
int
i
=
0
;
i
<
config
.
numOfCols
;
i
++
)
{
SColumn
*
pCol
=
config
.
schema
->
columns
+
i
;
pCol
->
type
=
TD_DATATYPE_BIGINT
;
pCol
->
colId
=
config
.
schema
->
colIdCounter
++
;
pCol
->
offset
=
10
;
pCol
->
colName
=
strdup
(
"col1"
);
}
config
.
tagValues
=
NULL
;
tsdbCreateTable
(
pRepo
,
&
config
);
tsdbCloseRepo
(
pRepo
);
}
\ No newline at end of file
src/vnode/tsdb/src/tsdbMeta.c
浏览文件 @
a04663b7
...
...
@@ -17,7 +17,6 @@ static int tsdbAddTableToMeta(STsdbMeta *pMeta, STable *pTable);
static
int
tsdbAddTableIntoMap
(
STsdbMeta
*
pMeta
,
STable
*
pTable
);
static
int
tsdbAddTableIntoIndex
(
STsdbMeta
*
pMeta
,
STable
*
pTable
);
static
int
tsdbRemoveTableFromIndex
(
STsdbMeta
*
pMeta
,
STable
*
pTable
);
static
int
tsdbInsertRowToTable
(
STable
*
pTable
,
SDataRow
row
);
STsdbMeta
*
tsdbCreateMeta
(
int32_t
maxTables
)
{
STsdbMeta
*
pMeta
=
(
STsdbMeta
*
)
malloc
(
sizeof
(
STsdbMeta
));
...
...
@@ -95,10 +94,10 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
0
,
NULL
);
// Allow duplicate key, no lock
if
(
pSTable
->
content
.
pIndex
==
NULL
)
{
free
(
pSTable
);
return
NULL
;
return
-
1
;
}
}
else
{
if
(
pSTable
->
type
!=
TSDB_SUPER_TABLE
)
return
NULL
;
if
(
pSTable
->
type
!=
TSDB_SUPER_TABLE
)
return
-
1
;
}
}
...
...
@@ -173,6 +172,8 @@ int32_t tsdbDropTableImpl(STsdbMeta *pMeta, STableId tableId) {
tsdbFreeTable
(
pTable
);
}
return
0
;
}
int32_t
tsdbInsertRowToTableImpl
(
SSkipListNode
*
pNode
,
STable
*
pTable
)
{
...
...
@@ -235,6 +236,7 @@ static int tsdbAddTableToMeta(STsdbMeta *pMeta, STable *pTable) {
static
int
tsdbRemoveTableFromMeta
(
STsdbMeta
*
pMeta
,
STable
*
pTable
)
{
// TODO
return
0
;
}
static
int
tsdbAddTableIntoMap
(
STsdbMeta
*
pMeta
,
STable
*
pTable
)
{
...
...
@@ -254,18 +256,5 @@ static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable) {
static
int
tsdbRemoveTableFromIndex
(
STsdbMeta
*
pMeta
,
STable
*
pTable
)
{
assert
(
pTable
->
type
==
TSDB_STABLE
);
// TODO
return
0
;
}
static
int
tsdbInsertRowToTable
(
STable
*
pTable
,
SDataRow
row
)
{
int32_t
headSize
;
int32_t
level
;
tSkipListRandNodeInfo
(
pTable
->
content
.
pIndex
,
&
level
,
&
headSize
);
// SSkipListNode *pNode = tsdbAllocFromCache(p);
// if (pNode == NULL) {
// return -1;
// }
return
0
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录