more TDB
This commit is contained in:
parent
6d446e6134
commit
211b6ad47c
|
@ -122,7 +122,7 @@ int pgCacheClose(SPgCache *pPgCache) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPage *pgCacheFetch(SPgCache *pPgCache) {
|
||||
SPage *pgCacheFetch(SPgCache *pPgCache, pgid_t pgid) {
|
||||
// TODO
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -14,3 +14,29 @@
|
|||
*/
|
||||
|
||||
#include "tdbInt.h"
|
||||
|
||||
int pgFileOpen(const char *fname, SPgCache *pPgCache, SPgFile **ppPgFile) {
|
||||
SPgFile *pPgFile;
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pgFileClose(SPgFile *pPgFile) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
SPage *pgFileFetch(SPgFile *pPgFile, pgno_t pgno) {
|
||||
// TODO
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int pgFileRelease(SPage *pPage) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pgFileWrite(SPage *pPage) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
|
@ -25,11 +25,11 @@ typedef struct SPage SPage;
|
|||
|
||||
// SPgCache
|
||||
int pgCacheCreate(SPgCache **ppPgCache, pgsize_t pgSize, int32_t npage);
|
||||
int pgCacheDestroy(SPgCache *pPgCache);
|
||||
int pgCacheOpen(SPgCache **ppPgCache);
|
||||
int pgCacheClose(SPgCache *pPgCache);
|
||||
int pgCacheClose(SPgCache *pPgCache);
|
||||
|
||||
SPage *pgCacheFetch(SPgCache *pPgCache);
|
||||
SPage *pgCacheFetch(SPgCache *pPgCache, pgid_t pgid);
|
||||
int pgCacheRelease(SPage *pPage);
|
||||
|
||||
// SPage
|
||||
|
|
|
@ -21,12 +21,22 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
typedef struct SPgFile SPgFile;
|
||||
|
||||
struct SPgFile {
|
||||
char * fname; // backend file name
|
||||
uint8_t fileid[TDB_FILE_ID_LEN]; // file id
|
||||
SPgCache *pPgCache; // page cache underline
|
||||
int fd;
|
||||
pgno_t pgFileSize;
|
||||
};
|
||||
|
||||
int pgFileOpen(const char *fname, SPgCache *pPgCache, SPgFile **ppPgFile);
|
||||
int pgFileClose(SPgFile *pPgFile);
|
||||
|
||||
SPage *pgFileFetch(SPgFile *pPgFile, pgno_t pgno);
|
||||
int pgFileRelease(SPage *pPage);
|
||||
|
||||
int pgFileWrite(SPage *pPage);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue