The OceanStore Project
OceanStore HelloWorld HOWTO by Hakim Weatherspoon, Chiu Wah Kelvin So, and Jason Lee |
A client to send a message to more than one of the closest servers. The servers have to be unique. 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.
HelloWorldServer
s publish DDPublishReqHelloWorldClient
gathers information of virutual coordinate of any 7 different HelloWorldServer
by sending a HelloWorldLocateMsg
.HelloWorldClient
listens for HelloWorldLocateMsg
which includes the information of the 7 HelloWorldServer
. Send a VivaldiRequestVC
to find out the local virutal coordinate.HelloWorldClient
listens for VivaldiReplyVC
. Using local virutal coordinate in the VivaldiReplyVC
, HelloWorldClient
calculates the closest 3 HelloWorldServer
, and sends them message using HelloWorldRouteMsg
.HelloWorldServer
s which have received a HelloWorldRouteMsg
prints out the message and send back a response to HelloWorldClient
using HelloWorldRouteMsg
.HelloWorldClient
listens for HelloWorldRouteMsg
and prints out the message. After receving HelloWorldRouteMsg
from 3 different HelloWorldServer, HelloWorldClient exits.
HelloWorldQueryState
HelloWorldQuery
HelloWorldClient
HelloWorldServer
HelloWorldLocateMsg
HelloWorldLocateMsg
HelloWorldLocateMsg
to gather servers information by setting input forward to false. (Note: by setting forward to false, HelloWorldLocateMsg
will not be forward to any of the HelloWorldServer
. After HelloWorldLocateMsg
is stopped by DDQueryResultMatch, HelloWorldLocateMsg
returns to HelloWorldClient
and gathered information would be stored in HelloWorldQueryState
.)HelloWorldQueryState
guid
and virtual coordinates.HelloWorldQuery
bp_guid
in the query method is the pointer to one of the servers, and bp_hinfo.coordinate
is the virtual coordinate of the serverHelloWorldClient
HelloWorldQueryState
in HelloWorldLocateMsg
has all the gathered information of the servers bamboo.vivaldi.VivaldiReplyVC
and bamboo.vivaldi.VivaldiRequestVC
to find the local virtual coordinate.VivaldiReplyVC.coordinate
. localVirtualCoordinate.distance(destinationVirtualCoordinate)
.HelloWorldRouteMsg
to the 3 closest HelloWorldServers
.VivaldiReplyVC
and VivaldiRequestVC
: dd.host.impl.HostHb
VirtualCoordinate.distance(destinationVC)
: dd.ptr.impl.PtrMgr
HelloWorldServers0
- HelloWorldServers9