20
Implementation of Implementation of XML Database and XML Database and Enhancement of Enhancement of Resource and Sensor Resource and Sensor Agents Agents Cuong Ngo Cuong Ngo CSS497 CSS497 Summer 2006 Summer 2006 Professor Munehiro Fukuda Professor Munehiro Fukuda

Implementation of XML Database and Enhancement of Resource and Sensor Agents

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Citation preview

Implementation of XML Implementation of XML Database and Database and

Enhancement of Resource Enhancement of Resource and Sensor Agentsand Sensor Agents

Cuong NgoCuong NgoCSS497CSS497

Summer 2006Summer 2006Professor Munehiro FukudaProfessor Munehiro Fukuda

OverviewOverview

Mobile agents and AgentTeamWorkMobile agents and AgentTeamWork

XML Format and XML DOM objectXML Format and XML DOM object

New XML database and Applet GUINew XML database and Applet GUI

Dynamic monitoring of resourcesDynamic monitoring of resources

Future workFuture work

AgentTeamwork

AgentTeamWork OverviewAgentTeamWork Overview

FTPServer

UserA

User B

User B

snapshotsnapshot

snapshots snapshots

User program wrapper

SnapshotMethods

GridTCP

User program wrapper

SnapshotMethods

GridTCP

User program wrapper

SnapshotMethods

GridTCP

snapshot

User A’sProcess

User A’sProcess

User B’sProcess

TCPCommunication

Commander Agent

Commander Agent

Sentinel Agent

Sentinel Agent

Resource Agent

Sentinel Agent

Resource Agent

Bookkeeper Agent

BookkeeperAgent

ResultsResults

XDBXDB

Project ObjectivesProject Objectives

Replace old database, eXistReplace old database, eXist No documentation No documentation Need to include cluster informationNeed to include cluster information

Dynamically monitor resourcesDynamically monitor resources

Proper communication between agentsProper communication between agents

eXistXDBase

XML FormatXML FormatXML FileXML File DOM Object DOM Object

<department><department>

<employee><employee>

<name>John Doe</name><name>John Doe</name>

<email>[email protected]</email><email>[email protected]</email>

</employee></employee>

<employee><employee>

<name>Bill Jones</name><name>Bill Jones</name>

<email>[email protected]</<email>[email protected]</email>email>

</employee></employee>

</department></department>

Element“department”

Element“employee”

Element“email”

Element“employee”

Element“name”

Text“John Doe”

Text“Bill Jones”

Element“email”

Text“[email protected]

Text“[email protected]

Element “name”

DOM: Document Object ModelDOM: Document Object Model

Keeps XML structure in tactKeeps XML structure in tactDOM StructureDOM Structure NodeNode DocumentDocument ElementElement TextText

Ability to:Ability to: AddAdd DeleteDelete ModifyModify QueryQuery

Element“department”

Element“employee”

Element“email”

Element“name”

Text“John Doe”

Text“[email protected]

Whole XML FileElement

“id”Text

“5561”

Text“[email protected]”“[email protected]

Xpath ExpressionsXpath Expressions

Xpath is a query language used to find Xpath is a query language used to find information in an XML documentinformation in an XML document

Java provides XPathAPI to use Xpath Java provides XPathAPI to use Xpath expressions to perform tasksexpressions to perform tasks

ExamplesExamples /department/employee/department/employee /department/employee[name=‘John Doe’]//department/employee[name=‘John Doe’]/ //name//name //employee[name = ‘Bill Jones’]/email/text()//employee[name = ‘Bill Jones’]/email/text() //employee/*//employee/* //name | //email//name | //email

Element“department”

Element“employee”

Element“email”

Element“employee”

Element“name”

Text“John Doe”

Text“Bill Jones”

Element“email”

Text“[email protected]

Text“[email protected]

Element “name”

Database OverviewDatabase Overview

Parse XML document to DOM object and create a wrapper object called Parse XML document to DOM object and create a wrapper object called ResourceResource

Modification timestampModification timestamp AvailabilityAvailability PingPing

Collection class contains ResourcesCollection class contains Resources

Database contains CollectionsDatabase contains Collections Parse and process requestParse and process request

Services connect to database and demand a requestServices connect to database and demand a request RetrievalServiceRetrievalService QueryServiceQueryService

