Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱划水de鲸鱼哥~
TDengine
提交
44d5644c
T
TDengine
项目概览
爱划水de鲸鱼哥~
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
44d5644c
编写于
6月 15, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-353
上级
d4e84b4f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
42 deletion
+41
-42
src/common/src/tdataformat.c
src/common/src/tdataformat.c
+2
-1
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+35
-36
src/tsdb/src/tsdbBuffer.c
src/tsdb/src/tsdbBuffer.c
+3
-4
未找到文件。
src/common/src/tdataformat.c
浏览文件 @
44d5644c
...
...
@@ -42,7 +42,7 @@ void *tdEncodeSchema(void *buf, STSchema *pSchema) {
STColumn
*
pCol
=
schemaColAt
(
pSchema
,
i
);
buf
=
taosEncodeFixedI8
(
buf
,
colType
(
pCol
));
buf
=
taosEncodeFixedI16
(
buf
,
colColId
(
pCol
));
buf
=
taosEncodeFixedI32
(
buf
,
colBytes
(
pCol
))
:
buf
=
taosEncodeFixedI32
(
buf
,
colBytes
(
pCol
))
;
}
return
buf
;
...
...
@@ -54,6 +54,7 @@ void *tdEncodeSchema(void *buf, STSchema *pSchema) {
void
*
tdDecodeSchema
(
void
*
buf
,
STSchema
**
pRSchema
)
{
int
version
=
0
;
int
numOfCols
=
0
;
STSchemaBuilder
schemaBuilder
;
buf
=
taosDecodeFixedI32
(
buf
,
&
version
);
buf
=
taosDecodeFixedI32
(
buf
,
&
numOfCols
);
...
...
src/inc/taosdef.h
浏览文件 @
44d5644c
...
...
@@ -362,7 +362,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TAOS_QTYPE_WAL 2
#define TAOS_QTYPE_CQ 3
typedef
enum
:
uint8_t
{
typedef
enum
{
TSDB_SUPER_TABLE
=
0
,
// super table
TSDB_CHILD_TABLE
=
1
,
// table created from super table
TSDB_NORMAL_TABLE
=
2
,
// ordinary table
...
...
src/tsdb/inc/tsdbMain.h
浏览文件 @
44d5644c
...
...
@@ -40,26 +40,25 @@ extern int tsdbDebugFlag;
#define TSDB_MAX_TABLE_SCHEMAS 16
#define TSDB_FILE_HEAD_SIZE 512
#define TSDB_FILE_DELIMITER 0xF00AFA0F
#define
// Definitions
// ------------------ tsdbMeta.c
typedef
struct
STable
{
ETableType
type
;
tstr
*
name
;
// NOTE: there a flexible string here
STableId
tableId
;
uint64_t
suid
;
STable
*
pSuper
;
// super table pointer
uint8_t
numOfSchemas
;
STSchema
schema
[
TSDB_MAX_TABLE_SCHEMAS
];
STSchema
*
tagSchema
;
SKVRow
tagVal
;
void
*
pIndex
;
// For TSDB_SUPER_TABLE, it is the skiplist index
void
*
eventHandler
;
// TODO
void
*
streamHandler
;
// TODO
TSKEY
lastKey
;
// lastkey inserted in this table, initialized as 0, TODO: make a structure
char
*
sql
;
void
*
cqhandle
;
ETableType
type
;
tstr
*
name
;
// NOTE: there a flexible string here
STableId
tableId
;
uint64_t
suid
;
struct
STable
*
pSuper
;
// super table pointer
uint8_t
numOfSchemas
;
STSchema
schema
[
TSDB_MAX_TABLE_SCHEMAS
];
STSchema
*
tagSchema
;
SKVRow
tagVal
;
void
*
pIndex
;
// For TSDB_SUPER_TABLE, it is the skiplist index
void
*
eventHandler
;
// TODO
void
*
streamHandler
;
// TODO
TSKEY
lastKey
;
// lastkey inserted in this table, initialized as 0, TODO: make a structure
char
*
sql
;
void
*
cqhandle
;
T_REF_DECLARE
();
}
STable
;
...
...
@@ -149,6 +148,25 @@ typedef struct {
int
direction
;
}
SFileGroupIter
;
// ------------------ tsdbMain.c
typedef
struct
{
int8_t
state
;
char
*
rootDir
;
STsdbCfg
config
;
STsdbAppH
appH
;
STsdbStat
stat
;
STsdbMeta
*
tsdbMeta
;
STsdbBufPool
*
pPool
;
SMemTable
*
mem
;
SMemTable
*
imem
;
STsdbFileH
*
tsdbFileH
;
int
commit
;
pthread_t
commitThread
;
pthread_mutex_t
mutex
;
bool
repoLocked
;
}
STsdbRepo
;
// ------------------ tsdbRWHelper.c
typedef
struct
{
uint32_t
len
;
...
...
@@ -241,24 +259,6 @@ typedef struct {
void
*
compBuffer
;
// Buffer for temperary compress/decompress purpose
}
SRWHelper
;
// ------------------ tsdbMain.c
typedef
struct
{
int8_t
state
;
char
*
rootDir
;
STsdbCfg
config
;
STsdbAppH
appH
;
STsdbStat
stat
;
STsdbMeta
*
tsdbMeta
;
STsdbBufPool
*
pPool
;
SMemTable
*
mem
;
SMemTable
*
imem
;
STsdbFileH
*
tsdbFileH
;
int
commit
;
pthread_t
commitThread
;
pthread_mutex_t
mutex
;
bool
repoLocked
;
}
STsdbRepo
;
// Operations
// ------------------ tsdbMeta.c
...
...
@@ -289,7 +289,7 @@ void tsdbUnRefTable(STable* pTable);
STsdbBufPool
*
tsdbNewBufPool
();
void
tsdbFreeBufPool
(
STsdbBufPool
*
pBufPool
);
int
tsdbOpenBufPool
(
STsdbRepo
*
pRepo
);
int
tsdbOpen
BufPool
(
STsdbRepo
*
pRepo
);
void
tsdbClose
BufPool
(
STsdbRepo
*
pRepo
);
SListNode
*
tsdbAllocBufBlockFromPool
(
STsdbRepo
*
pRepo
);
// ------------------ tsdbMemTable.c
...
...
@@ -333,7 +333,6 @@ void tsdbFreeFileH(STsdbFileH* pFileH);
char
*
tsdbGetMetaFileName
(
char
*
rootDir
);
int
tsdbLockRepo
(
STsdbRepo
*
pRepo
);
int
tsdbUnlockRepo
(
STsdbRepo
*
pRepo
);
void
*
tsdbCommitData
(
void
*
arg
);
#if 0
...
...
src/tsdb/src/tsdbBuffer.c
浏览文件 @
44d5644c
...
...
@@ -86,7 +86,7 @@ int tsdbOpenBufPool(STsdbRepo *pRepo) {
}
tsdbTrace
(
"vgId:%d buffer pool is opened! bufBlockSize:%d tBufBlocks:%d nBufBlocks:%d"
,
REPO_ID
(
pRepo
),
p
BufPool
->
bufBlockSize
,
pBufPool
->
tBufBlocks
,
pBuf
Pool
->
nBufBlocks
);
p
Pool
->
bufBlockSize
,
pPool
->
tBufBlocks
,
p
Pool
->
nBufBlocks
);
return
0
;
...
...
@@ -113,11 +113,10 @@ void tsdbCloseBufPool(STsdbRepo *pRepo) {
}
SListNode
*
tsdbAllocBufBlockFromPool
(
STsdbRepo
*
pRepo
)
{
ASSERT
(
pRepo
!=
NULL
&&
pRepo
->
pool
!=
NULL
);
ASSERT
(
pRepo
!=
NULL
&&
pRepo
->
p
P
ool
!=
NULL
);
ASSERT
(
IS_REPO_LOCKED
(
pRepo
));
STsdbCfg
*
pCfg
=
&
pRepo
->
config
;
STsdbBufPool
*
pBufPool
=
pRepo
->
pool
;
STsdbBufPool
*
pBufPool
=
pRepo
->
pPool
;
while
(
POOL_IS_EMPTY
(
pBufPool
))
{
pthread_cond_wait
(
&
(
pBufPool
->
poolNotEmpty
),
&
(
pRepo
->
mutex
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录