Conversation
src/rust/config/src/seg.rs
Outdated
| self.datapool_path.as_ref().map(|v| Path::new(v).to_owned()) | ||
| } | ||
|
|
||
| pub fn segments_fields_path(&self) -> Option<PathBuf> { |
There was a problem hiding this comment.
Should each of these paths be it's own config option? I suspect we can be opinionated about the names for each file if we decide to keep the parts separate.
There was a problem hiding this comment.
Yes, I was going to wait until we decided how many files to use
bfe653e to
7ca757c
Compare
…for TtlBuckets and Segments
… and neatened up TtlBuckets::restore()
…copy of the function
| /// Copies `size` bytes at `byte_ptr` to the `offset` of `data` | ||
| /// Returns the next `offset`, that is, the next byte of `data` to be copied into | ||
| pub fn store_bytes_and_update_offset(byte_ptr: *const u8, offset: usize, size: usize, data: &mut [u8]) -> usize { | ||
| // get corresponding bytes from byte pointer |
There was a problem hiding this comment.
I put this function here so that Segments, TtlBuckets and HashTable could all access it. I am slightly concerned about security as I am not sure if this could be used as a "write what I want where I want"
…ecides whether to build a new segments or not
src/rust/entrystore/src/seg/mod.rs
Outdated
|
|
||
| if config.graceful_shutdown() { | ||
| // TODO: check if successfully shutdown and record result | ||
| self.data.flush(); |
There was a problem hiding this comment.
This line currently produces a warning as I am ignoring the Result. Ideally the result would be intepreted here or passed along to server/segcache/src/lib.rs where I intend this flush() function to be called
src/rust/entrystore/src/seg/mod.rs
Outdated
|
|
||
| /// Flush (gracefully shutdown) the `Seg` cache if configured to do so | ||
| pub fn flush<T: SegConfig>(self, config: &T) { | ||
| let config = config.seg(); |
There was a problem hiding this comment.
I couldn't find a trait that I should implement (that only has the flush() required method) so I just put this function as a method of Seg. I did the same thing for the other files I added a flush() to
…t yet, as this doesn't make sense
… not point in keeping this until there is a nice way to determine expected file size
…ll change code so that Segments use same file. Also need to tidy code up
…). What we want is shutdown of entire cache
…ld flush the cache
…receive its broadcast to its signal_queue
Adds support for recovering from file-based datapool, intended for use with PMEM.