Turnstone Operating System
Loading...
Searching...
No Matches
tosdb_internal.h File Reference

tosdb backend interface More...

#include <tosdb/tosdb.h>
#include <future.h>
#include <utils.h>
#include <hashmap.h>
#include <cpu/sync.h>
#include <list.h>
#include <indexer.h>
#include <bloomfilter.h>
#include <set.h>
#include <compression.h>

Classes

struct  tosdb_block_header_t
 tosdb block header More...
 
struct  tosdb_superblock_t
 tosdb super block More...
 
struct  tosdb_block_database_list_item_t
 tosdb database list item More...
 
struct  tosdb_block_database_list_t
 tosdb database list More...
 
struct  tosdb_block_database_t
 tosdb database More...
 
struct  tosdb_block_table_list_item_t
 tosdb table list item More...
 
struct  tosdb_block_table_list_t
 tosdb table list More...
 
struct  tosdb_block_table_t
 tosdb table More...
 
struct  tosdb_block_column_list_item_t
 tosdb column list item More...
 
struct  tosdb_block_column_list_t
 tosdb column list More...
 
struct  tosdb_block_index_list_item_t
 
struct  tosdb_block_index_list_t
 tosdb index list More...
 
struct  tosdb_block_valuelog_t
 tosdb valuelog More...
 
struct  tosdb_block_sstable_list_item_index_pair_t
 tosdb sstable list item index pair More...
 
struct  tosdb_block_sstable_list_item_t
 tosdb sstable list item More...
 
struct  tosdb_block_sstable_list_t
 tosdb sstable list More...
 
struct  tosdb_block_sstable_index_t
 tosdb sstable index More...
 
struct  tosdb_block_sstable_index_data_t
 tosdb sstable index data More...
 
struct  tosdb_t
 tosdb instance More...
 
struct  tosdb_database_t
 
struct  tosdb_table_t
 
struct  tosdb_column_t
 
struct  tosdb_index_t
 
struct  tosdb_memtable_index_item_t
 
struct  tosdb_memtable_secondary_index_item_t
 
struct  tosdb_memtable_index_t
 
struct  tosdb_memtable_t
 
struct  tosdb_record_context_t
 
struct  tosdb_record_key_t
 
struct  tosdb_sequence_t
 

Macros

#define ___TOSDB_TOSDB_INTERNAL_H   0
 
#define TOSDB_PAGE_SIZE   4096
 
#define TOSDB_SUPERBLOCK_SIGNATURE   "TURNSTONE OS DB\0"
 
#define TOSDB_VERSION_MAJOR   0
 
#define TOSDB_VERSION_MINOR   1
 
#define TOSDB_NAME_MAX_LEN   256
 
#define TOSDB_SEQUENCE_TABLE_NAME   ".sequences"
 

Typedefs

typedef enum tosdb_block_type_t tosdb_block_type_t
 
typedef struct tosdb_block_header_t tosdb_block_header_t
 tosdb block header
 
typedef struct tosdb_superblock_t tosdb_superblock_t
 tosdb super block
 
typedef struct tosdb_block_database_list_item_t tosdb_block_database_list_item_t
 tosdb database list item
 
typedef struct tosdb_block_database_list_t tosdb_block_database_list_t
 tosdb database list
 
typedef struct tosdb_block_database_t tosdb_block_database_t
 tosdb database
 
typedef struct tosdb_block_table_list_item_t tosdb_block_table_list_item_t
 tosdb table list item
 
typedef struct tosdb_block_table_list_t tosdb_block_table_list_t
 tosdb table list
 
typedef struct tosdb_block_table_t tosdb_block_table_t
 tosdb table
 
typedef struct tosdb_block_column_list_item_t tosdb_block_column_list_item_t
 tosdb column list item
 
typedef struct tosdb_block_column_list_t tosdb_block_column_list_t
 tosdb column list
 
typedef struct tosdb_block_index_list_item_t tosdb_block_index_list_item_t
 tosdb index list item
 
typedef struct tosdb_block_index_list_t tosdb_block_index_list_t
 tosdb index list
 
typedef struct tosdb_block_valuelog_t tosdb_block_valuelog_t
 tosdb value log
 
typedef struct tosdb_block_sstable_list_item_index_pair_t tosdb_block_sstable_list_item_index_pair_t
 tosdb sstable list item index pair
 
typedef struct tosdb_block_sstable_list_item_t tosdb_block_sstable_list_item_t
 tosdb sstable list item
 
typedef struct tosdb_block_sstable_list_t tosdb_block_sstable_list_t
 tosdb sstable list
 
typedef struct tosdb_block_sstable_index_t tosdb_block_sstable_index_t
 tosdb sstable index
 
typedef struct tosdb_block_sstable_index_data_t tosdb_block_sstable_index_data_t
 tosdb sstable index data
 
typedef struct tosdb_cache_t tosdb_cache_t
 tosdb cache
 
typedef struct tosdb_memtable_t tosdb_memtable_t
 
typedef struct tosdb_column_t tosdb_column_t
 
typedef struct tosdb_index_t tosdb_index_t
 
typedef struct tosdb_memtable_index_item_t tosdb_memtable_index_item_t
 
typedef struct tosdb_memtable_secondary_index_item_t tosdb_memtable_secondary_index_item_t
 
typedef struct tosdb_memtable_index_t tosdb_memtable_index_t
 
typedef struct tosdb_record_context_t tosdb_record_context_t
 
typedef struct tosdb_record_key_t tosdb_record_key_t
 
typedef struct tosdb_sequence_t tosdb_sequence_t
 

Enumerations

