CS647 Assignment 2 (tinyindex): Add a simple hash-based logical-to-physical translation layer


The goal of this assignment is to write a simple library that provides a dictionary API put(), get(), erase(), scan() by utilizing the tinyblob library.



The assignment:


1. The library


Implement a tinyindex library that provides a dictionary API (put, get, erase, scan). Assume a maximum configurable (compile-time) size for keys and values. Store all (k,v) pairs using your tinyBlob library. Ensure your program closes properly the store at shutdown and starts from an existing store. For tinyindex you can use an API, such as:


int put(char * key,char * value); //Return 0 on success -1 on failure.

char * get(char * key); //Return a buffer filled with the value if key is found, null if key is not found.

int erase(char *key); // Return 0 on success -1 on failure.

scanner_handle_t scan_init(void); // Initialize a scanner, return a pointer to a scanner handle on success NULL on failure.

int get_next(scanner_handle_t * scanner); // Iterate to the next KV, return 0 if handle moved forward or -1 if it reached the end.

char * get_scan_key(scanner_handle_t scanner); // Get a pointer to the current key for this scanner.

char * get_scan_value(scanner_handle_t scanner); // Get a pointer to the current value for this scanner.

int close_scanner(scanner_handle_t scanner); // Release the resources for the scanner.

void persist(char * location); // Store all the key values on the location path.

void recover(char * location); // Restore all the key values stored on the location path.



2. Driver program


Implement a driver program that will create a tinyindex store, and use YCSB to benchmark your implementation. Threads can use synchronous or asynchronous I/O. The driver program will report latency for different patterns, IO sizes, number of threads, number of asynchronous IOs.


Submission 

Turn in (by mail to h y 6 4 7 @ c s d . u o c . g r) a tar file that contains your solutions and a README file stating assumptions or special features.

___________________________________________________________________________________________________________________________________
(c) Copyright University of Crete, Greece, Last Modified: 10-Oct-2022