class Storage::KeyValueStore
- Storage::KeyValueStore
- Reference
- Object
Defined in:
storage/kv.crstorage/migrations.cr
Constant Summary
-
HARD_DURABILITY =
RocksDB::WriteOptions.new
-
Hard durability: data is written on disk always. This is the default and this is paranoic. No data will be lost, ever.
-
MINIMAL_DURABILITY =
RocksDB::WriteOptions.new
-
Minimal durability: data it stored in memory only and flushed to disk at some later point. A process crash might cause data loss. A graceful server close (calling .close()) won't lose data. Note: The data might be lost, but it won't be corrupted. This is the fastest option.
-
PREFIX_DATABASES =
1_u8
-
PREFIX_INDICES =
3_u8
-
PREFIX_SYSTEM_INFO =
0_u8
-
PREFIX_TABLES =
2_u8
-
SOFT_DURABILITY =
RocksDB::WriteOptions.new
-
Soft durability: data is sent to the operating system memory and will be synced to disk later. Only a kernel panic or hardware failure might cause data loss. Crashing the process won't lose any data.
Constructors
Class Method Summary
- .decompose_index_entry_key(index_entry_key : Bytes)
- .key_for_database(id : UUID)
- .key_for_system_info
- .key_for_table(id : UUID)
- .key_for_table_index(table_id : UUID, index_id : UUID)
- .key_for_table_index_end(table_id : UUID)
- .key_for_table_index_entry(index_value : Bytes, counter : Int32, primary_key : Bytes)
- .key_for_table_index_entry_end(index_value : Bytes)
- .key_for_table_index_entry_start(index_value : Bytes)
- .key_for_table_index_start(table_id : UUID)
Instance Method Summary
- #build_index(table_id : UUID, index_id : UUID, &)
- #close
- #create_batch
- #database_path : String
- #delete_index_entry(table_id : UUID, index_id : UUID, index_value : Bytes, counter : Int32, primary_key : Bytes)
- #delete_row(table_id : UUID, primary_key : Bytes, durability : ReQL::Durability = ReQL::Durability::Soft) : Bytes | Nil
- #drop_index_data(index_id : UUID)
- #each_db(&)
- #each_index(table_id : UUID, &)
- #each_index_entry(table_id : UUID, index_id : UUID, index_value_start : Bytes, index_value_end : Bytes, snapshot : RocksDB::BaseSnapshot | Nil = nil, &)
- #each_row(table_id : UUID, &)
- #each_table(&)
- #estimated_table_count(table_id : UUID)
- #get_db(id : UUID)
- #get_row(table_id : UUID, primary_key : Bytes, snapshot : RocksDB::BaseSnapshot | Nil = nil, &)
- #get_table(id : UUID)
- #save_db(db : DatabaseInfo)
- #save_index(index : IndexInfo)
- #save_table(table : TableInfo)
- #set_index_entry(table_id : UUID, index_id : UUID, index_value : Bytes, counter : Int32, primary_key : Bytes)
- #set_row(table_id : UUID, primary_key : Bytes, data : Bytes, durability : ReQL::Durability = ReQL::Durability::Soft)
- #snapshot
- #system_info : Storage::KeyValueStore::SystemInfo
- #system_info=(system_info : Storage::KeyValueStore::SystemInfo)
- #table_data_family(table_id : UUID)
- #table_index_family(index_id : UUID)
- #write_batch(batch, durability : ReQL::Durability = ReQL::Durability::Soft)
Instance methods inherited from class Object
!=(other : RethinkDB::DSL::R)
!=,
%(other : RethinkDB::DSL::R)
%,
&(other : RethinkDB::DSL::R)
&,
*(other : RethinkDB::DSL::R)
*,
+(other : RethinkDB::DSL::R)
+,
-(other : RethinkDB::DSL::R)
-,
/(other : RethinkDB::DSL::R)
/,
<(other : RethinkDB::DSL::R)
<,
<=(other : RethinkDB::DSL::R)
<=,
==(other : RethinkDB::DSL::R)
==,
>(other : RethinkDB::DSL::R)
>,
>=(other : RethinkDB::DSL::R)
>=,
|(other : RethinkDB::DSL::R)
|
Constructor Detail
Class Method Detail
Instance Method Detail
def delete_index_entry(table_id : UUID, index_id : UUID, index_value : Bytes, counter : Int32, primary_key : Bytes)
#
def delete_row(table_id : UUID, primary_key : Bytes, durability : ReQL::Durability = ReQL::Durability::Soft) : Bytes | Nil
#
def each_index_entry(table_id : UUID, index_id : UUID, index_value_start : Bytes, index_value_end : Bytes, snapshot : RocksDB::BaseSnapshot | Nil = nil, &)
#
def get_row(table_id : UUID, primary_key : Bytes, snapshot : RocksDB::BaseSnapshot | Nil = nil, &)
#
def set_index_entry(table_id : UUID, index_id : UUID, index_value : Bytes, counter : Int32, primary_key : Bytes)
#
def set_row(table_id : UUID, primary_key : Bytes, data : Bytes, durability : ReQL::Durability = ReQL::Durability::Soft)
#