Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
1c0cb588
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1c0cb588
编写于
5月 18, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change uid from int64_t to uint64_t in tsdb
上级
4ff1ca4b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
35 addition
and
34 deletion
+35
-34
src/inc/tsdb.h
src/inc/tsdb.h
+6
-6
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+12
-12
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+3
-3
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+3
-3
src/tsdb/src/tsdbMetaFile.c
src/tsdb/src/tsdbMetaFile.c
+6
-6
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+4
-3
src/tsdb/tests/tsdbTests.cpp
src/tsdb/tests/tsdbTests.cpp
+1
-1
未找到文件。
src/inc/tsdb.h
浏览文件 @
1c0cb588
...
...
@@ -77,8 +77,8 @@ int32_t tsdbConfigRepo(TsdbRepoT *repo, STsdbCfg *pCfg);
// --------- TSDB TABLE DEFINITION
typedef
struct
{
int64_t
uid
;
// the unique table ID
int32_t
tid
;
// the table ID in the repository.
u
int64_t
uid
;
// the unique table ID
int32_t
tid
;
// the table ID in the repository.
}
STableId
;
// --------- TSDB TABLE configuration
...
...
@@ -88,14 +88,14 @@ typedef struct {
STableId
tableId
;
int32_t
sversion
;
char
*
sname
;
// super table name
int64_t
superUid
;
uint64_t
superUid
;
STSchema
*
schema
;
STSchema
*
tagSchema
;
SDataRow
tagValues
;
}
STableCfg
;
int
tsdbInitTableCfg
(
STableCfg
*
config
,
ETableType
type
,
int64_t
uid
,
int32_t
tid
);
int
tsdbTableSetSuperUid
(
STableCfg
*
config
,
int64_t
uid
);
int
tsdbInitTableCfg
(
STableCfg
*
config
,
ETableType
type
,
u
int64_t
uid
,
int32_t
tid
);
int
tsdbTableSetSuperUid
(
STableCfg
*
config
,
u
int64_t
uid
);
int
tsdbTableSetSchema
(
STableCfg
*
config
,
STSchema
*
pSchema
,
bool
dup
);
int
tsdbTableSetTagSchema
(
STableCfg
*
config
,
STSchema
*
pSchema
,
bool
dup
);
int
tsdbTableSetTagValue
(
STableCfg
*
config
,
SDataRow
row
,
bool
dup
);
...
...
@@ -109,7 +109,7 @@ char* tsdbGetTableName(TsdbRepoT *repo, const STableId* id, int16_t* bytes);
int
tsdbCreateTable
(
TsdbRepoT
*
repo
,
STableCfg
*
pCfg
);
int
tsdbDropTable
(
TsdbRepoT
*
pRepo
,
STableId
tableId
);
int
tsdbAlterTable
(
TsdbRepoT
*
repo
,
STableCfg
*
pCfg
);
TSKEY
tsdbGetTableLastKey
(
TsdbRepoT
*
repo
,
int64_t
uid
);
TSKEY
tsdbGetTableLastKey
(
TsdbRepoT
*
repo
,
u
int64_t
uid
);
uint32_t
tsdbGetFileInfo
(
TsdbRepoT
*
repo
,
char
*
name
,
uint32_t
*
index
,
int32_t
*
size
);
...
...
src/tsdb/inc/tsdbMain.h
浏览文件 @
1c0cb588
...
...
@@ -63,9 +63,9 @@ typedef struct {
}
SMetaFile
;
SMetaFile
*
tsdbInitMetaFile
(
char
*
rootDir
,
int32_t
maxTables
,
iterFunc
iFunc
,
afterFunc
aFunc
,
void
*
appH
);
int32_t
tsdbInsertMetaRecord
(
SMetaFile
*
mfh
,
int64_t
uid
,
void
*
cont
,
int32_t
contLen
);
int32_t
tsdbDeleteMetaRecord
(
SMetaFile
*
mfh
,
int64_t
uid
);
int32_t
tsdbUpdateMetaRecord
(
SMetaFile
*
mfh
,
int64_t
uid
,
void
*
cont
,
int32_t
contLen
);
int32_t
tsdbInsertMetaRecord
(
SMetaFile
*
mfh
,
u
int64_t
uid
,
void
*
cont
,
int32_t
contLen
);
int32_t
tsdbDeleteMetaRecord
(
SMetaFile
*
mfh
,
u
int64_t
uid
);
int32_t
tsdbUpdateMetaRecord
(
SMetaFile
*
mfh
,
u
int64_t
uid
,
void
*
cont
,
int32_t
contLen
);
void
tsdbCloseMetaFile
(
SMetaFile
*
mfh
);
// ------------------------------ TSDB META INTERFACES ------------------------------
...
...
@@ -82,7 +82,7 @@ typedef struct {
typedef
struct
STable
{
int8_t
type
;
STableId
tableId
;
int64_t
superUid
;
// Super table UID
uint64_t
superUid
;
// Super table UID
int32_t
sversion
;
STSchema
*
schema
;
STSchema
*
tagSchema
;
...
...
@@ -153,7 +153,7 @@ STsdbMeta *tsdbGetMeta(TsdbRepoT *pRepo);
STable
*
tsdbIsValidTableToInsert
(
STsdbMeta
*
pMeta
,
STableId
tableId
);
// int32_t tsdbInsertRowToTableImpl(SSkipListNode *pNode, STable *pTable);
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
int64_t
uid
);
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
u
int64_t
uid
);
char
*
getTSTupleKey
(
const
void
*
data
);
typedef
struct
{
...
...
@@ -275,8 +275,8 @@ typedef struct {
uint32_t
padding
;
// For padding purpose
uint32_t
hasLast
:
2
;
uint32_t
numOfBlocks
:
30
;
int64_t
uid
;
TSKEY
maxKey
;
u
int64_t
uid
;
TSKEY
maxKey
;
}
SCompIdx
;
/* sizeof(SCompIdx) = 28 */
void
*
tsdbEncodeSCompIdx
(
void
*
buf
,
SCompIdx
*
pIdx
);
...
...
@@ -311,7 +311,7 @@ typedef struct {
typedef
struct
{
int32_t
delimiter
;
// For recovery usage
int32_t
checksum
;
// TODO: decide if checksum logic in this file or make it one API
int64_t
uid
;
uint64_t
uid
;
SCompBlock
blocks
[];
}
SCompInfo
;
...
...
@@ -345,7 +345,7 @@ typedef struct {
typedef
struct
{
int32_t
delimiter
;
// For recovery usage
int32_t
numOfCols
;
// For recovery usage
int64_t
uid
;
// For recovery usage
uint64_t
uid
;
// For recovery usage
SCompCol
cols
[];
}
SCompData
;
...
...
@@ -441,9 +441,9 @@ typedef struct {
}
SHelperFile
;
typedef
struct
{
int64_t
uid
;
int32_t
tid
;
int32_t
sversion
;
u
int64_t
uid
;
int32_t
tid
;
int32_t
sversion
;
}
SHelperTable
;
typedef
struct
{
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
1c0cb588
...
...
@@ -392,7 +392,7 @@ int tsdbAlterTable(TsdbRepoT *pRepo, STableCfg *pCfg) {
return
0
;
}
TSKEY
tsdbGetTableLastKey
(
TsdbRepoT
*
repo
,
int64_t
uid
)
{
TSKEY
tsdbGetTableLastKey
(
TsdbRepoT
*
repo
,
u
int64_t
uid
)
{
STsdbRepo
*
pRepo
=
(
STsdbRepo
*
)
repo
;
STable
*
pTable
=
tsdbGetTableByUid
(
pRepo
->
tsdbMeta
,
uid
);
...
...
@@ -430,7 +430,7 @@ int32_t tsdbInsertData(TsdbRepoT *repo, SSubmitMsg *pMsg, SShellSubmitRspMsg * p
/**
* Initialize a table configuration
*/
int
tsdbInitTableCfg
(
STableCfg
*
config
,
ETableType
type
,
int64_t
uid
,
int32_t
tid
)
{
int
tsdbInitTableCfg
(
STableCfg
*
config
,
ETableType
type
,
u
int64_t
uid
,
int32_t
tid
)
{
if
(
config
==
NULL
)
return
-
1
;
if
(
type
!=
TSDB_NORMAL_TABLE
&&
type
!=
TSDB_CHILD_TABLE
)
return
-
1
;
...
...
@@ -447,7 +447,7 @@ int tsdbInitTableCfg(STableCfg *config, ETableType type, int64_t uid, int32_t ti
/**
* Set the super table UID of the created table
*/
int
tsdbTableSetSuperUid
(
STableCfg
*
config
,
int64_t
uid
)
{
int
tsdbTableSetSuperUid
(
STableCfg
*
config
,
u
int64_t
uid
)
{
if
(
config
->
type
!=
TSDB_CHILD_TABLE
)
return
-
1
;
if
(
uid
==
TSDB_INVALID_SUPER_TABLE_ID
)
return
-
1
;
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
1c0cb588
...
...
@@ -87,9 +87,9 @@ STable *tsdbDecodeTable(void *cont, int contLen) {
memcpy
(
pTable
->
name
->
data
,
ptr
,
len
);
ptr
=
(
char
*
)
ptr
+
len
;
T_READ_MEMBER
(
ptr
,
int64_t
,
pTable
->
tableId
.
uid
);
T_READ_MEMBER
(
ptr
,
u
int64_t
,
pTable
->
tableId
.
uid
);
T_READ_MEMBER
(
ptr
,
int32_t
,
pTable
->
tableId
.
tid
);
T_READ_MEMBER
(
ptr
,
int64_t
,
pTable
->
superUid
);
T_READ_MEMBER
(
ptr
,
u
int64_t
,
pTable
->
superUid
);
T_READ_MEMBER
(
ptr
,
int32_t
,
pTable
->
sversion
);
if
(
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
...
...
@@ -455,7 +455,7 @@ static int32_t tsdbCheckTableCfg(STableCfg *pCfg) {
return
0
;
}
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
int64_t
uid
)
{
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
u
int64_t
uid
)
{
void
*
ptr
=
taosHashGet
(
pMeta
->
map
,
(
char
*
)(
&
uid
),
sizeof
(
uid
));
if
(
ptr
==
NULL
)
return
NULL
;
...
...
src/tsdb/src/tsdbMetaFile.c
浏览文件 @
1c0cb588
...
...
@@ -23,9 +23,9 @@
#define TSDB_META_FILE_HEADER_SIZE 512
typedef
struct
{
int32_t
offset
;
int32_t
size
;
int64_t
uid
;
int32_t
offset
;
int32_t
size
;
u
int64_t
uid
;
}
SRecordInfo
;
// static int32_t tsdbGetMetaFileName(char *rootDir, char *fname);
...
...
@@ -76,7 +76,7 @@ SMetaFile *tsdbInitMetaFile(char *rootDir, int32_t maxTables, iterFunc iFunc, af
return
mfh
;
}
int32_t
tsdbInsertMetaRecord
(
SMetaFile
*
mfh
,
int64_t
uid
,
void
*
cont
,
int32_t
contLen
)
{
int32_t
tsdbInsertMetaRecord
(
SMetaFile
*
mfh
,
u
int64_t
uid
,
void
*
cont
,
int32_t
contLen
)
{
if
(
taosHashGet
(
mfh
->
map
,
(
char
*
)(
&
uid
),
sizeof
(
uid
))
!=
NULL
)
{
return
-
1
;
}
...
...
@@ -112,7 +112,7 @@ int32_t tsdbInsertMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t co
return
0
;
}
int32_t
tsdbDeleteMetaRecord
(
SMetaFile
*
mfh
,
int64_t
uid
)
{
int32_t
tsdbDeleteMetaRecord
(
SMetaFile
*
mfh
,
u
int64_t
uid
)
{
char
*
ptr
=
taosHashGet
(
mfh
->
map
,
(
char
*
)(
&
uid
),
sizeof
(
uid
));
if
(
ptr
==
NULL
)
return
-
1
;
...
...
@@ -139,7 +139,7 @@ int32_t tsdbDeleteMetaRecord(SMetaFile *mfh, int64_t uid) {
return
0
;
}
int32_t
tsdbUpdateMetaRecord
(
SMetaFile
*
mfh
,
int64_t
uid
,
void
*
cont
,
int32_t
contLen
)
{
int32_t
tsdbUpdateMetaRecord
(
SMetaFile
*
mfh
,
u
int64_t
uid
,
void
*
cont
,
int32_t
contLen
)
{
char
*
ptr
=
taosHashGet
(
mfh
->
map
,
(
char
*
)(
&
uid
),
sizeof
(
uid
));
if
(
ptr
==
NULL
)
return
-
1
;
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
1c0cb588
...
...
@@ -1516,8 +1516,9 @@ static int32_t doQueryTableList(STable* pSTable, SArray* pRes, tExprNode* pExpr)
return
TSDB_CODE_SUCCESS
;
}
int32_t
tsdbQuerySTableByTagCond
(
TsdbRepoT
*
tsdb
,
int64_t
uid
,
const
char
*
pTagCond
,
size_t
len
,
int16_t
tagNameRelType
,
const
char
*
tbnameCond
,
STableGroupInfo
*
pGroupInfo
,
SColIndex
*
pColIndex
,
int32_t
numOfCols
)
{
int32_t
tsdbQuerySTableByTagCond
(
TsdbRepoT
*
tsdb
,
uint64_t
uid
,
const
char
*
pTagCond
,
size_t
len
,
int16_t
tagNameRelType
,
const
char
*
tbnameCond
,
STableGroupInfo
*
pGroupInfo
,
SColIndex
*
pColIndex
,
int32_t
numOfCols
)
{
STable
*
pTable
=
tsdbGetTableByUid
(
tsdbGetMeta
(
tsdb
),
uid
);
if
(
pTable
==
NULL
)
{
uError
(
"%p failed to get stable, uid:%"
PRIu64
,
tsdb
,
uid
);
...
...
@@ -1589,7 +1590,7 @@ int32_t tsdbQuerySTableByTagCond(TsdbRepoT *tsdb, int64_t uid, const char *pTagC
return
ret
;
}
int32_t
tsdbGetOneTableGroup
(
TsdbRepoT
*
tsdb
,
int64_t
uid
,
STableGroupInfo
*
pGroupInfo
)
{
int32_t
tsdbGetOneTableGroup
(
TsdbRepoT
*
tsdb
,
u
int64_t
uid
,
STableGroupInfo
*
pGroupInfo
)
{
STable
*
pTable
=
tsdbGetTableByUid
(
tsdbGetMeta
(
tsdb
),
uid
);
if
(
pTable
==
NULL
)
{
return
TSDB_CODE_INVALID_TABLE_ID
;
...
...
src/tsdb/tests/tsdbTests.cpp
浏览文件 @
1c0cb588
...
...
@@ -16,7 +16,7 @@ typedef struct {
TsdbRepoT
*
pRepo
;
bool
isAscend
;
int
tid
;
int64_t
uid
;
uint64_t
uid
;
int
sversion
;
TSKEY
startTime
;
TSKEY
interval
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录