An extended fork of SimpleDB (http://www.cs.bc.edu/~sciore/simpledb/).
Team Member | Unity Id |
---|---|
Dustin Lambright | dalambri |
Guanxu Yu | gyu9 |
Darshan Bhandari | dbhanda |
Leonard Kerr | lwkerr |
Yuchen Sun | ysun34 |
- Updated such that the buffermanager is initialized before the log manager so that the log manager can use the buffer manager to pin blocks.
Changed all methods to now use buffers from the buffer manager instead of pages.
- This is the optional print method to view the changes made to the pinned block
This is a new class which implements PageFormatter to satisfy the need for a PageFormatter in the pinNew method. This is essentially an empty class.
- Add
private long lastAccessTime
andsecLastAccessTime
to record last/second last access time of a buffer.
- This is a wrapper method to get the contents of the pinned block for the printLogPageBuffer() method
- Update access time of buffer when buffer is pinned
- Get last access time of a buffer
- Get second last access time of a buffer
- Reset last/second last access time to infinity when a buffer is chosen to replace
- This is the constructor of BasicBufferMgr class. Since we changed the bufferpoll into map, so we changed how bufferpool initialized at constructor.
- Rewrite this method to fit map structure
- Rewrite this method to fit map structure and update buffer access time
- Rewrite this method to fit map structure and update buffer access time
- Used for testing
- Used for testing
- Returns the buffer that the map maps the specified block to.
- Returns the buffer that is unpinned. Change function to work with map
- Choose replacing buffer based on LRU (K=2) policy
- LRU (K=2) policy, take a list of candidate buffers, return chosen one by LRU
-
in lines DUZN and DUZN of LogMgr.java we have hard-coded print statements for the pinned block to prove functionality before and after flush. If you want to avoid these statements, feel free to comment them out.
-
We've written TestLogMgr to show the use of pinned blocks. If you run TestLogMgr many times, you will see that the block pinned to the buffer increases (Displayed like so: Buffer number pinned to the log block: 14)
- In TestBufferMgr.java file, we already setup testcase for Buffer Manager. And also we add comments and hard-code print statements to indicate what our testcase looks like. You just need to run it and see the result.