MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / reopen

Function reopen

crates/commitlog/src/commitlog.rs:1384–1406  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1382
1383 #[test]
1384 fn reopen() {
1385 let mut log = mem_log::<[u8; 32]>(1024);
1386 let total_txs = fill_log(&mut log, 100, (1..=10).cycle());
1387 assert_eq!(
1388 total_txs,
1389 log.transactions_from(0, &ArrayDecoder).map(Result::unwrap).count()
1390 );
1391
1392 let mut log = Generic::<_, [u8; 32]>::open(
1393 log.repo.clone(),
1394 Options {
1395 max_segment_size: 1024,
1396 ..Options::default()
1397 },
1398 )
1399 .unwrap();
1400 let total_txs = fill_log(&mut log, 100, (1..=10).cycle());
1401
1402 assert_eq!(
1403 total_txs,
1404 log.transactions_from(0, &ArrayDecoder).map(Result::unwrap).count()
1405 );
1406 }
1407
1408 #[test]
1409 fn set_new_epoch() {

Callers

nothing calls this directly

Calls 4

fill_logFunction · 0.50
openFunction · 0.50
unwrapMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…