Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
Weak can become empty between `vacuum()` and `upgrade()`.
  • Loading branch information
abcpro1 committed Oct 3, 2023
1 parent 3b318ea commit 934cd5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dozer-recordstore/src/in_memory/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ impl ProcessorRecordStore {
.records
.range(start..)
// We just removed all the
.map(|(id, record)| (id, RecordRef(record.upgrade().unwrap())))
.filter_map(|(&id, weak)| weak.upgrade().map(|record| (id, RecordRef(record))))
.collect::<Vec<_>>();
let data =
bincode::serialize(&slice).map_err(|e| RecordStoreError::SerializationError {
typ: "[RecordRef]",
typ: "[(usize, RecordRef)]",
reason: Box::new(e),
})?;
Ok((data, slice.len()))
Expand Down Expand Up @@ -128,7 +128,7 @@ impl ProcessorRecordStoreDeserializer {
pub fn deserialize_and_extend(&self, data: &[u8]) -> Result<(), RecordStoreError> {
let slice: Vec<(usize, RecordRef)> =
bincode::deserialize(data).map_err(|e| RecordStoreError::DeserializationError {
typ: "[Option<RecordRef>]",
typ: "[(usize, RecordRef)]",
reason: Box::new(e),
})?;

Expand Down
2 changes: 1 addition & 1 deletion dozer-recordstore/src/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ProcessorRecordStore {
}

pub fn serialize_slice(&self, start: usize) -> Result<(Vec<u8>, usize), RecordStoreError> {
Ok((vec![0], self.num_records() - start)) // TODO: implement rocksdb record store checkpointing
Ok((vec![], self.num_records() - start)) // TODO: implement rocksdb record store checkpointing
}

pub fn deserialize_and_extend(&self, _data: &[u8]) -> Result<(), RecordStoreError> {
Expand Down

0 comments on commit 934cd5a

Please sign in to comment.