提交 e0e9f088 编写于 作者: H Hongze Cheng

more TDB

上级 3989a061
...@@ -13,16 +13,33 @@ ...@@ -13,16 +13,33 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "meta.h" #include "metaDef.h"
#include "tdb.h" #include "tdb.h"
struct SMetaDB { struct SMetaDB {
// TODO TENV *pEnv;
TDB * pTbDB;
TDB * pSchemaDB;
TDB * pNameIdx;
TDB * pStbIdx;
TDB * pNtbIdx;
TDB * pCtbIdx;
// tag index hash table
// suid+colid --> TDB *
struct {
} tagIdxHt;
}; };
int metaOpenDB(SMeta *pMeta) { int metaOpenDB(SMeta *pMeta) {
// TODO SMetaDB *pDb;
pDb = (SMetaDB *)calloc(1, sizeof(*pDb));
if (pDb == NULL) {
return -1;
}
pMeta->pDB = pDb;
return 0; return 0;
} }
......
...@@ -27,6 +27,7 @@ typedef struct STDbEnv TENV; ...@@ -27,6 +27,7 @@ typedef struct STDbEnv TENV;
typedef struct STDbCurosr TDBC; typedef struct STDbCurosr TDBC;
// TEVN // TEVN
int tdbEnvCreate(TENV **ppEnv);
int tdbEnvOpen(TENV **ppEnv); int tdbEnvOpen(TENV **ppEnv);
int tdbEnvClose(TENV *pEnv); int tdbEnvClose(TENV *pEnv);
......
...@@ -23,13 +23,22 @@ struct STDbEnv { ...@@ -23,13 +23,22 @@ struct STDbEnv {
SPgCache pgc; // page cache SPgCache pgc; // page cache
}; };
static int tdbEnvDestroy(TENV *pEnv);
int tdbEnvCreate(TENV **ppEnv) {
// TODO
return 0;
}
int tdbEnvOpen(TENV **ppEnv) { int tdbEnvOpen(TENV **ppEnv) {
// TODO // TODO
return 0; return 0;
} }
int tdbEnvClose(TENV *pEnv) { int tdbEnvClose(TENV *pEnv) {
// TODO if (pEnv == NULL) return 0;
/* TODO */
tdbEnvDestroy(pEnv);
return 0; return 0;
} }
...@@ -38,4 +47,9 @@ SPgFile *tdbEnvGetPageFile(TENV *pEnv, const uint8_t fileid[]) { ...@@ -38,4 +47,9 @@ SPgFile *tdbEnvGetPageFile(TENV *pEnv, const uint8_t fileid[]) {
return NULL; return NULL;
} }
SPgCache *tdbEnvGetPgCache(TENV *pEnv) { return &(pEnv->pgc); } SPgCache *tdbEnvGetPgCache(TENV *pEnv) { return &(pEnv->pgc); }
\ No newline at end of file
static int tdbEnvDestroy(TENV *pEnv) {
// TODO
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.
先完成此消息的编辑!
想要评论请 注册