Skip to content

Commit 4f82a75

Browse files
committed
Update remaining references to primary/secondary namespaces
Update various variables, error strings, and the pending changelog entry to refer to new namespace terminology.
1 parent 0431df7 commit 4f82a75

File tree

6 files changed

+95
-92
lines changed

6 files changed

+95
-92
lines changed

lightning-background-processor/src/lib.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,10 @@ use core::task;
506506
/// # use lightning_background_processor::{process_events_async, GossipSync};
507507
/// # struct MyStore {}
508508
/// # impl lightning::util::persist::KVStore for MyStore {
509-
/// # fn read(&self, namespace: &str, sub_namespace: &str, key: &str) -> io::Result<Vec<u8>> { Ok(Vec::new()) }
510-
/// # fn write(&self, namespace: &str, sub_namespace: &str, key: &str, buf: &[u8]) -> io::Result<()> { Ok(()) }
511-
/// # fn remove(&self, namespace: &str, sub_namespace: &str, key: &str, lazy: bool) -> io::Result<()> { Ok(()) }
512-
/// # fn list(&self, namespace: &str, sub_namespace: &str) -> io::Result<Vec<String>> { Ok(Vec::new()) }
509+
/// # fn read(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> io::Result<Vec<u8>> { Ok(Vec::new()) }
510+
/// # fn write(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8]) -> io::Result<()> { Ok(()) }
511+
/// # fn remove(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, lazy: bool) -> io::Result<()> { Ok(()) }
512+
/// # fn list(&self, primary_namespace: &str, secondary_namespace: &str) -> io::Result<Vec<String>> { Ok(Vec::new()) }
513513
/// # }
514514
/// # struct MyEventHandler {}
515515
/// # impl MyEventHandler {
@@ -986,22 +986,22 @@ mod tests {
986986
}
987987