enum  tosdb_block_type_t {
  TOSDB_BLOCK_TYPE_NONE , TOSDB_BLOCK_TYPE_SUPERBLOCK , TOSDB_BLOCK_TYPE_DATABASE_LIST , TOSDB_BLOCK_TYPE_DATABASE ,
  TOSDB_BLOCK_TYPE_TABLE_LIST , TOSDB_BLOCK_TYPE_TABLE , TOSDB_BLOCK_TYPE_COLUMN_LIST , TOSDB_BLOCK_TYPE_INDEX_LIST ,
  TOSDB_BLOCK_TYPE_SSTABLE_LIST , TOSDB_BLOCK_TYPE_SSTABLE , TOSDB_BLOCK_TYPE_SSTABLE_INDEX , TOSDB_BLOCK_TYPE_SSTABLE_INDEX_DATA ,
  TOSDB_BLOCK_TYPE_VALUELOG
}
 

Functions

 _Static_assert (((sizeof(tosdb_block_header_t) % 8)==0), "block header size is not aligned")
 
 _Static_assert (sizeof(tosdb_superblock_t)==TOSDB_PAGE_SIZE, "super block size mismatch")
 
boolean_t tosdb_write_and_flush_superblock (tosdb_backend_t *backend, tosdb_superblock_t *sb)
 
uint64_t tosdb_block_write (tosdb_t *tdb, tosdb_block_header_t *block)
 
tosdb_block_header_ttosdb_block_read (tosdb_t *tdb, uint64_t location, uint64_t size)
 
boolean_t tosdb_persist (tosdb_t *tdb)
 
boolean_t tosdb_load_databases (tosdb_t *tdb)
 
boolean_t tosdb_database_persist (tosdb_database_t *db)
 
tosdb_database_ttosdb_database_load_database (tosdb_database_t *db)
 
boolean_t tosdb_database_load_tables (tosdb_database_t *db)
 
boolean_t tosdb_table_persist (tosdb_table_t *tbl)
 
tosdb_table_ttosdb_table_load_table (tosdb_table_t *tbl)
 
boolean_t tosdb_table_load_columns (tosdb_table_t *tbl)
 
boolean_t tosdb_table_load_indexes (tosdb_table_t *tbl)
 
boolean_t tosdb_table_load_sstables (tosdb_table_t *tbl)
 
boolean_t tosdb_table_column_persist (tosdb_table_t *tbl)
 
boolean_t tosdb_table_index_persist (tosdb_table_t *tbl)
 
boolean_t tosdb_table_memtable_persist (tosdb_table_t *tbl)
 
const tosdb_column_ttosdb_table_get_column_by_index_id (tosdb_table_t *tbl, uint64_t id)
 
int8_t tosdb_memtable_index_comparator (const void *i1, const void *i2)
 
int8_t tosdb_memtable_record_id_comparator (const void *i1, const void *i2)
 
int8_t tosdb_memtable_secondary_index_comparator (const void *i1, const void *i2)
 
int8_t tosdb_memtable_secondary_index_record_id_comparator (const void *i1, const void *i2)
 
tosdb_memtable_ttosdb_memtable_new_internal (tosdb_table_t *tbl)
 
boolean_t tosdb_memtable_new (tosdb_table_t *tbl)
 
boolean_t tosdb_memtable_free (tosdb_memtable_t *mt)
 
boolean_t tosdb_memtable_upsert_internal (tosdb_memtable_t *mt, tosdb_record_t *record, boolean_t del, tosdb_memtable_t **mt_out)
 
boolean_t tosdb_memtable_upsert (tosdb_record_t *record, boolean_t del)
 
boolean_t tosdb_memtable_persist (tosdb_memtable_t *mt)
 
boolean_t tosdb_memtable_index_persist (tosdb_memtable_t *mt, tosdb_block_sstable_list_item_t *stli, uint64_t idx, tosdb_memtable_index_t *mt_idx)
 
boolean_t tosdb_memtable_is_deleted (tosdb_record_t *record)
 
data_ttosdb_record_serialize (tosdb_record_t *record)
 
boolean_t tosdb_record_set_data_with_colid (tosdb_record_t *record, const uint64_t col_id, data_type_t type, uint64_t len, const void *value)
 
boolean_t tosdb_record_get_data_with_colid (tosdb_record_t *record, const uint64_t col_id, data_type_t type, uint64_t *len, void **value)
 
boolean_t tosdb_memtable_get (tosdb_record_t *record)
 
boolean_t tosdb_sstable_get (tosdb_record_t *record)
 
boolean_t tosdb_memtable_search (tosdb_record_t *record, set_t *results)
 
boolean_t tosdb_sstable_search (tosdb_record_t *record, set_t *results)
 
list_ttosdb_record_search (tosdb_record_t *record)
 
boolean_t tosdb_record_search_set_destroy_cb (void *item)
 
boolean_t tosdb_database_compact (const tosdb_database_t *db, tosdb_compaction_type_t type)
 
boolean_t tosdb_table_compact (const tosdb_table_t *tbl, tosdb_compaction_type_t type)
 
boolean_t tosdb_sstable_level_minor_compact (const tosdb_table_t *tbl, uint64_t level)
 
boolean_t tosdb_sstable_level_major_compact (const tosdb_table_t *tbl, uint64_t level)
 
int8_t tosdb_record_primary_key_comparator (const void *item1, const void *item2)
 
boolean_t tosdb_table_get_primary_keys_internal (const tosdb_table_t *tbl, set_t *pks, list_t *old_pks)
 

Detailed Description

tosdb backend interface

tosdb internal interface

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.