========================================================================== PEG storm_with_tapestry--hemppah: ========================================================================== :Authors: Hermanni Hyytiälä :Date-Created: 2003-07-03 :Last-Modified: $Date: 2003/07/03 11:06:19 $ :Revision: $Revision: 1.1 $ :Status: Incomplete .. :Stakeholders: .. :Scope: Major|Minor|Trivial|Cosmetic .. :Type: META|Policy|Architecture|Interface|Implementation .. Affect-PEGs: - this document describes the usage of Tapestry with Storm - introduction to Tapestry - requirements - architecture overview - proposal for the usage - this document is based on Tapestry release 2.0 Issues ====== ISSUE: Do we need any code from the Oceanstore codebase, and if needed, what are the parts which are required ? Introduction to Tapestry ======================== - currently Tapestry_ implements the DOLR abstracion - other abstraction can be implemented also (e.g., DHT) - objects are *published* with object to location mappings (pointers) - differs from DHTs in that always use the closest available object - routing table consists of levels of neighbor links - each level represents a matching prefix up to a digit position in the ID - for each level, neighbor links are selected based on "closest" in network latency - along the publication process, the overlay deposits a pointer at every hop along the way - when an object is searched, a query is forwarded towards object's publication route, and when a query run into a first pointer, overlay directly forwards to the object - written in Java (currently JDK 1.3) - uses SEDA (Staged Event-Driven Architecture) framwork - approximately 57000 lines of code - shares codebase with Oceanstore Overview of SEDA ================ - asynchronous I/O library (similar to JDK 1.4's java.nio package) - stages communicate with each other by sending events - each Tapestry component is implemented as a stage - stage runs as a thread which starts by executing initialization routines and then enters an event loop - inside each JVM, a dispatcher monitors all messages and events, and delivers copies to each stage that subscribes to messages of that type - a (common) Tapestry node uses StaticTClient stage, DynamicTClient stage, Router stage and Tapestry application stage - for each stage, a config file is required to specify stage's properties (XML-like tag structure) - during the initialization phase, a stage specifies which event and messages it wants to "listen" to - for Storm, the Tapestry application stage is the most important Overview of Tapestry API ======================== TapestryPublishMsg ( ObjectGUID ) TapestryUnpublishMsg ( ObjectGUID ) TapestryRouteMsg ( NodeGUID ) TapestryLocateMsg ( ObjectGUID ) .. descriptions... Using Tapestry API from other applications ========================================== - confgig file for defining a Storm stage (Tapestry application stage) According to the `Tapestry programmer's guide`_, there three steps to write a Tapestry application: - Write the necessary messages to interface with Tapestry - Write an Eventhandler class that would serve as the application - Write configuration file(s) to define stages and specify initialization arguments Interface with Tapestry ----------------------- 1. An application must extend extending the abstract API message types, e.g.: public class StormMsg extends TapestryPublishmsg { 2. Class must have own serialization methods in order transfer messages over a network: public void constructor(byte [] data, int [] offset) public void to_bytes(byte [] data, int [] offset) 3. Do not write a working type_code method 4. Register your message class Eventhandler class ------------------ 1. Write a class which extends SEDA's existing stages, e.g., public class StormP2p extends StandardStage 2. In Eventhandler class, implement a hanleEvent method which will process registered messages 3. In Eventhandler class, implement a init method which will define the messages that are "listened" for this class Using Tapestry with Storm ========================= - in this section, we will outline the design which would allow Storm to Tapestry .. more to come Changes ======= .. there will be some changes .. _`Tapestry programmer's guide`: http://www.cs.berkeley.edu/%7Eravenben/tapestry/html/guide.html .. _Tapestry: http://www.cs.berkeley.edu/~ravenben/publications/pdf/tapestry_jsac.pdf