988988
impl KVStore for Persister {
989-
fn read(&self, namespace: &str, sub_namespace: &str, key: &str) -> lightning::io::Result<Vec<u8>> {
990-
self.kv_store.read(namespace, sub_namespace, key)
989+
fn read(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> lightning::io::Result<Vec<u8>> {
990+
self.kv_store.read(primary_namespace, secondary_namespace, key)
991991
}
992992

993-
fn write(&self, namespace: &str, sub_namespace: &str, key: &str, buf: &[u8]) -> lightning::io::Result<()> {
994-
if namespace == CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE &&
995-
sub_namespace == CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE &&
993+
fn write(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8]) -> lightning::io::Result<()> {
994+
if primary_namespace == CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE &&
995+
secondary_namespace == CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE &&
996996
key == CHANNEL_MANAGER_PERSISTENCE_KEY
997997
{
998998
if let Some((error, message)) = self.manager_error {
999999
return Err(std::io::Error::new(error, message))
10001000
}
10011001
}
10021002

1003-
if namespace == NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE &&
1004-
sub_namespace == NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE &&
1003+
if primary_namespace == NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE &&
1004+
secondary_namespace == NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE &&
10051005
key == NETWORK_GRAPH_PERSISTENCE_KEY
10061006
{
10071007
if let Some(sender) = &self.graph_persistence_notifier {
@@ -1016,24 +1016,24 @@ mod tests {
10161016
}
10171017
}
10181018

1019-
if namespace == SCORER_PERSISTENCE_PRIMARY_NAMESPACE &&
1020-
sub_namespace == SCORER_PERSISTENCE_SECONDARY_NAMESPACE &&
1019+
if primary_namespace == SCORER_PERSISTENCE_PRIMARY_NAMESPACE &&
1020+
secondary_namespace == SCORER_PERSISTENCE_SECONDARY_NAMESPACE &&
10211021
key == SCORER_PERSISTENCE_KEY
10221022
{
10231023
if let Some((error, message)) = self.scorer_error {
10241024
return Err(std::io::Error::new(error, message))
10251025
}
10261026
}
10271027

1028-
self.kv_store.write(namespace, sub_namespace, key, buf)
1028+
self.kv_store.write(primary_namespace, secondary_namespace, key, buf)
10291029
}
10301030

1031-
fn remove(&self, namespace: &str, sub_namespace: &str, key: &str, lazy: bool) -> lightning::io::Result<()> {
1032-
self.kv_store.remove(namespace, sub_namespace, key, lazy)
1031+
fn remove(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, lazy: bool) -> lightning::io::Result<()> {
1032+
self.kv_store.remove(primary_namespace, secondary_namespace, key, lazy)
10331033
}
10341034

1035-
fn list(&self, namespace: &str, sub_namespace: &str) -> lightning::io::Result<Vec<String>> {
1036-
self.kv_store.list(namespace, sub_namespace)
1035+
fn list(&self, primary_namespace: &str, secondary_namespace: &str) -> lightning::io::Result<Vec<String>> {
1036+
self.kv_store.list(primary_namespace, secondary_namespace)
10371037
}
10381038
}
10391039

lightning-persister/src/fs_store.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl FilesystemStore {
6767
}
6868
}
6969

70-
fn get_dest_dir_path(&self, namespace: &str, sub_namespace: &str) -> std::io::Result<PathBuf> {
70+
fn get_dest_dir_path(&self, primary_namespace: &str, secondary_namespace: &str) -> std::io::Result<PathBuf> {
7171
let mut dest_dir_path = {
7272
#[cfg(target_os = "windows")]
7373
{
@@ -81,20 +81,20 @@ impl FilesystemStore {
8181
}
8282
};
8383

84-
dest_dir_path.push(namespace);
85-
if !sub_namespace.is_empty() {
86-
dest_dir_path.push(sub_namespace);
84+
dest_dir_path.push(primary_namespace);
85+
if !secondary_namespace.is_empty() {
86+
dest_dir_path.push(secondary_namespace);
8787
}
8888

8989
Ok(dest_dir_path)
9090
}
9191
}
9292

9393
impl KVStore for FilesystemStore {
94-
fn read(&self, namespace: &str, sub_namespace: &str, key: &str) -> std::io::Result<Vec<u8>> {
95-
check_namespace_key_validity(namespace, sub_namespace, Some(key), "read")?;
94+
fn read(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> std::io::Result<Vec<u8>> {
95+
check_namespace_key_validity(primary_namespace, secondary_namespace, Some(key), "read")?;
9696

97-
let mut dest_file_path = self.get_dest_dir_path(namespace, sub_namespace)?;
97+
let mut dest_file_path = self.get_dest_dir_path(primary_namespace, secondary_namespace)?;
9898
dest_file_path.push(key);
9999

100100
let mut buf = Vec::new();
@@ -114,10 +114,10 @@ impl KVStore for FilesystemStore {
114114
Ok(buf)
115115
}
116116

117-
fn write(&self, namespace: &str, sub_namespace: &str, key: &str, buf: &[u8]) -> std::io::Result<()> {
118-
check_namespace_key_validity(namespace, sub_namespace, Some(key), "write")?;
117+
fn write(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8]) -> std::io::Result<()> {
118+
check_namespace_key_validity(primary_namespace, secondary_namespace, Some(key), "write")?;
119119

120-
let mut dest_file_path = self.get_dest_dir_path(namespace, sub_namespace)?;
120+
let mut dest_file_path = self.get_dest_dir_path(primary_namespace, secondary_namespace)?;
121121
dest_file_path.push(key);
122122

123123
let parent_directory = dest_file_path
@@ -201,10 +201,10 @@ impl KVStore for FilesystemStore {
201201
res
202202
}
203203

204-
fn remove(&self, namespace: &str, sub_namespace: &str, key: &str, lazy: bool) -> std::io::Result<()> {
205-
check_namespace_key_validity(namespace, sub_namespace, Some(key), "remove")?;
204+
fn remove(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, lazy: bool) -> std::io::Result<()> {
205+
check_namespace_key_validity(primary_namespace, secondary_namespace, Some(key), "remove")?;
206206

207-
let mut dest_file_path = self.get_dest_dir_path(namespace, sub_namespace)?;
207+
let mut dest_file_path = self.get_dest_dir_path(primary_namespace, secondary_namespace)?;
208208
dest_file_path.push(key);
209209

210210
if !dest_file_path.is_file() {
@@ -290,10 +290,10 @@ impl KVStore for FilesystemStore {
290290
Ok(())
291291
}
292292

293-
fn list(&self, namespace: &str, sub_namespace: &str) -> std::io::Result<Vec<String>> {
294-
check_namespace_key_validity(namespace, sub_namespace, None, "list")?;
293+
fn list(&self, primary_namespace: &str, secondary_namespace: &str) -> std::io::Result<Vec<String>> {
294+
check_namespace_key_validity(primary_namespace, secondary_namespace, None, "list")?;
295295

296-
let prefixed_dest = self.get_dest_dir_path(namespace, sub_namespace)?;
296+
let prefixed_dest = self.get_dest_dir_path(primary_namespace, secondary_namespace)?;
297297
let mut keys = Vec::new();
298298

299299
if !Path::new(&prefixed_dest).exists() {
@@ -328,9 +328,9 @@ impl KVStore for FilesystemStore {
328328
// If we otherwise don't find a file at the given path something went wrong.
329329
if !metadata.is_file() {
330330
debug_assert!(false, "Failed to list keys of {}/{}: file couldn't be accessed.",
331-
PrintableString(namespace), PrintableString(sub_namespace));
331+
PrintableString(primary_namespace), PrintableString(secondary_namespace));
332332
let msg = format!("Failed to list keys of {}/{}: file couldn't be accessed.",
333-
PrintableString(namespace), PrintableString(sub_namespace));
333+
PrintableString(primary_namespace), PrintableString(secondary_namespace));
334334
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
335335
}
336336

@@ -342,17 +342,17 @@ impl KVStore for FilesystemStore {
342342
}
343343
} else {
344344
debug_assert!(false, "Failed to list keys of {}/{}: file path is not valid UTF-8",
345-
PrintableString(namespace), PrintableString(sub_namespace));
345+
PrintableString(primary_namespace), PrintableString(secondary_namespace));
346346
let msg = format!("Failed to list keys of {}/{}: file path is not valid UTF-8",
347-
PrintableString(namespace), PrintableString(sub_namespace));
347+
PrintableString(primary_namespace), PrintableString(secondary_namespace));
348348
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
349349
}
350350
}
351351
Err(e) => {
352352
debug_assert!(false, "Failed to list keys of {}/{}: {}",
353-
PrintableString(namespace), PrintableString(sub_namespace), e);
353+
PrintableString(primary_namespace), PrintableString(secondary_namespace), e);
354354
let msg = format!("Failed to list keys of {}/{}: {}",
355-
PrintableString(namespace), PrintableString(sub_namespace), e);
355+
PrintableString(primary_namespace), PrintableString(secondary_namespace), e);
356356
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
357357
}
358358
}

lightning-persister/src/test_utils.rs

+13-12
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,35 @@ use std::panic::RefUnwindSafe;
1212
pub(crate) fn do_read_write_remove_list_persist<K: KVStore + RefUnwindSafe>(kv_store: &K) {
1313
let data = [42u8; 32];
1414

15-
let namespace = "testspace";
16-
let sub_namespace = "testsubspace";
15+
let primary_namespace = "testspace";
16+
let secondary_namespace = "testsubspace";
1717
let key = "testkey";
1818

1919
// Test the basic KVStore operations.
20-
kv_store.write(namespace, sub_namespace, key, &data).unwrap();
20+
kv_store.write(primary_namespace, secondary_namespace, key, &data).unwrap();
2121

22-
// Test empty namespace/sub_namespace is allowed, but not empty namespace and non-empty
23-
// sub-namespace, and not empty key.
22+
// Test empty primary_namespace/secondary_namespace is allowed, but not empty primary_namespace
23+
// and non-empty secondary_namespace, and not empty key.
2424
kv_store.write("", "", key, &data).unwrap();
25-
let res = std::panic::catch_unwind(|| kv_store.write("", sub_namespace, key, &data));
25+
let res = std::panic::catch_unwind(|| kv_store.write("", secondary_namespace, key, &data));
2626
assert!(res.is_err());
27-
let res = std::panic::catch_unwind(|| kv_store.write(namespace, sub_namespace, "", &data));
27+
let res = std::panic::catch_unwind(|| kv_store.write(primary_namespace, secondary_namespace, "", &data));
2828
assert!(res.is_err());
2929

30-
let listed_keys = kv_store.list(namespace, sub_namespace).unwrap();
30+
let listed_keys = kv_store.list(primary_namespace, secondary_namespace).unwrap();
3131
assert_eq!(listed_keys.len(), 1);
3232
assert_eq!(listed_keys[0], key);
3333

34-
let read_data = kv_store.read(namespace, sub_namespace, key).unwrap();
34+
let read_data = kv_store.read(primary_namespace, secondary_namespace, key).unwrap();
3535
assert_eq!(data, &*read_data);
3636

37-
kv_store.remove(namespace, sub_namespace, key, false).unwrap();
37+
kv_store.remove(primary_namespace, secondary_namespace, key, false).unwrap();
3838

39-
let listed_keys = kv_store.list(namespace, sub_namespace).unwrap();
39+
let listed_keys = kv_store.list(primary_namespace, secondary_namespace).unwrap();
4040
assert_eq!(listed_keys.len(), 0);
4141

42-
// Ensure we have no issue operating with namespace/sub_namespace/key being KVSTORE_NAMESPACE_KEY_MAX_LEN
42+
// Ensure we have no issue operating with primary_namespace/secondary_namespace/key being
43+
// KVSTORE_NAMESPACE_KEY_MAX_LEN
4344
let max_chars: String = std::iter::repeat('A').take(KVSTORE_NAMESPACE_KEY_MAX_LEN).collect();
4445
kv_store.write(&max_chars, &max_chars, &max_chars, &data).unwrap();
4546

lightning-persister/src/utils.rs

+25-23
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,53 @@ pub(crate) fn is_valid_kvstore_str(key: &str) -> bool {
66
key.len() <= KVSTORE_NAMESPACE_KEY_MAX_LEN && key.chars().all(|c| KVSTORE_NAMESPACE_KEY_ALPHABET.contains(c))
77
}
88

9-
pub(crate) fn check_namespace_key_validity(namespace: &str, sub_namespace: &str, key: Option<&str>, operation: &str) -> Result<(), std::io::Error> {
9+
pub(crate) fn check_namespace_key_validity(
10+
primary_namespace: &str, secondary_namespace: &str, key: Option<&str>, operation: &str)
11+
-> Result<(), std::io::Error> {
1012
if let Some(key) = key {
1113
if key.is_empty() {
1214
debug_assert!(false, "Failed to {} {}/{}/{}: key may not be empty.", operation,
13-
PrintableString(namespace), PrintableString(sub_namespace), PrintableString(key));
15+
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
1416
let msg = format!("Failed to {} {}/{}/{}: key may not be empty.", operation,
15-
PrintableString(namespace), PrintableString(sub_namespace), PrintableString(key));
17+
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
1618
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
1719
}
1820

19-
if namespace.is_empty() && !sub_namespace.is_empty() {
21+
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
2022
debug_assert!(false,
21-
"Failed to {} {}/{}/{}: namespace may not be empty if a non-empty sub-namespace is given.",
23+
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
2224
operation,
23-
PrintableString(namespace), PrintableString(sub_namespace), PrintableString(key));
25+
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
2426
let msg = format!(
25-
"Failed to {} {}/{}/{}: namespace may not be empty if a non-empty sub-namespace is given.", operation,
26-
PrintableString(namespace), PrintableString(sub_namespace), PrintableString(key));
27+
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
28+
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
2729
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
2830
}
2931

30-
if !is_valid_kvstore_str(namespace) || !is_valid_kvstore_str(sub_namespace) || !is_valid_kvstore_str(key) {
31-
debug_assert!(false, "Failed to {} {}/{}/{}: namespace, sub-namespace, and key must be valid.",
32+
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) || !is_valid_kvstore_str(key) {
33+
debug_assert!(false, "Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
3234
operation,
33-
PrintableString(namespace), PrintableString(sub_namespace), PrintableString(key));
34-
let msg = format!("Failed to {} {}/{}/{}: namespace, sub-namespace, and key must be valid.",
35+
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
36+
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
3537
operation,
36-
PrintableString(namespace), PrintableString(sub_namespace), PrintableString(key));
38+
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
3739
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
3840
}
3941
} else {
40-
if namespace.is_empty() && !sub_namespace.is_empty() {
42+
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
4143
debug_assert!(false,
42-
"Failed to {} {}/{}: namespace may not be empty if a non-empty sub-namespace is given.",
43-
operation, PrintableString(namespace), PrintableString(sub_namespace));
44+
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
45+
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
4446
let msg = format!(
45-
"Failed to {} {}/{}: namespace may not be empty if a non-empty sub-namespace is given.",
46-
operation, PrintableString(namespace), PrintableString(sub_namespace));
47+
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
48+
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
4749
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
4850
}
49-
if !is_valid_kvstore_str(namespace) || !is_valid_kvstore_str(sub_namespace) {
50-
debug_assert!(false, "Failed to {} {}/{}: namespace and sub-namespace must be valid.",
51-
operation, PrintableString(namespace), PrintableString(sub_namespace));
52-
let msg = format!("Failed to {} {}/{}: namespace and sub-namespace must be valid.",
53-
operation, PrintableString(namespace), PrintableString(sub_namespace));
51+
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
52+
debug_assert!(false, "Failed to {} {}/{}: primary namespace and secondary namespace must be valid.",
53+
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
54+
let msg = format!("Failed to {} {}/{}: primary namespace and secondary namespace must be valid.",
55+
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
5456
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
5557
}
5658
}

lightning/src/util/test_utils.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,12 @@ impl TestStore {
440440
}
441441

442442
impl KVStore for TestStore {
443-
fn read(&self, namespace: &str, sub_namespace: &str, key: &str) -> io::Result<Vec<u8>> {
443+
fn read(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> io::Result<Vec<u8>> {
444444
let persisted_lock = self.persisted_bytes.lock().unwrap();
445-
let prefixed = if sub_namespace.is_empty() {
446-
namespace.to_string()
445+
let prefixed = if secondary_namespace.is_empty() {
446+
primary_namespace.to_string()
447447
} else {
448-
format!("{}/{}", namespace, sub_namespace)
448+
format!("{}/{}", primary_namespace, secondary_namespace)
449449
};
450450

451451
if let Some(outer_ref) = persisted_lock.get(&prefixed) {
@@ -460,7 +460,7 @@ impl KVStore for TestStore {
460460
}
461461
}
462462

463-
fn write(&self, namespace: &str, sub_namespace: &str, key: &str, buf: &[u8]) -> io::Result<()> {
463+
fn write(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8]) -> io::Result<()> {
464464
if self.read_only {
465465
return Err(io::Error::new(
466466
io::ErrorKind::PermissionDenied,
@@ -469,10 +469,10 @@ impl KVStore for TestStore {
469469
}
470470
let mut persisted_lock = self.persisted_bytes.lock().unwrap();
471471

472-
let prefixed = if sub_namespace.is_empty() {
473-
namespace.to_string()
472+
let prefixed = if secondary_namespace.is_empty() {
473+
primary_namespace.to_string()
474474
} else {
475-
format!("{}/{}", namespace, sub_namespace)
475+
format!("{}/{}", primary_namespace, secondary_namespace)
476476
};
477477
let outer_e = persisted_lock.entry(prefixed).or_insert(HashMap::new());
478478
let mut bytes = Vec::new();
@@ -481,7 +481,7 @@ impl KVStore for TestStore {
481481
Ok(())
482482
}
483483

484-
fn remove(&self, namespace: &str, sub_namespace: &str, key: &str, _lazy: bool) -> io::Result<()> {
484+
fn remove(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, _lazy: bool) -> io::Result<()> {
485485
if self.read_only {
486486
return Err(io::Error::new(
487487
io::ErrorKind::PermissionDenied,
@@ -491,10 +491,10 @@ impl KVStore for TestStore {
491491

492492
let mut persisted_lock = self.persisted_bytes.lock().unwrap();
493493

494-
let prefixed = if sub_namespace.is_empty() {
495-
namespace.to_string()
494+
let prefixed = if secondary_namespace.is_empty() {
495+
primary_namespace.to_string()
496496
} else {
497-
format!("{}/{}", namespace, sub_namespace)
497+
format!("{}/{}", primary_namespace, secondary_namespace)
498498
};
499499
if let Some(outer_ref) = persisted_lock.get_mut(&prefixed) {
500500
outer_ref.remove(&key.to_string());
@@ -503,13 +503,13 @@ impl KVStore for TestStore {
503503
Ok(())
504504
}
505505

506-
fn list(&self, namespace: &str, sub_namespace: &str) -> io::Result<Vec<String>> {
506+
fn list(&self, primary_namespace: &str, secondary_namespace: &str) -> io::Result<Vec<String>> {
507507
let mut persisted_lock = self.persisted_bytes.lock().unwrap();
508508

509-
let prefixed = if sub_namespace.is_empty() {
510-
namespace.to_string()
509+
let prefixed = if secondary_namespace.is_empty() {
510+
primary_namespace.to_string()
511511
} else {
512-
format!("{}/{}", namespace, sub_namespace)
512+
format!("{}/{}", primary_namespace, secondary_namespace)
513513
};
514514
match persisted_lock.entry(prefixed) {
515515
hash_map::Entry::Occupied(e) => Ok(e.get().keys().cloned().collect()),

0 commit comments

Comments
 (0)