提交 211b6ad4 编写于 作者: H Hongze Cheng

more TDB

上级 6d446e61
...@@ -122,7 +122,7 @@ int pgCacheClose(SPgCache *pPgCache) { ...@@ -122,7 +122,7 @@ int pgCacheClose(SPgCache *pPgCache) {
return 0; return 0;
} }
SPage *pgCacheFetch(SPgCache *pPgCache) { SPage *pgCacheFetch(SPgCache *pPgCache, pgid_t pgid) {
// TODO // TODO
return NULL; return NULL;
} }
......
...@@ -13,4 +13,30 @@ ...@@ -13,4 +13,30 @@
* 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 "tdbInt.h" #include "tdbInt.h"
\ No newline at end of file
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;
}
\ No newline at end of file
...@@ -25,11 +25,11 @@ typedef struct SPage SPage; ...@@ -25,11 +25,11 @@ typedef struct SPage SPage;
// SPgCache // SPgCache
int pgCacheCreate(SPgCache **ppPgCache, pgsize_t pgSize, int32_t npage); int pgCacheCreate(SPgCache **ppPgCache, pgsize_t pgSize, int32_t npage);
int pgCacheDestroy(SPgCache *pPgCache);
int pgCacheOpen(SPgCache **ppPgCache); int pgCacheOpen(SPgCache **ppPgCache);
int pgCacheClose(SPgCache *pPgCache); int pgCacheClose(SPgCache *pPgCache);
int pgCacheClose(SPgCache *pPgCache);
SPage *pgCacheFetch(SPgCache *pPgCache); SPage *pgCacheFetch(SPgCache *pPgCache, pgid_t pgid);
int pgCacheRelease(SPage *pPage); int pgCacheRelease(SPage *pPage);
// SPage // SPage
......
...@@ -21,12 +21,22 @@ extern "C" { ...@@ -21,12 +21,22 @@ extern "C" {
#endif #endif
typedef struct SPgFile SPgFile; typedef struct SPgFile SPgFile;
struct SPgFile { struct SPgFile {
char * fname; // backend file name char * fname; // backend file name
SPgCache *pPgCache; // page cache underline 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 #ifdef __cplusplus
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册