Caution: Work in progress
High-level overview
Here is a simple diagram that shows the flow of data in the code.
Finding the Right Master
The client first has to find the right master to talk to - the master that holds the required data. To do this, RamCloud::read() invokes ObjectFinder::lookup(). It checks client's tabletMap - which is a cache of coordinator's tablet map. If that tablet is recovering or if the object was not found in any tablet, then the cache is refreshed. This is done by refresher(tabletMap) which is hardwired to CoordinatorClient::getTabletMap in the constructor.
...
It sends the requestBuffer and responseBuffer over session by session->clientSend(), and waits for it to return by state.rpc->wait().
Master Processing
When a master is running, it continuously polls for RPCs by:
handleRpc<MasterServer>()
...
- Transport Layer Header
- RPC, respHdr (see Rpc.h). For Read Response, the RPC contains:
- status
- version
- length (actual data length, calculated as shown above)
- pad
- Data (obj->data from above)
...