CAN Implementation Sub-project: Content Manager Amol Bakshi CSCI October 2002
CSCI599, Oct. 14, Amol: 2 of 8 Role of Content Manager in a CAN All pairs are ultimately stored in a database (such as Microsoft Access) Lookup, Add, and Delete operations access the “target” database Content Manager (CM) is a wrapper around the database that executes the operations on the target node
CSCI599, Oct. 14, Amol: 3 of 8 CAN Implementation Communication Engine Content Manager Routing Manager Message Dispatcher Proxy CLIENT DB next-node original
CSCI599, Oct. 14, Amol: 4 of 8 CM Pseudo-code Invoked by Message Dispatcher with message format ProcessMsg(byte[] message){ –Check if current node is target node –If it is, access the node database –Perform add/delete/lookup operation on database –Via Comm.Engine, send the result of operation to originating proxy –If not, forward message as-is to routing manager }
CSCI599, Oct. 14, Amol: 5 of 8 Database Access in C#/.NET OleDbConnection cConn = new OleDbConnection(“Provider=Microsoft.Net.OLEDB.4.0;Data Source=c:\\can.mdb”); OleDbCommand cComm = new OleDbCommand(“Select * from can”, cConn); OleDbDataAdapter canDA = new OleDbDataAdapter(); canDA.SelectCommand = cComm; DataSet canDS = new DataSet(“CANdata”); canDA.Fill(canDS, “KeyValInfo”);
CSCI599, Oct. 14, Amol: 6 of 8 CM and Other CAN Components (1) CM and Proxy –No direct interaction between CM and Proxy –CM of the target node will indirectly contact the originating Proxy with the result of the operation –IP addr and channel ID of Proxy encapsulated in the Message CM and Comm. Engine (CE) –All communication routed through CE –CM invokes SendMsg of CE to contact original Proxy (described above)
CSCI599, Oct. 14, Amol: 7 of 8 CM and Other CAN Components (2) CM and Message Dispatcher (MD) –CM provides ProcessMsg interface to MD –CM does not call any service of the MD CM and Routing Manager (RM) –CM needs to know if the current node is the target node (esp. important for ‘add’ operation) –RM maintains virtual topology and maps to physical topology; hence can provide this information –CM invokes a TargetNode(key) function from RM with a boolean return value
CSCI599, Oct. 14, Amol: 8 of 8 Design Issue: Blocking or Non-Blocking? Blocking calls within components –Easy to implement –Eventually terminate (at CommEngine?) –e.g. MD -> CM -> RM -> CE Non-blocking calls –greater throughput –harder to implement –overload CE(?)