200 likes | 286 Views
Implementation of XML Database and Enhancement of Resource and Sensor Agents. Cuong Ngo CSS497 Summer 2006 Professor Munehiro Fukuda. AgentTeamwork. Overview. Mobile agents and AgentTeamWork XML Format and XML DOM object New XML database and Applet GUI Dynamic monitoring of resources
E N D
Implementation of XML Database and Enhancement of Resource and Sensor Agents Cuong Ngo CSS497 Summer 2006 Professor Munehiro Fukuda
AgentTeamwork Overview • Mobile agents and AgentTeamWork • XML Format and XML DOM object • New XML database and Applet GUI • Dynamic monitoring of resources • Future work
Snapshot Methods Snapshot Methods GridTCP GridTCP User program wrapper User program wrapper Results Results snapshot snapshot snapshot User A User B FTP Server snapshots snapshots AgentTeamWork Overview User A’s Process User A’s Process User B’s Process TCP Communication Snapshot Methods GridTCP User program wrapper Sentinel Agent Sentinel Agent Sentinel Agent Commander Agent Resource Agent Resource Agent Commander Agent XDB XDB BookkeeperAgent Bookkeeper Agent
Project Objectives • Replace old database, eXist • No documentation • Need to include cluster information • Dynamically monitor resources • Proper communication between agents eXist XDBase
<department> <employee> <name>John Doe</name> <email>jDoe@foo.com</email> </employee> <employee> <name>Bill Jones</name> <email>bJones@foo.com</email> </employee> </department> XML FormatXML File DOM Object Element “department” Element “employee” Element “name” Text “John Doe” Element “email” Text “jDoe@foo.com” Element “employee” Element “name” Text “Bill Jones” Element “email” Text “bJones@foo.com”
DOM: Document Object Model • Keeps XML structure in tact • DOM Structure • Node • Document • Element • Text • Ability to: • Add • Delete • Modify • Query Element “department” Element “employee” Element “name” Text “John Doe” Element “email” Text “jDoe@foo.com” Text “jDoe@foo.net” “jDoe@foo.net” Element “id” Text “5561” Whole XML File
Xpath is a query language used to find information in an XML document Java provides XPathAPI to use Xpath expressions to perform tasks Examples /department/employee /department/employee[name=‘John Doe’]/ //name //employee[name = ‘Bill Jones’]/email/text() //employee/* //name | //email Xpath Expressions Element “department” Element “employee” Element “name” Text “John Doe” Element “email” Text “jDoe@foo.com” Element “employee” Element “name” Text “Bill Jones” Element “email” Text “bJones@foo.com”
Database Overview • Parse XML document to DOM object and create a wrapper object called Resource • Modification timestamp • Availability • Ping • Collection class contains Resources • Database contains Collections • Parse and process request • Services connect to database and demand a request • RetrievalService • QueryService • Applet-based GUI interacts with database
Database Services • Create a collection, synchronize by writing database contents back to local disk, and shutting down of the database • Store, retrieve and delete a collection or resource • Update a single resource or an entire collection • Query a collection for specific items • Specifically query the database for resources based on requirements
Resource Itinerary with Cluster Information • Old format included only IP addresses • Assumed every IP was public • New format contains a cluster, its gateway and its cluster nodes. • Use gateway to communicate between nodes of different clusters • Even gateway must be running AgentTeamWork platform
Applet-based GUI • Graphically interact with the new database • Ability to: • Look at database contents • Add files • Delete files • Connect to remotely located databases
ResourceAgent Modifications • Create runtime file for each cluster node • Create itinerary for SensorAgent to monitor nodes dynamically • Query the database for all nodes within a domain, such as “UWB” • Itinerary includes cluster and public nodes • Proper communication with other agents
SensorAgent Modifications XDBase Resource id 1 Sensor Client Root Id 4 Sensor Server Root Id 5 Client 1 Id 16 Client 2 Id 17 Server 1 Id 20 Server 2 Id 21
SensorAgent Modifications 2 Resource id 1 XDBase Sensor Root Id 4 Public Client Root Id 17 Public Server Root Id 18 Gateway 1 Id 16 Gateway 2 Id 64 G1 Client Root Id 65 G1 Server Root Id 66 Client 1 Id 68 Client 2 Id 69 Server 1 Id 72 Server 2 Id 73 G2 Client Root Id 256 G2 Server Root Id 257 Cluster 1 G2 Client 1 Id 1024 G2 Server 1 Id 1028 Cluster 2
Future Expansions of Database • Easy to add new functionality to database • Create a service to send a request to database • Database parses and processes the request • Database send back results
Future AgentTeamWork Tasks • SensorAgent • Have 2 cluster gateways perform bandwidth test to monitor inter-cluster bandwidth • Need communication to change unavailable nodes to available when a job is complete • CommanderAgent informs ResourceAgent which in turns creates a service request to the database
What I Learned • XML, DOM object, Xpath • Grid computing programming • Communication between team members • Understanding existing code and modifying it without breaking it
Acknowledgements • Advisor Prof. Munehiro Fukuda • Sponsor Prof. Shinya Kobayashi • Emory Horvath • CSS301, CSS342, CSS343, CSS434, CSS442, CSS360 • XML and Java, 2nd Edition book