This commit is contained in:
Hongze Cheng 2022-02-09 15:02:38 +00:00
parent 3989a061c6
commit e0e9f088c4
3 changed files with 37 additions and 5 deletions

View File

@ -13,16 +13,33 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "meta.h"
#include "metaDef.h"
#include "tdb.h"
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) {
// TODO
SMetaDB *pDb;
pDb = (SMetaDB *)calloc(1, sizeof(*pDb));
if (pDb == NULL) {
return -1;
}
pMeta->pDB = pDb;
return 0;
}

View File

@ -27,6 +27,7 @@ typedef struct STDbEnv TENV;
typedef struct STDbCurosr TDBC;
// TEVN
int tdbEnvCreate(TENV **ppEnv);
int tdbEnvOpen(TENV **ppEnv);
int tdbEnvClose(TENV *pEnv);

View File

@ -23,13 +23,22 @@ struct STDbEnv {
SPgCache pgc; // page cache
};
static int tdbEnvDestroy(TENV *pEnv);
int tdbEnvCreate(TENV **ppEnv) {
// TODO
return 0;
}
int tdbEnvOpen(TENV **ppEnv) {
// TODO
return 0;
}
int tdbEnvClose(TENV *pEnv) {
// TODO
if (pEnv == NULL) return 0;
/* TODO */
tdbEnvDestroy(pEnv);
return 0;
}
@ -39,3 +48,8 @@ SPgFile *tdbEnvGetPageFile(TENV *pEnv, const uint8_t fileid[]) {
}
SPgCache *tdbEnvGetPgCache(TENV *pEnv) { return &(pEnv->pgc); }
static int tdbEnvDestroy(TENV *pEnv) {
// TODO
return 0;
}