Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1984f403
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看板
提交
1984f403
编写于
11月 02, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact
上级
e9bf4fce
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
52 addition
and
31 deletion
+52
-31
source/dnode/vnode/meta/inc/metaDef.h
source/dnode/vnode/meta/inc/metaDef.h
+2
-2
source/dnode/vnode/meta/src/metaCommit.c
source/dnode/vnode/meta/src/metaCommit.c
+7
-0
source/dnode/vnode/meta/src/metaMain.c
source/dnode/vnode/meta/src/metaMain.c
+30
-28
source/dnode/vnode/meta/src/metaTable.c
source/dnode/vnode/meta/src/metaTable.c
+13
-1
未找到文件。
source/dnode/vnode/meta/inc/metaDef.h
浏览文件 @
1984f403
...
...
@@ -25,9 +25,9 @@ extern "C" {
struct
SMeta
{
char
*
path
;
// path of current meta
STbUidGenerator
uidGenerator
;
// meta table UID generator
SMetaDB
*
pMetaDB
;
// meta DB for real storage engine
SMetaOptions
options
;
// meta option
SMetaDB
*
pMetaDB
;
// meta DB for real storage engine
STbUidGenerator
uidGenerator
;
// meta table UID generator
};
#ifdef __cplusplus
...
...
source/dnode/vnode/meta/src/metaCommit.c
浏览文件 @
1984f403
...
...
@@ -12,3 +12,10 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "meta.h"
int
metaCommit
(
SMeta
*
pMeta
)
{
// TODO
return
0
;
}
\ No newline at end of file
source/dnode/vnode/meta/src/metaMain.c
浏览文件 @
1984f403
...
...
@@ -16,9 +16,9 @@
#include "tcoding.h"
#include "meta.h"
#include "metaDB.h"
#include "metaDef.h"
#include "metaOptions.h"
#include "metaDB.h"
static
SMeta
*
metaNew
(
const
char
*
path
,
const
SMetaOptions
*
pMetaOptions
);
static
void
metaFree
(
SMeta
*
pMeta
);
...
...
@@ -57,6 +57,8 @@ SMeta *metaOpen(const char *path, const SMetaOptions *pMetaOptions) {
return
NULL
;
}
tableUidGeneratorInit
(
&
(
pMeta
->
uidGenerator
),
IVLD_TB_UID
);
return
pMeta
;
}
...
...
@@ -68,33 +70,7 @@ void metaClose(SMeta *pMeta) {
}
}
#if 0
int metaCreateTable(SMeta *pMeta, const STableOptions *pTableOpts) {
size_t vallen;
char * pUid;
// Check if table already exists
pUid = tkvGet(pMeta->tbnameDb, NULL, pTableOpts->name, strlen(pTableOpts->name), &vallen);
if (pUid) {
free(pUid);
// Table already exists, return error code
return -1;
}
switch (pTableOpts->type) {
case META_SUPER_TABLE:
return metaCreateSuperTable(pMeta, pTableOpts->name, &(pTableOpts->superOpts));
case META_CHILD_TABLE:
return metaCreateChildTable(pMeta, pTableOpts->name, &(pTableOpts->childOpts));
case META_NORMAL_TABLE:
return metaCreateNormalTable(pMeta, pTableOpts->name, &(pTableOpts->normalOpts));
default:
ASSERT(0);
}
return 0;
}
#endif
void
metaRemove
(
const
char
*
path
)
{
taosRemoveDir
(
path
);
}
/* ------------------------ STATIC METHODS ------------------------ */
static
SMeta
*
metaNew
(
const
char
*
path
,
const
SMetaOptions
*
pMetaOptions
)
{
...
...
@@ -125,6 +101,32 @@ static void metaFree(SMeta *pMeta) {
// OLD -------------------------------------------------------------------
#if 0
int metaCreateTable(SMeta *pMeta, const STableOptions *pTableOpts) {
size_t vallen;
char * pUid;
// Check if table already exists
pUid = tkvGet(pMeta->tbnameDb, NULL, pTableOpts->name, strlen(pTableOpts->name), &vallen);
if (pUid) {
free(pUid);
// Table already exists, return error code
return -1;
}
switch (pTableOpts->type) {
case META_SUPER_TABLE:
return metaCreateSuperTable(pMeta, pTableOpts->name, &(pTableOpts->superOpts));
case META_CHILD_TABLE:
return metaCreateChildTable(pMeta, pTableOpts->name, &(pTableOpts->childOpts));
case META_NORMAL_TABLE:
return metaCreateNormalTable(pMeta, pTableOpts->name, &(pTableOpts->normalOpts));
default:
ASSERT(0);
}
return 0;
}
static int metaCreateSuperTable(SMeta *pMeta, const char *tbname, const SSuperTableOpts *pSuperTableOpts) {
size_t vallen;
size_t keylen;
...
...
source/dnode/vnode/meta/src/metaTable.c
浏览文件 @
1984f403
...
...
@@ -11,4 +11,16 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
\ No newline at end of file
*/
#include "meta.h"
int
metaCreateTable
(
SMeta
*
pMeta
,
const
STableOptions
*
pTbOptions
)
{
// TODO
return
0
;
}
int
metaDropTable
(
SMeta
*
pMeta
,
tb_uid_t
uid
)
{
// TODO
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录