Implementing an Activity EPCC, University of Edinburgh Tom Sugden First International Summer School on Grid Computing, Vico Equense,

Slides:



Advertisements
Similar presentations
Chungnam National University DataBase System Lab
Advertisements

OGSA-DAI Activities OGSA-DAI for Developers GridWorld 2006, Washington DC 11 September 2006.
Querying on the Web: XQuery, RDQL, SparQL Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology.
MAP REDUCE PROGRAMMING Dr G Sudha Sadasivam. Map - reduce sort/merge based distributed processing Best for batch- oriented processing Sort/merge is primitive.
ADASS XV ACS as the Framework for Integrating Offline Data Reduction in ALMA Steve Harrington, NRAO.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
ASP.NET Best Practices Dawit Wubshet Park University.
CSE 6331 © Leonidas Fegaras XML and Relational Databases 1 XML and Relational Databases Leonidas Fegaras.
CSCC69: Operating Systems
Chapter 8Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 8 l Basic Exception Handling »the mechanics of exceptions l.
Query Execution Professor: Dr T.Y. Lin Prepared by, Mudra Patel Class id: 113.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
9/27/2006Prof. Hilfinger, Lecture 141 Syntax-Directed Translation Lecture 14 (adapted from slides by R. Bodik)
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
Inside the GDS The Engine, Activities, Data Resource Implementations and Role Mapping EPCC, University of Edinburgh Tom Sugden First.
1 Indexing and Querying XML Data for Regular Path Expressions A Paper by Quanzhong Li and Bongki Moon Presented by Amnon Shochot.
Writing Perform Documents EPCC, University of Edinburgh Amy Krause ( Tom Sugden First International Summer.
Query Execution Professor: Dr T.Y. Lin Prepared by, Mudra Patel Class id: 113.
Amy Krause Applications Consultant, EPCC Extending OGSA-DAI Principles and Architectures for Structured Data Integration: OGSA-DAI.
L22: SC Report, Map Reduce November 23, Map Reduce What is MapReduce? Example computing environment How it works Fault Tolerance Debugging Performance.
MapReduce : Simplified Data Processing on Large Clusters Hongwei Wang & Sihuizi Jin & Yajing Zhang
QCDgrid Technology James Perry, George Beckett, Lorna Smith EPCC, The University Of Edinburgh.
Introduction to Parallel Programming MapReduce Except where otherwise noted all portions of this work are Copyright (c) 2007 Google and are licensed under.
JavaScript & jQuery the missing manual Chapter 11
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
Selective and Authentic Third-Party distribution of XML Documents - Yashaswini Harsha Kumar - Netaji Mandava (Oct 16 th 2006)
C++ Code Analysis: an Open Architecture for the Verification of Coding Rules Paolo Tonella ITC-irst, Centro per la Ricerca Scientifica e Tecnologica
1 The Architectural Design of FRUIT: A Family of Retargetable User Interface Tools Yi Liu, H. Conrad Cunningham and Hui Xiong Computer & Information Science.
Stacks and Queues Introduction to Computing Science and Programming I.
Chapter 5 Java Servlets. Objectives Explain the nature of a servlet and its operation Use the appropriate servlet methods in a web application Code the.
Stacks. An alternative storage structure for collections of entities is a stack. A stack is a simplified form of a linked list in which all insertions.
INTERPRETING IMPERATIVE PROGRAMMING LAGUAGES IN EXTENSIBLE STYLESHEET LANGUAGE TRANSFORMATIONS (XSLT) Authors: Ruhsan Onder Assoc.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
CaDSR Java API Tutorial by John Kramer Tutorial Document by Manny Roble with assistance from Gene Levinson, and John Kramer.
A Query Translation Scheme for Rapid Implementation of Wrappers Presented By Preetham Swaminathan 03/22/2007 Yannis Papakonstantinou, Ashish Gupta, Hector.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
OGSA-DAI Architecture The OGSA-DAI Team
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
MapReduce How to painlessly process terabytes of data.
Chapter 6 Server-side Programming: Java Servlets
Introduction to Exception Handling and Defensive Programming.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) Stored Procedure James Wang.
1 1 EPCC 2 Curtin Business School & Edinburgh University Management School Michael J. Jackson 1 Ashley D. Lloyd 2 Terence M. Sloan 1 Enabling Access to.
Partitioning Patterns How to partition complex actors and concepts into multiple classes. Layered Initialization Filter Composite.
Li Tak Sing COMPS311F. Case study: consumers and producers A fixed size buffer which can hold at most certain integers. A number of producers which generate.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Namespaces & Exceptions Adapted from Ch. 3 slides of Data Abstraction:
Design Patterns Gang Qian Department of Computer Science University of Central Oklahoma.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Query Execution Section 15.1 Shweta Athalye CS257: Database Systems ID: 118 Section 1.
Keyword Searching Weighted Federated Search with Key Word in Context Date: 10/2/2008 Dan McCreary President Dan McCreary & Associates
Mike Jackson EPCC OGSA-DAI Architecture + Extensibility OGSA-DAI Tutorial GGF17, Tokyo.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Computer Programming with JAVA Chapter 8. Exception Handling Basic Exception Handling the mechanics of exceptions Defining and Using Exceptions some "simple"
Data Structures & Algorithms
1 Typing XQuery WANG Zhen (Selina) Something about the Internship Group Name: PROTHEO, Inria, France Research: Rewriting and strategies, Constraints,
INRIA - Progress report DBGlobe meeting - Athens November 29 th, 2002.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
Catalog of Refactoring (6) Making Method Calls Simpler.
OGF PGI – EDGI Security Use Case and Requirements
Static Detection of Cross-Site Scripting Vulnerabilities
Organization of Programming Languages
Web Ontology Language for Service (OWL-S)
Cse 344 May 4th – Map/Reduce.
Distribution Infrastructures
Presentation transcript:

