more TDB
This commit is contained in:
parent
3989a061c6
commit
e0e9f088c4
|
@ -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;
|
||||||
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 {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,3 +48,8 @@ SPgFile *tdbEnvGetPageFile(TENV *pEnv, const uint8_t fileid[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SPgCache *tdbEnvGetPgCache(TENV *pEnv) { return &(pEnv->pgc); }
|
SPgCache *tdbEnvGetPgCache(TENV *pEnv) { return &(pEnv->pgc); }
|
||||||
|
|
||||||
|
static int tdbEnvDestroy(TENV *pEnv) {
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue