Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Actyx/ipfs-sqlite-block-store
/ functions
Functions
200 in github.com/Actyx/ipfs-sqlite-block-store
⨍
Functions
200
◇
Types & classes
33
↓ 95 callers
Method
ctx
(self, s: &'static str)
src/error.rs:66
↓ 30 callers
Function
in_txn
helper to log execution time of a block of code that returns a result will log at info level if `expected_duration` is exceeded, at warn level if the
src/db.rs:1006
↓ 26 callers
Method
as_ref
(&self)
src/cidbytes.rs:26
↓ 26 callers
Method
cid
(&self)
src/cache/mod.rs:38
↓ 23 callers
Method
put_block
Put a block. This will only be completed once the transaction is successfully committed
src/transaction.rs:180
↓ 19 callers
Method
len
(&self)
src/cidbytes.rs:20
↓ 15 callers
Method
gc
Perform full GC This is the same as running incremental GC without limits, plus a full SQLITE VACUUM.
src/lib.rs:524
↓ 14 callers
Method
alias
( &mut self, name: impl Into<Cow<'b, [u8]>>, link: Option<&'b Cid>, )
src/tests.rs:72
↓ 8 callers
Function
block
creates a simple leaf block
src/tests.rs:156
↓ 8 callers
Function
block
creates a block leaf blocks will be larger than branch blocks
examples/stress.rs:27
↓ 6 callers
Method
alias
Set or delete an alias
src/lib.rs:605
↓ 6 callers
Method
put_blocks
(&mut self, blocks: I, mut pin: Option<&mut TempPin>)
src/lib.rs:662
↓ 5 callers
Method
get_block
Get a block
src/transaction.rs:203
↓ 5 callers
Function
links
creates a block with some links
src/tests.rs:165
↓ 5 callers
Function
pinned
creates a block with the name "pinned-<i>" and a size of 1000
src/tests.rs:198
↓ 5 callers
Method
transaction
(&mut self)
src/lib.rs:485
↓ 5 callers
Function
unpinned
creates a block with the name "unpinned-<i>" and a size of 1000
src/tests.rs:193
↓ 4 callers
Method
incremental_gc
Perform an incremental garbage collection. Will collect unpinned blocks until either the size targets are met again, or at minimum `min_blocks` block
src/lib.rs:559
↓ 4 callers
Method
with_size_targets
Set size targets for the store
src/lib.rs:195
↓ 3 callers
Method
additional_connection
Create another connection to the underlying database This allows you to perform operations in parallel.
src/lib.rs:377
↓ 3 callers
Function
attempt_txn
( mut conn: impl DerefMut<Target = Connection>, f: impl FnOnce(&Transaction) -> crate::Result<T>, )
src/cache/sqlite_tracker.rs:51
↓ 3 callers
Function
get_store_stats
returns the number and size of blocks, excluding orphaned blocks, from the stats table
src/db.rs:235
↓ 3 callers
Method
get_store_stats
Get the stats for the store. The stats are kept up to date, so this is fast.
src/transaction.rs:220
↓ 3 callers
Method
is_memory
(&self)
src/lib.rs:94
↓ 3 callers
Method
with_cache_tracker
Set strategy for which non-pinned blocks to keep in case one of the size targets is exceeded.
src/lib.rs:200
↓ 2 callers
Function
add_temp_pin
(txn: &Transaction, block_id: i64, pin: i64)
src/db.rs:492
↓ 2 callers
Method
backup
(&mut self)
src/tests.rs:59
↓ 2 callers
Function
build_tree
(prefix: &str, branch: u64, depth: u64)
examples/stress.rs:75
↓ 2 callers
Function
cache_test
(tracker: impl CacheTracker + 'static)
src/tests.rs:362
↓ 2 callers
Method
cleanup_temp_pins
Perform maintenance on the TempPins This is done automatically upon every (incremental) GC, so you normally don’t need to call this.
src/lib.rs:504
↓ 2 callers
Method
commit
Commit and consume the transaction. Default is to not commit.
src/transaction.rs:225
↓ 2 callers
Function
delete_id
(txn: &Transaction, id: i64)
src/cache/sqlite_tracker.rs:111
↓ 2 callers
Method
exceeded
(&self, stats: &StoreStats)
src/lib.rs:133
↓ 2 callers
Function
incremental_gc
This is the plan: First figure out in a read transaction which blocks are not referenced; ideally get an iterator for these and stop iterating when e
src/db.rs:274
↓ 2 callers
Function
init_db
(conn: &mut Connection)
src/cache/sqlite_tracker.rs:36
↓ 2 callers
Function
init_pragmas
( conn: &mut Connection, is_memory: bool, cache_pages: i64, )
src/db.rs:776
↓ 2 callers
Method
maybe_checkpoint
(&mut self)
src/lib.rs:538
↓ 2 callers
Function
put_block
( txn: &Transaction, key: &C, data: &[u8], links: impl IntoIterator<Item = C>, mut pin: Op
src/db.rs:519
↓ 2 callers
Method
retain_ids
(&self, ids: &[i64])
src/cache/mod.rs:127
↓ 2 callers
Function
sized
creates a block with a min size
src/tests.rs:174
↓ 2 callers
Method
spawn_blocking
(&self, f: impl FnOnce() + Send + 'static)
examples/cache.rs:50
↓ 2 callers
Method
vacuum
Run a full VACUUM on the SQLITE database This may take a while, blocking all other writes to the store.
src/lib.rs:497
↓ 2 callers
Function
ws
(s: impl AsRef<str>)
src/db.rs:801
↓ 1 callers
Function
alias
( txn: &Transaction, name: &[u8], key: Option<&C>, )
src/db.rs:674
↓ 1 callers
Function
aliases
(txn: &Transaction)
src/db.rs:761
↓ 1 callers
Method
aliases
list all aliases
src/transaction.rs:166
↓ 1 callers
Function
attempt_ro_txn
( mut conn: impl DerefMut<Target = Connection>, f: impl FnOnce(&Transaction) -> crate::Result<T>, )
src/cache/sqlite_tracker.rs:68
↓ 1 callers
Function
block
creates a simple leaf block
tests/stress.rs:152
↓ 1 callers
Method
blocks_accessed
(&self, blocks: Vec<BlockInfo>)
src/cache/mod.rs:107
↓ 1 callers
Method
blocks_deleted
(&self, blocks: Vec<BlockInfo>)
src/cache/mod.rs:119
↓ 1 callers
Method
blocks_written
(&self, blocks: Vec<WriteInfo>)
src/cache/mod.rs:111
↓ 1 callers
Function
build_chain
(prefix: &str, n: usize)
examples/stress.rs:81
↓ 1 callers
Function
build_tree_0
( prefix: &str, branch: u64, depth: u64, blocks: &mut Vec<Block>, )
examples/stress.rs:53
↓ 1 callers
Function
compute_store_stats
returns the number and size of blocks, excluding orphaned blocks, computed from scratch
src/db.rs:182
↓ 1 callers
Function
delete_temp_pin
(txn: &Transaction, pin: i64)
src/db.rs:471
↓ 1 callers
Function
ensure_table
(txn: &Transaction, name: &str, sql: &str)
src/db.rs:818
↓ 1 callers
Function
ensure_tables
(txn: &Transaction, tables: &[(&str, &str)])
src/db.rs:869
↓ 1 callers
Function
extend_temp_pin
( txn: &Transaction, mut id: i64, links: Vec<impl ToSql>, )
src/db.rs:478
↓ 1 callers
Method
flush
(&mut self)
src/lib.rs:464
↓ 1 callers
Function
get_accessed_bulk
( txn: &Transaction, result: &mut FnvHashMap<i64, Option<i64>>, )
src/cache/sqlite_tracker.rs:86
↓ 1 callers
Function
get_block
Get a block
src/db.rs:572
↓ 1 callers
Function
get_descendants
get the descendants of a cid. This just uses the refs table, so it does not ensure that we actually have data for each cid. The value itself is includ
src/db.rs:614
↓ 1 callers
Function
get_ids
(txn: &Transaction)
src/cache/sqlite_tracker.rs:119
↓ 1 callers
Function
get_key
( cache: &mut impl DerefMut<Target = FnvHashMap<i64, T>>, id: i64, )
src/cache/mod.rs:198
↓ 1 callers
Function
get_missing_blocks
get the set of descendants of an id for which we do not have the data yet. The value itself is included. It is safe to call this method for a cid we d
src/db.rs:643
↓ 1 callers
Function
has_block
Check if we have a block
src/db.rs:590
↓ 1 callers
Function
has_cid
Check if we have a cid
src/db.rs:601
↓ 1 callers
Method
has_persistent_state
(&self)
src/cache/mod.rs:123
↓ 1 callers
Function
in_ro_txn
execute a statement in a readonly transaction nested transactions are not allowed here.
src/cache/sqlite_tracker.rs:43
↓ 1 callers
Function
init_db
( conn: &mut Connection, is_memory: bool, cache_pages: i64, synchronous: Synchronous, )
src/db.rs:935
↓ 1 callers
Function
integrity_check
(conn: &mut Connection)
src/db.rs:987
↓ 1 callers
Function
links
creates a block with some links
tests/stress.rs:161
↓ 1 callers
Function
migrate_v0_v1
(txn: &Transaction)
src/db.rs:897
↓ 1 callers
Function
query_roots
(path: &Path)
examples/import.rs:12
↓ 1 callers
Function
recompute_store_stats
recomputes the store stats (should be done at startup to prevent unbounded drift)
src/db.rs:198
↓ 1 callers
Method
resolve
Resolves an alias to a cid
src/lib.rs:614
↓ 1 callers
Method
resolve
(&mut self, name: impl Into<Cow<'b, [u8]>>)
src/tests.rs:86
↓ 1 callers
Function
reverse_alias
( txn: &Transaction, cid: impl ToSql, )
src/db.rs:702
↓ 1 callers
Function
set_accessed
(txn: &Transaction, id: i64, accessed: i64)
src/cache/sqlite_tracker.rs:78
↓ 1 callers
Function
sized
creates a block with a min size
examples/cache.rs:30
↓ 1 callers
Method
sort_ids
(&self, ids: &mut [i64])
src/cache/mod.rs:115
↓ 1 callers
Method
source
(&self)
src/error.rs:45
↓ 1 callers
Method
temp_pin
Get a temporary alias for safely adding blocks to the store
src/lib.rs:490
↓ 1 callers
Method
temp_pin
(&self)
src/tests.rs:68
↓ 1 callers
Function
vacuum
(conn: &mut Connection)
src/db.rs:770
Method
alias
Set or delete an alias
src/transaction.rs:63
Method
backup
(&mut self, path: PathBuf)
src/lib.rs:457
Method
block_exists
true if we had the block already.
src/cache/mod.rs:61
Method
block_len
(&self)
src/cache/mod.rs:41
Method
blocks_accessed
called whenever blocks were accessed note that this method will be called very frequently, on every block access. it is fire and forget, so it is per
src/cache/mod.rs:81
Method
blocks_accessed
(&self, blocks: Vec<BlockInfo>)
src/cache/async_tracker.rs:37
Method
blocks_accessed
(&self, blocks: Vec<BlockInfo>)
src/cache/sqlite_tracker.rs:170
Method
blocks_deleted
called whenever blocks have been deleted by gc.
src/cache/mod.rs:90
Method
blocks_deleted
(&self, blocks: Vec<BlockInfo>)
src/cache/async_tracker.rs:51
Method
blocks_deleted
(&self, blocks: Vec<BlockInfo>)
src/cache/sqlite_tracker.rs:190
Method
blocks_written
called whenever blocks were written note that this method will be called frequently, on every block write. it is fire and forget, so it is perfectly
src/cache/mod.rs:87
Method
blocks_written
(&self, blocks: Vec<WriteInfo>)
src/cache/async_tracker.rs:44
Method
branch
(text: &str, links: impl IntoIterator<Item = Cid>)
src/tests.rs:130
Method
branch
(text: &str, links: impl IntoIterator<Item = Cid>)
tests/stress.rs:143
Method
branch
(text: &str, links: impl IntoIterator<Item = Cid>)
examples/stress.rs:17
next →
1–100 of 200, ranked by callers