The OceanStore Project
OceanStore HelloWorld HOWTO
by Hakim Weatherspoon, Chiu Wah Kelvin So, and Jason Lee
A client sends a message to more than one unique server. Then servers print out the messages, "Hello! How are you" and send a response "Great! The weather is wonderful today!" The client prints out the response. After all the responses have been received, client exits.
HelloWorldServers publish DDPublishReq
HelloWorldClientlocates and sends msg to 3 different
HelloWorldServerby sending a
HelloWorldServers which have received a
HelloWorldLocateMsgprints out the message and send back a response to
HelloWorldRouteMsgand prints out the message. After receving
HelloWorldRouteMsgfrom 3 different
HelloWorldServer, HelloWorldClient exits.
HelloWorldServer, you will need to understand how do DDLocateMsg, DDQuery, and DDQueryState work.
DDLocateMsgis sent to root of GUID. On the way to the root, there can be intermediate nodes that DDLocateMsg
goes through. At each of the intermediate nodes, Router will run the DDLocateMsg's query on all the pointer(included GUID and the tag) if GUID of the pointers matches the DDLocateMsg's GUID. If DDQueryResultMatch is returned by the query and DDLocateMsg's forward is true, then the DDLocateMsg will get forward to the GUID object. If DDQueryResultMatch is returned and DDLocateMsg's forward is false, then the DDLocateMsg will not forward to the GUID object. If DDQueryResultNoMatch, then the DDLocateMsg will not forward to the GUID object. In DDQueryResultMatch, there is an option to stop the DDLocateMsg or not before getting to the root.
HelloWorldQueryStatejust need to maintain a set of servers GUID that has been queried. If the size of the set = 3, then query will return DDQueryResultMatch with stop = true. and the DDLocateMsg will be stopped. More detail in the next section.
bp_guidin the query method is the pointer to one of the servers
HelloWorldQueryState, instead of null in step1, as one of the input for instantiating
HelloWorldRouteMsgfrom 3 different servers
Click here to go to HelloWorld Exercise step3.