more TDB
This commit is contained in:
parent
6d446e6134
commit
211b6ad47c
|
@ -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 @@
|
||||||
* 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"
|
||||||
|
|
||||||
|
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
|
// 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" {
|
||||||
#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
|
||||||
|
|
Loading…
Reference in New Issue