cocalele / PureFlash

A ServerSAN storage system designed for flash device
GNU General Public License v3.0
101 stars 29 forks source link

Simple IO run #5

Closed geekyang95 closed 3 years ago

geekyang95 commented 4 years ago

Need a simple demo to check afs_store Local IO path. My plan:

  1. run it as a unittest. use gtest/gmock to do, will add a submodule.
  2. only check IO / volume meta data, without network part.
  3. mock metadata initialize, only a few metadata is needed for testing purpose
  4. write a memstore to store testing data. It's core part is a map<size_t offset, void *data>. It will be very fast for testing purpose than write to a file.
cocalele commented 4 years ago

I think it's more simple to use a file rather than to construct a memstore, because S5FlashStore communicate to system only via a file descirptor(S5FlashStore::dev_fd). Create memstore may need a lot coding work.

geekyang95 commented 4 years ago

That's not a problem, only a little code changes need to make by using gmock to mock read/write operations. Maybe I should write a simple demo for discussing, at first.

geekyang95 commented 4 years ago

And, it would be a good idea to seperate OS operations from S5FlashStore, because we may need to support spdk in the future, or like the test purpose. If we can make dev_handle_t more powerful (not just a file descripter), it would be much easier to do things like that. That's a more CPP way to solve problem :)

geekyang95 commented 4 years ago

9