Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Minibase is a database management system intended for educational use.It has a parser, optimizer, buffer pool manager
- storage mechanisms (heap files, secondary indexes based on B+ Trees), and a disk space management system
- Our role was to implement the underlying layers of the buffer manager , heap files and index structures like the B+ trees.
- After parsing the command and do the optimizations. The index structures helps us to get the records using the buffer manager layer which in turn uses the disk management system.
- // bad documented
- Buffer Manager :
- Main memory is partitioned into collections of pages (buffer pool).
- The buffer pool is organized into frames which can hold a page that is brought in from the disk.
- The buffer manager is responsible for bringing pages from disk to the the buffer pool when they are needed, and writing pages back to the disk when we need a free slots
- (pool if full and we need to get a page from the disk)(also if pages are updated if not updated the page still on the disk so we don’t need to write it .. more overhead).
- The buffer keeps a pin count and dirty flag for each frame (page) in the buffer pool.
- The pin count records the number of times a page has been requested but not released, and the dirty flag records whether the page has been updated or not.
- when the pool is full and the user request a page which is not in the pool. The buffer manager uses a replacement policy to choose pages to be flushed from the buffer pool.
- The strategy used can greatly affect the performance of the system. LRU (least recently used), MRU (most recently used) and Clock are different policies that we use under different conditions.
- say we need to get a program in memory which is 10 page and the pool is 9 page (for sure not true numbers)
- if we use LRU we gonna make 10 reads/writes every sequential scan but if we use MRU we make only 2.
- Heap file :
- A heap file is an unordered set of records. which supports the following operation :
- * Heap files can be created and destroyed.
- * Existing heapfiles can be opened and closed.
- * Records can be inserted and deleted.
- * Records are uniquely identified by a record id (rid). A specific record can be retrieved by using the record id.
- Sequential scans on heap files are also supported. A scan object is created, and get-next calls on this object allow us to retrieve all records starting from the first record.
- A file scan iterator uses a heap file scan, aslo we can apply any desired selections to the retrieved tuples.
- A word on naming: The catalog also names files. It would be best to have a global naming algorithm.
- The heap file is a doubly linked list of pages. each page has a pointer to the next and previous pages. During insertion and deletion we iterate through the pages.
- each page referenced we ask the buffer manager to pin it so that it remains in the buffer pool or it will bring it if it is not there.
- generally speaking , heapfile is not the best implementation of data records organization.
- When we want to insert a record we will simply scan the pages until we find a one that has enough space . If a page becomes emty this page can be deallocated .
- B+ Tree :
- B+ Tree index consists of a collection of records of the form (key, record_id)
- B+ Tree nodes can be divided into two categories: 1-Internal Nodes (pageids of their childrens & search value). 2-leaf nodes (actual key & record_id).
- we supported insert/modify/delete operation, aslo we supported scan and partially scan (range).
- we also maintaining the integrity of the tree when an insertion is made, it has to ensure that the new record is inserted in the correct place,
- or if a new entry is added to an index node,it has to ensure that there is sufficient room in the index node to hold the new entry,
- and splitting or merging nodes when they become too full or too empty)
- each leaf node has a getnext and get prev pointers (for sequential scan).
- Insertion:
- we keep searching through the tree. we are guided by the values in each node. each node has a set of pairs of values and data pointers which points to
- other pages (each node represents a page) . when we reach the leaf node , we insert in it , if it is full the leaf node is split into two leaf pages and an intermediate
- value is pushed up to the parent node to guide the search. if the parent is also full, the spliting will propagate through the tree.
- Deletion:
- we search through the tree in order to find what we want to delete.if found we delete this entry in the leaf node,
- Howver this may make the leaf node nearly empty and so we has to re-distribute the entries such that each node is at least half full.
- we search for these entries in the sibling nodes. if this is not possible and both nodes will be nearly empty we merge them into one node.
- so we will need to reduce the number of guiding values in the parent node which also may make it less than half full and so the merging may propagate.
- Circus of Plates:
- It is two players game in which every player carry two stacks of plates, and there are a set of colored plates queues that fall down and he tries to catch them.
- if he manage to collect three consecutive plates of the same color, then they are vanished and his score increases, the player who get more score at less time wins.
- You are free to put rules to handle if the two players stand at the same place, also you can modify the rules of ending the game.
- we used many design pattern like Factory, Singleton, MVC, Object Pool, Iterator, Dynamic Linkage, Snap-shot, State and Observer.
- x
- SIC\XE:
- The term project is to implement a (cross) assembler for (a subset of) SIC/XE assembler,
- written in C/C++, producing code for the programming assignments.
- In phase 1 of the project, it is required to implement Pass1 of the assembler. The output of this phase should be used as input for subsequent phases. This handles the addressing and Program counters.
- In phase 2 of the project, you are going to build on the previous phase and use its output to produce the Object code used by the absolute loader/linker.
- Pass 1
- Assign addresses (LOC) to all statements in the program
- Save the values assigned to all labels for use in Pass 2
- Perform some processing of assembler directives
- Pass 2
- Assemble instructions
- Generate data values defined by BYTE, WORD
- Perform processing of assembler directives not done in Pass 1
- Write the object program and the assembly listing
- when can we say that code is healthy? When it is easy to modify or improve, without affecting other parts of the system in a negative way.
- How can we achieve healthy code? By keeping it clean, flexible and readable.
- why testing ? challenging tasks, it will improve creativity as well as thinking power and it will improve descipline.
- I get to see the bigger picture.. I get to code too.Software testing is as interesting as the job of a detective.
- It is satisfying when you help find, and resolve, critical bugs.I get to be creative.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement