MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / open_dwb_for

Function open_dwb_for

nodedb-wal/src/writer.rs:81–102  ·  view source on GitHub ↗
(
    config: &WalWriterConfig,
    path: &Path,
)

Source from the content-addressed store, hash-verified

79}
80
81fn open_dwb_for(
82 config: &WalWriterConfig,
83 path: &Path,
84) -> Option<crate::double_write::DoubleWriteBuffer> {
85 let mode = resolve_dwb_mode(config);
86 if mode == DwbMode::Off {
87 return None;
88 }
89 let dwb_path = path.with_extension("dwb");
90 match crate::double_write::DoubleWriteBuffer::open(&dwb_path, mode) {
91 Ok(d) => Some(d),
92 Err(e) => {
93 tracing::warn!(
94 path = %dwb_path.display(),
95 error = %e,
96 mode = ?mode,
97 "failed to open DWB — torn-write protection disabled for this writer"
98 );
99 None
100 }
101 }
102}
103
104/// Append-only WAL writer.
105pub struct WalWriter {

Callers 2

openMethod · 0.85
open_with_start_lsnMethod · 0.85

Calls 2

resolve_dwb_modeFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected