materialize icon indicating copy to clipboard operation
materialize copied to clipboard

storage: move storage_state module to protocol::server::worker

Open benesch opened this issue 2 years ago • 2 comments

I think this module movement was just missed in #13626. It seems to logically belong in the server module introduced in #13626.

Motivation

  • This PR refactors existing code.

Checklist

benesch avatar Sep 18 '22 22:09 benesch

I think this was left as is on purpose. The storage_state is an implementation detail of storaged, and not something in the protocol between client and server. cc @petrosagg

aljoscha avatar Sep 19 '22 18:09 aljoscha

I think this was left as is on purpose. The storage_state is an implementation detail of storaged, and not something in the protocol between client and server. cc @petrosagg

Yeah, for sure, it's the implementation of the server—but the same is true of a bunch of the existing code in protocol::client and protocol::server. There's plenty of implementation details in those modules already. It's the pub vs. not distinction that tucks away the public vs. private stuff.

IMO an optimal module arrangement would look something like this:

  • controller — storage controller implementation
  • collection — public submodule for reading a storage collection from outside of storage
  • host — storage host implementation (what's currently called "protocol")
    • client — public submodule for storage host client
    • server — public submodule for storage host server
      • decode — private submodule for decoding operators
      • render — private submodule for ... other? ... operators
      • source — private submodule for source operators
      • sink — private submodule for sink operators
  • types — the types used in the public controller API

benesch avatar Sep 20 '22 01:09 benesch