Skip to content

fangyoujun/cmu-15445

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • Project #1 BUFFER POOL MANAGER

    Key member data :

    • *pages_ : array of Page with array size of pool_size. A Page is a in-memory block that could be either free, or contains some contents read from disk. A content is identified by page_id. A Page could contains different contents (i.e. different page_id) at different time. If a in-Page content is accessed by a thread, then say it is pinned; and pin_count is incremented by 1. If the content is overwritten in memory, it is said dirty.
    • *page_table_ : pointer to a hash table, who records page_id - Page* KV pair. When a thread want to access to certain page, it always firstly check whether the page exit in page_table or not. If not, then ask disk_manager_ to copy the page content to some replacement, where replacement is either: free page in *free_list_, or victim page in *replacer_. (The implementation of hash table is of Task #1 of this project).
    • *free_list_ : list of Page that are free to be newly referenced to some contents
    • *replacer_ : LRU replacer, who tracks all the pages that are not being accessed by any thread (i.e. pin_count == 0). A page in LRU replacer could be used for containing new contents, but if the page is marked as dirty, the old contents should be written back to disk (by disk_manager_) before associating with new contents. (The implementation of LRUReplacer is of Task #2 of this project).

    Key methods:

    • FetchPage(page_id) : look for a page in page_table_, if no exit then make a replacement page that referenced to given page_id. The replacement page either pop from *free_list, or if *free_list is empty, sacrify a victim page in *replacer_ and make it the replacement.
    • NewPage(page_id) and DeletePage(page_id) : ask disk_manager_ to allocate / deallocate new page in disk
    • FlushPage(page_id) : write the content from in-memory page to disk
    • UnpinPage(page_id, is_dirty): if a thread finish accessing a page, then unpin it (pin_count--) and if the thread has written to the content, set is_dirty flag to be true.

  • Project #2

  • Project #3

  • Project #4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published