Applet-based GUI interacts with databaseApplet-based GUI interacts with database

Database ServicesDatabase ServicesCreate a collection, synchronize by writing Create a collection, synchronize by writing database contents back to local disk, and database contents back to local disk, and shutting down of the databaseshutting down of the database

Store, retrieve and delete a collection or Store, retrieve and delete a collection or resourceresource

Update a single resource or an entire collectionUpdate a single resource or an entire collection

Query a collection for specific itemsQuery a collection for specific items

Specifically query the database for resources Specifically query the database for resources based on requirementsbased on requirements

Resource Itinerary with Cluster Resource Itinerary with Cluster InformationInformation

Old format included only IP addressesOld format included only IP addresses Assumed every IP was publicAssumed every IP was public

New format contains a cluster, its gateway New format contains a cluster, its gateway and its cluster nodes. and its cluster nodes. Use gateway to communicate between nodes Use gateway to communicate between nodes

of different clustersof different clusters Even gateway must be running Even gateway must be running

AgentTeamWork platformAgentTeamWork platform

Applet-based GUIApplet-based GUI

Graphically interact with the new databaseGraphically interact with the new database

Ability to:Ability to: Look at database contentsLook at database contents Add filesAdd files Delete filesDelete files Connect to remotely located databasesConnect to remotely located databases

Applet-based GUI 2Applet-based GUI 2

ResourceAgent ModificationsResourceAgent Modifications

Create runtime file for each cluster node Create runtime file for each cluster node

Create itinerary for SensorAgent to Create itinerary for SensorAgent to monitor nodes dynamicallymonitor nodes dynamically Query the database for all nodes within a Query the database for all nodes within a

domain, such as “UWB”domain, such as “UWB” Itinerary includes cluster and public nodesItinerary includes cluster and public nodes

Proper communication with other agentsProper communication with other agents

SensorAgent ModificationsSensorAgent ModificationsResource

id 1

Sensor Client Root

Id 4

Sensor Server Root

Id 5

Client 1Id 16

Client 2Id 17

Server 1Id 20

Server 2Id 21

XDBase

SensorAgent Modifications 2SensorAgent Modifications 2Resource

id 1

Public ClientRootId 17

SensorRootId 4

Gateway 1Id 16

Gateway 2Id 64

G1 ClientRootId 65

G1 ServerRootId 66

Public Server RootId 18

Server 2Id 73

G2 ClientRoot

Id 256

G2 Server Root

Id 257

Client 1Id 68

Client 2Id 69

Server 1Id 72

G2 Client 1Id 1024

G2 Server 1Id 1028

Cluster 2

Cluster 1

XDBase

Future Expansions of DatabaseFuture Expansions of Database

Easy to add new functionality to databaseEasy to add new functionality to database Create a service to send a request to Create a service to send a request to

databasedatabase Database parses and processes the requestDatabase parses and processes the request Database send back resultsDatabase send back results

Future AgentTeamWork TasksFuture AgentTeamWork Tasks

SensorAgentSensorAgent Have 2 cluster gateways perform bandwidth Have 2 cluster gateways perform bandwidth

test to monitor inter-cluster bandwidthtest to monitor inter-cluster bandwidth

Need communication to change Need communication to change unavailable nodes to available when a job unavailable nodes to available when a job is completeis complete CommanderAgent informs ResourceAgent CommanderAgent informs ResourceAgent

which in turns creates a service request to the which in turns creates a service request to the databasedatabase

What I LearnedWhat I Learned

XML, DOM object, XpathXML, DOM object, Xpath

Grid computing programmingGrid computing programming

Communication between team membersCommunication between team members

Understanding existing code and Understanding existing code and modifying it without breaking itmodifying it without breaking it

AcknowledgementsAcknowledgements

Advisor Prof. Munehiro FukudaAdvisor Prof. Munehiro Fukuda

Sponsor Prof. Shinya KobayashiSponsor Prof. Shinya Kobayashi

Emory HorvathEmory Horvath

CSS301, CSS342, CSS343, CSS434, CSS301, CSS342, CSS343, CSS434, CSS442, CSS360CSS442, CSS360

XML and Java, 2XML and Java, 2ndnd Edition book Edition book

Questions ?Questions ?