Implementing an Activity EPCC, University of Edinburgh Tom Sugden First International Summer School on Grid Computing, Vico Equense, Italy

2 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy Motivation and Outline  OGSA-DAI R3 provides many activities, however, it may sometimes be necessary to develop additional activities –To support different query languages (XQuery) –To perform different kinds of transformation (STX) –To deliver results using a different mechanism (WebDAV)  Talk outline –Examine the abstract Activity class. –Walk-through the XPathStatementActivity implementation

3 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy The abstract Activity class  All Activity implementations extend the abstract Activity class Activity # mContext: Context # mElement: Element # mInputs: String[] # mOutputs: String[] + Activity( element: Element ) + setContext( context: Context ) : void # setStatus( status: int ) : void + getStatus() : int + processBlock() : void

4 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy The Lifecycle of an Activity  There are three stages to the life cycle of an Activity:  Construction  Initialisation  Processing and Output  How do these correspond to the abstract Activity class?

5 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy Construction  An Activity is constructed using a DOM Element –Conforms to the schema in the activity map. –Existing schema location: schema/xsd/activities/  The Element will be parsed to retrieve: –Input names –Output names –Configuration information (SQL expression, etc.)  Must publish the names of its inputs and outputs – Stored in the mInputs and mOutputs – Accessed via getInputs and getOutputs

6 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy Initialisation  An Activity is initialised using the setContext(Context) method.  Performs context dependent initialisation –Obtaining references to the BlockReaders, BlockWriters and User Credentials for easy access during the processing/output stage.  The Engine initialises activities and guarantees that the inputs and outputs published during construction are contained in the activity context.

7 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy Retrieving Objects from the Context  Objects can be retrieved from the Context using the get method:  Key constants are stored in –uk.org.ogsadai.service.OGSADAIConstants –uk.org.ogsadai.porttype.gds.engine.EngineImpl … BlockReader myInput = (BlockReader) context.get( EngineImpl.PIPES + mInputs[0] ); BlockWriter myOutput = (BlockWriter) context.get( EngineImpl.PIPES + mOutputs[0] ); …

8 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy Processing and Output  An activity is expected to operate in an iterative fashion. For example, a simple iteration might be: –Read block from input –Process block in some way –Write block to output  A call to the processBlock method is a request from the Engine for the Activity to provide a block of output.  Activity status is used by the Engine to determine when processing and output is complete.

9 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy Activity Status  An Activity must track its own status using the setStatus method  There are 4 states: –UNSTARTED Set before the processBlock method has been invoked. –PROCESSING Set the first time the processBlock method is invoked and remains set until the processing is complete or there is an error. –COMPLETE Set when the processing is complete and there are no more blocks to output. –ERROR Set when there is a problem of some kind during the processing of a block.

10 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy XPathStatementActivity  The activity element (excerpt from perform doc)  Passed as a DOM Element to the XPathStatementActivity constructor musicians/folksingers /c:entry/c:address

11 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy XPathStatementActivity Constructor  Parses the xPathStatement element –Extract the collection name, resource ID, namespace bindings, query expression and output name.  Publishes the Activity input and output names mInputs = new String[0]; // no inputs to activity mOutputs = new String[] { ElementParser.parseChildElementAttribute( element, Constants.ELEMENT_RESOURCE_SET_STREAM, Constants.ATTRIBUTE_NAME )};

12 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy XPathStatementActivity setContext method  Retrieves a reference to the Data Resource Implementation, output Block Writer and User Credentials for easy access during the processing and output stage. mDataResource = (XMLDBDataResourceImplementation) mContext.get( OGSADAIConstants.DATA_RESOURCE_IMPLEMENTATION ); mOutput = (BlockWriter) mContext.get( EngineImpl.PIPES + mOutputs[0] ); mUserCredentials = (String) mContext.get( OGSADAIConstants.GDS_USERCERTDN );

13 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy XPathStatementActivity processBlock method  The first time the method is invoked –Status is set to PROCESSING –Collection is retrieved from mDataResource –XPath expression is executed, generating results. –Collection is returned to mDataResource –First block of result data is put onto the output.  Each subsequent invocation –Checks whether there are any more result blocks –If so, puts the next result block onto output. –If not, the status is set to COMPLETE  If any exceptions occur –Status is set to ERROR

14 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy XPathActivityStatement processBlock method cont. try { if ( getStatus()==StatusMessage.UNSTARTED ) { setStatus(StatusMessage.PROCESSING); performStatement(); } if ( mResults.hasNext() ) { mOutput.put(mResults.next()); } else { setStatus(StatusMessage.COMPLETE); } catch (Exception e) { setStatus(StatusMessage.ERROR, e); }

15 OGSA-DAI R3 Tutorial for the International Summer School on Grid Computing, Vico Equense, Italy Conclusion  The abstract Activity class is straight-forward to implement.  A more detailed “How to Write an Activity” document is being written for distribution from the OGSA-DAI web site.  If you develop any interesting new activities, please send them to us! We may host them on the OGSA-DAI web site.