Turnstone Operating System
Loading...
Searching...
No Matches
tosdb_table.64.c File Reference

tosdb table interface implementation More...

#include <tosdb/tosdb.h>
#include <tosdb/tosdb_internal.h>
#include <logging.h>
#include <strings.h>

Functions

 MODULE ("turnstone.kernel.db")
 
const tosdb_column_ttosdb_table_get_column_by_index_id (tosdb_table_t *tbl, uint64_t id)
 
boolean_t tosdb_table_load_sstables (tosdb_table_t *tbl)
 
boolean_t tosdb_table_load_indexes (tosdb_table_t *tbl)
 
boolean_t tosdb_table_load_columns (tosdb_table_t *tbl)
 
tosdb_table_ttosdb_table_load_table (tosdb_table_t *tbl)
 
tosdb_table_ttosdb_table_create_or_open (tosdb_database_t *db, const char_t *name, uint64_t max_record_count, uint64_t max_valuelog_size, uint64_t max_memtable_count)
 creates new table More...
 
boolean_t tosdb_table_close (tosdb_table_t *tbl)
 closes a table More...
 
boolean_t tosdb_table_free (tosdb_table_t *tbl)
 frees a table More...
 
boolean_t tosdb_table_index_persist (tosdb_table_t *tbl)
 
boolean_t tosdb_table_column_persist (tosdb_table_t *tbl)
 
boolean_t tosdb_table_persist (tosdb_table_t *tbl)
 
boolean_t tosdb_table_column_add (tosdb_table_t *tbl, const char_t *colname, data_type_t type)
 adds a cloumn to given table More...
 
boolean_t tosdb_table_index_create (tosdb_table_t *tbl, const char_t *colname, tosdb_index_type_t type)
 creates an index on table More...
 
boolean_t tosdb_table_memtable_persist (tosdb_table_t *tbl)
 
set_ttosdb_table_get_primary_keys (tosdb_table_t *tbl)
 get all primary keys in terms of record More...
 

Detailed Description

tosdb table interface implementation

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

Function Documentation

◆ tosdb_table_close()

boolean_t tosdb_table_close ( tosdb_table_t tbl)

closes a table

Parameters
[in]tblthe table to close
Returns
true if succeed.

◆ tosdb_table_column_add()

boolean_t tosdb_table_column_add ( tosdb_table_t tbl,
const char_t colname,
data_type_t  type 
)

adds a cloumn to given table

Parameters
[in]tbltable interface
[in]colnamecloumn name
[in]columntype
Returns
true if succeed.

◆ tosdb_table_create_or_open()

tosdb_table_t * tosdb_table_create_or_open ( tosdb_database_t db,
const char_t name,
uint64_t  max_record_count,
uint64_t  max_valuelog_size,
uint64_t  max_memtable_count 
)

creates new table

Parameters
[in]dbdatabase interface
[in]nametable name
[in]max_record_countmaximum record count at each memtable/sstable
[in]max_valuelog_sizemaximum valuelog size
[in]max_memtable_countmaximum memtable count at memory
Returns
a new table or existing one

◆ tosdb_table_free()

boolean_t tosdb_table_free ( tosdb_table_t tbl)

frees a table

Parameters
[in]tblthe table to close
Returns
true if succeed.

◆ tosdb_table_get_primary_keys()

set_t * tosdb_table_get_primary_keys ( tosdb_table_t tbl)

get all primary keys in terms of record

Parameters
[in]tbltable
Returns
set of record with only contains primary key

◆ tosdb_table_index_create()

boolean_t tosdb_table_index_create ( tosdb_table_t tbl,
const char_t colname,
tosdb_index_type_t  type 
)

creates an index on table

Parameters
[in]tbltable interface
[in]colnameindex column name
[in]typeindex type
Returns
true if succeed.