Is there any library that provides a disk-based B + -tree implementation specifically designed for a scenario in which all keys have a fixed size and all values have a fixed size (not necessarily the same fixed size as the keys)
Note: Yes, I want to implement another toy, RDBMS with proof of concept. And a very good reason why I do not use SQL DBMS. The end of the note.
I especially don't like the language the library is written in. However, I have some specific requirements regarding the functionality of the library. For clarity, these requirements will be illustrated by examples written in C.
The library must be flexible enough so that I can use my own comparison function. For instance:
struct comparer { void * extra; int (*function)( void *,
The mechanism for managing the index file is determined by a fixed length for all keys, a fixed length for all values, and a comparison function for keys. For instance:
struct index_spec { size_t keylen, vallen; // fixed lengths for keys and values struct comparer comp; // comparison function for keys };
It would be very nice to touch (although not necessarily) if the library has established the difference between queries and updated indexes and the mechanism for using the updated index when the expected request is expected, but not vice versa. For instance:
struct queryable_index { struct index_spec spec; FILE * file; // opened in read mode }; struct updateable_index { struct index_spec spec; FILE * file; // opened in read/write mode }; struct queryable_index open_queryable_index (struct index_spec, const char *); struct updateable_index open_updateable_index (struct index_spec spec, const char * filename); struct queryable_index just_queryable_index (struct updateable_index index) { struct queryable_index result; result.spec = index.spec; result.file = index.file; return result; }
source share