Home

Open Chord version 1.0.4 User's Manual

image

Contents

1. Ferstl O K Ludwig H Mekinic G Rieder H Schwab H J Schwab K Sinz E J Wittke M Festschrift zum 60 Geburtstag von Walter Augsburger Sinz E J Kann das Gesch ftsproze modell der Unternehmung das unterneh mensweite Datenschema abl sen Sinz E J Ans tze zur fachlichen Modellierung betrieblicher Informationssysteme Entwicklung aktueller Stand und Trends Sinz E J Serviceorientierung der Hochschulverwaltung und ihre Unterst tzung durch workflow orientierte Anwendungssysteme Ferstl O K Sinz E J Amberg M Stichw rter zum Fachgebiet Wirtschaftsinfor matik Erscheint in Broy M Spaniol O Hrsg Lexikon Informatik und Kom munikationstechnik 2 Auflage VDI Verlag D sseldorf 1996 N N 37 1996 38 1996 39 1996 40 1997 41 1997 42 1997 43 1997 44 1997 45 1998 46 1998 47 1998 48 1998 49 1998 Ferstl O K Sinz E J Flexible Organizations Through Object oriented and Trans action oriented Information Systems July 1996 Ferstl O K Sch fer R Eine Lernumgebung f r die betriebliche Aus und Weiter bildung on demand Juli 1996 Hazebrouck J P Einsatzpotentiale von Fuzzy Logic im Strategischen Manage ment dargestellt an Fuzzy System Konzepten f r Portfolio Ans tze Sinz E J Architektur betrieblicher Informationssysteme In Rechenberg P Pom berger G Hrsg Handbuch der Informatik Hanser
2. 3 4 Examples 13 O Oo N P N Be 5 6 T localURL new URL protocol localhost 8080 catch MalformedURLException e throw new RuntimeException e Chord chord new de uniba wiai lspi chord service impl ChordImpl try chord create localURL catch ServiceException e throw new RuntimeException Could not create DHT z ChordImpl implements both interfaces An instance of it can be created with help of its public constructor Listing 7 shows an example for creation of a new network For this purpose a URL for the ocsocket protocol is created This URL becomes the URL of the Open Chord peer It is recommended to automatically determine the host name and IP address of a peer with help of java net InetAddress and to use the hosts IP address as the host part of the URL 3 4 2 Joining an existing Chord overlay network Only the first peer of an Open Chord network can create a network To add peers to an existing network one of the join methods of Chord or AsynChord has to be invoked Listing 8 shows how an existing network can be joined Listing 8 Joining an Open Chord network 1 public static void main String args 2 de uniba wiai 1 spi chord service PropertiesLoader loadPropertyFile String protocol URL KNOWNPROTOOOLS get URL SOCKET PROTOCOL URL localURL null try localURL new URL protocol localhost 8181 catch Mal
3. Transformation vom Entity Relationship Modell in das Strukturierte Entity Relationship Modell Sinz E J Datenmodellierung im Strukturierten Entity Relationship Modell SERM Ferstl O K Sinz E J Glossar zum Begriffsystem des Semantischen Objektmo dells Sinz E J Popp K M Zur Ableitung der Grobstruktur des konzeptuellen Schemas aus dem Modell der betrieblichen Diskurswelt Esswein W Locarek H Objektorientierte Programmierung mit dem Objekt Rol lenmodell Esswein W Das Rollenmodell der Organsiation Die Ber cksichtigung aufbauor ganisatorische Regelungen in Unternehmensmodellen Schwab H J EISREVU Modellierungssystem Benutzerhandbuch Schwab K Die Implementierung eines relationalen DBMS nach dem Client Server Prinzip Schwab K Konzeption Entwicklung und Implementierung eines computerge st tzten B rovorgangssystems zur Modellierung von Vorgangsklassen und Ab wicklung und berwachung von Vorg ngen Dissertation 27 28 N Z u 18 1993 19 1994 20 1994 21 1994 22 1994 23 1994 24 1994 25 1994 26 1995 27 1995 28 1995 30 1995 31 1995 32 1995 33 1995 34 1995 35 1995 36 1996 A LIST OF PREVIOUS UNIVERSITY OF BAMBERG REPORTS Ferstl O K Sinz E J Der Modellierungsansatz des Semantischen Objektmodells Ferstl O K Sinz E J Amberg M Hagemann U Malischewski C Tool Bas
4. Verlag M nchen 1997 Sinz E J Analyse und Gestaltung universit rer Gesch ftsprozesse und Anwen dungssysteme Angenommen f r Informatik 97 Informatik als Innovationsmotor 27 Jahrestagung der Gesellschaft f r Informatik Aachen 24 26 9 1997 Ferstl O K Sinz E J Hammel C Schlitt M Wolf S Application Objects fachliche Bausteine f r die Entwicklung komponentenbasierter Anwendungssy steme Angenommen f r HMD Theorie und Praxis der Wirtschaftsinformatik Schwerpunkheft ComponentWare 1997 Ferstl O K Sinz E J Modeling of Business Systems Using the Semantic Object Model SOM A Methodological Framework Accepted for P Bernus K Mertins and G Schmidt ed Handbook on Architectures of Information Systems International Handbook on Information Systems edited by Bernus P Blazewicz J Schmidt G and Shaw M Volume I Springer 1997 Ferstl O K Sinz E J Modeling of Business Systems Using SOM 2 Edition Appears in P Bernus K Mertins and G Schmidt ed Handbook on Architectu res of Information Systems International Handbook on Information Systems edi ted by Bernus P Blazewicz J Schmidt G and Shaw M Volume I Springer 1998 Ferstl O K Schmitz K Zur Nutzung von Hypertextkonzepten in Lernumgebun gen In Conradi H Kreutz R Spitzer K Hrsg CBT in der Medizin Metho den Techniken Anwendungen Proceedings zum Workshop in Aachen 6 7 Juni 1997 1 Auflage Aa
5. insertN and removes the pro vided String stored with the provided key Example oc gt removeN key test value test Value test with key test removed oc gt refsN This command shows the finger table successor list and predecessor of the Open Chord peer which is running in the JVM of the console Example oc gt refsN Node OC Finger table 7D 0 158 Successor List 7D Predecessor 7D oc gt entriesN This command shows the data stored by the Open Chord peer which is running in the JVM of the console Example oc gt entriesN Entries key AQ value key A9 value test oc gt leaveN This command causes the peer to leave the DHT in an orderly fashion so that it notifies its predecessor and successors about its departure Example oc gt leaveN Leaving network oc gt 25 5 Limitations of current implementation The current Open Chord implementation does not allow remote class loading which makes it necessary that all implementations of Key and all class definitions of objects which should be stored within the DHT must be locally available on each peer There exist two possibilities to circumvent this problem 1 A class that is supposed to be used as a Key or data within the DHT can be itself saved within the DHT with its fully qualified name as key This classes can then be loaded by a custom ClassLoader that loads classes from the DHT Details on class load
6. model taking care of information reliability as well as privacy issues e Visual Programming and Design Languages The goal of this long term effort is the uti litization of visual metaphores and languages as well as visualization techniques to make design and programming languages more understandable and hence easy to use More information about our work i e projects papers and software is available at our ho mepage If you have any questions or suggestions regarding this report or our work in general don t hesitate to contact me at guido wirtz wiai uni bamberg de Guido Wirtz Bamberg April 2006 Open Chord version 1 0 4 User s Manual Sven Kaffille and Karsten Loesing Lehrstuhl f r Praktische Informatik Fakult t WIAI http open chord sourceforge net Abstract In recent years peer to peer networks developed from unstructured to structured overlay networks Structured peer to peer overlay networks facilitate bounded number of mes sages in the number of peers for querying and publishing content opposed to unstructured networks which usually flood the network with messages To prevent the messages from over flooding the network they have a bounded life time which can cause that some published content may not be found Structured peer to peer networks guarantee that all published con tent can be found One well known structured overlay network is the chord distributed hash table An implementation of chord is only avail
7. public ID getID 6 public void setID ID nodelD 7 throws IllegalStateException 8 public void create 9 throws ServiceException 0 public void create URL localURL 1 throws ServiceException 2 public void create URL localURL ID locallD 3 throws ServiceException 4 public void join URL bootstrapURL throws ServiceException 6 public void join URL localURL URL bootstrapURL 7 throws ServiceException 8 public void join URL localURL ID localID URL bootstrapURL 9 throws ServiceException 20 public void leave 21 throws ServiceException 22 The join methods allow a peer to join an existing Open Chord network These methods cor respond to the functionality of the three create methods regarding the unique identifier of a 10 3 USING OPEN CHORD peer but need a further parameter which is a URL of a so called bootstrap peer that can be used by the peer that wants to join to get access to the existing DHT How such a URL can be found is out of scope of Open Chord and depends on the application which is built on top of it Although Open Chord handles crashes and desertion of peers transparently it is recommended for a peer to announce to others when it leaves the Open Chord network For this purpose the two interfaces provide the method leave By invocation of this method the peer makes sure that the routing tables of its neighbors immediately reflect the change within the network In addition to these meth
8. that represents a Java application that uses Open Chord On the low est layer the implementation of the employed communication protocol based on a network communication protocol e g Java Sockets is located On top of this communication layer a communication abstraction layer resides that provides interfaces which abstract from the actually used communication protocol Java application ane interface Chord intertce Chord logic RE Proxy Endpoint Communication abstraction layer N A Communication Proxylmpl Endpointimpl layer Figure 1 Architecture of Open Chord For this purpose two abstract classes have been developed which represent the communication abstraction layer and provide factory methods to create instances of themselves for a specific communication protocol The communication abstraction layer provides interfaces for syn chronous communication between peers Instances of class represent de uniba wiai lspi chord com Pr Proxy references to remote peers participating in an Open Chord overlay network For each 8 3 USING OPEN CHORD node in a Open Chord network an instance of de uniba wiai lspi chord com Endpoint Endpoint provides a connection point for remote peers with help of Proxy for a specific communication protocol The concrete implementations for a communication protocol are de termined with help of the URL of a
9. BAMBERGER BEITR GE ZUR WIRTSCHAFTSINFORMATIK UND ANGEWANDTEN INFORMATIK ISSN 0937 3349 Nr 74 Open Chord version 1 0 4 User s Manual Sven Kaffille and Karsten Loesing October 2007 FAKULT T WIRTSCHAFTSINFORMATIK UND ANGEWANDTE INFORMATIK OTTO FRIEDRICH UNIVERSIT T BAMBERG Distributed and Mobile Systems Group Otto Friedrich Universit t Bamberg Feldkirchenstr 21 96052 Bamberg GERMANY Prof Dr rer nat Guido Wirtz http www uni bamberg de en fakultaeten wiai faecher informatik 1spi Due to hardware developments strong application needs and the overwhelming influence of the net in almost all areas distributed and mobile systems especially software systems have become one of the most important topics for nowadays software industry Unfortunately distri bution adds its share to the problems of developing complex software systems Heterogeneity in both hardware and software concurrency distribution of components and the need for inter operability between different systems complicate matters Moreover new technical aspects like resource management load balancing and deadlock handling put an additional burden onto the developer Although subject to permanent changes distributed systems have high requirements w r t dependability robustness and performance The long term common goal of our research efforts is the development implementation and evaluation of methods helpful for the development of robust
10. Entries key A9 value key A9 value test Node mypeerO Entries Node mypeer3 Entries key A9 value key A9 value test Node mypeer2 Entries key A9 value key A9 value test Node mypeerl1 Entries Node mypeer4 Entries oc gt entries node mypeer5 Retrieving node mypeer5 Entries key AQ value key AQ value test oc gt In this example it can be noted that data is replicated twice as the property de uniba wiai lspi chord service impl ChordImpl successors see section 2 4 has been set to 2 Therefore three peers have stored the data inserted in the previous example The 4 1 Simulating a Chord overlay network in one JVM 21 property de uniba wiai lspi chord data ID number of displayed bytes has been set to 1 For this reason the first byte of the key of data item test are displayed as a hexadecimal number e retrieve This command can be used to retrieve all data stored for a provided key within the DHT For this purpose two parameters are required node which determines the peer from that the retrieval is started and key that defines the key to lookup Example oc gt retrieve node mypeerl key test Values associated with key test test Values retrieved from node mypeer oc gt e remove This command removes previously inserted data from the Chord DHT and its parameters are the same as for the insert command Example oc gt remov
11. Mining Ansatz zur Analyse betriebswirtschaftlicher Daten Sinz E J B hnlein M Plaha M Ulbrich vom Ende A Architekturkonzept eines verteilten Data Warehouse Systems f r das Hochschulwesen Angenommen f r WI IF 2001 Augsburg 19 21 September 2001 Sinz E J Wismans B Anforderungen an die IV Infrastruktur von Hochschulen Angenommen f r Workshop Unternehmen Hochschule 2001 im Rahmen der Jahrestagung der Gesellschaft f r Informatik Wien 25 28 September 2001 nderung des Titels der Schriftenreihe Bamberger Beitr ge zur Wirtschaftsinformatik in Bamberger Beitr ge zur Wirtschaftsinformatik und Angewandten Informatik ab Nr 61 Nr Nr N N 61 2002 62 2002 63 2005 64 2005 65 2006 66 2006 67 2006 68 2006 69 2007 70 2007 71 2007 72 2007 73 2007 74 2007 Gore R Mendler M de Paiva V Hrsg Proceedings of the International Workshop on Intuitionistic Modal Logic and Applications IMLA 2002 Copenhagen July 2002 Sinz E J Plaha M Ulbrich vom Ende A Datenschutz und Datensicherheit in einem landesweiten Data Warehouse System f r das Hochschulwesen Erscheint in Beitr ge zur Hochschulforschung Heft 4 2002 Bayerisches Staatsinstitut f r Hochschulforschung und Hochschulplanung M nchen 2002 Aguado J Mendler M Constructive Semantics for Instantaneous Reactions Ferstl O K Lebensl
12. Nr Nr Nr 1 1989 2 1990 3 1990 4 1990 5 1990 6 1991 7 1991 8 1991 9 1992 10 1992 11 1992 12 1992 13 1992 14 1992 15 1992 16 1992 17 1993 Stand Oktober 26 2007 Augsburger W Bartmann D Sinz E J Das Bamberger Modell Der Diplom Stu diengang Wirtschaftsinformatik an der Universit t Bamberg Nachdruck Dez 1990 Esswein W Definition Implementierung und Einsatz einer kompatiblen Daten bankschnittstelle f r PROLOG Augsburger W Rieder H Schwab J Endbenutzerorientierte Informationsgewin nung aus numerischen Daten am Beispiel von Unternehmenskennzahlen Ferstl O K Sinz E J Objektmodellierung betrieblicher Informationsmodelle im Semantischen Objektmodell SOM Nachdruck Nov 1990 Ferstl O K Sinz E J Ein Vorgehensmodell zur Objektmodellierung betrieblicher Informationssysteme im Semantischen Objektmodell SOM Augsburger W Rieder H Schwab J Systemtheoretische Repr sentation von Strukturen und Bewertungsfunktionen ber zeitabh ngigen betrieblichen numeri schen Daten Augsburger W Rieder H Schwab J Wissensbasiertes inhaltsorientiertes Retrie val statistischer Daten mit EISREVU Ein Verarbeitungsmodell f r eine modulare Bewertung von Kennzahlenwerten f r den Endanwender Schwab J Ein computergest tztes Modellierungssystem zur Kennzahlenbewertung Gross H P Eine semantiktreue
13. P2P network The structure of the P2P network e g ordering of nodes on a ring is exploited to quickly find and store desired data Open Chord is an open Java based implementation of the Chord DHT described by Stoica et al in SMK 01 It provides an interface for Java applications to take part as a peer within a DHT and to store and retrieve arbitrary data from this DHT So Java based P2P applications can benefit from properties of DHTs Open Chord is called open as it is distributed under GNU General Public License GPL so that it can be used and extended for own purposes for free and as desired In the following section this manual first describes what is required to and how to install Open Chord For this purpose the compilation process and configuration of Open Chord is explained The third section explains how the Application Programming Interface API of Open Chord can be used by any Java Application To get a better understanding of what Open Chord is doing the architecture of Open Chord and its interfaces and their usage are described As Open Chord comes with a command line interface that can be used to test an instance of an Open Chord DHT or create one DHT consisting of several nodes within one Java Virtual Machine section four deals with the Open Chord console Section five describes current limitations of Open Chord 1 1 Features of Open Chord Open Chord provides the following features to a Java application e Easy to use int
14. able in C but not in Java which is used widely and often in computer science education This manual describes an open source implementation of chord in Java called Open Chord and how it can be used in Java based applications It provides a console based experimentation environment to explore the functionality of chord as well Keywords Chord Java Distributed Hash Table Contents 1 What is Open Chord 1 1 Pesture of Open Chord ri Drau Dres Dre a Da a Da ER Seto 2 Setting up Open Chord a s si seg Nein dg Stee fs deg Ste Oo keg Nat Hooded SG we beg se weg BG 2 2 AUIS PANAGIOTIS za ai re the GEGE Behe fe teat a 2 3 Compilation 2 cti Ahk Sh ace a an wee he le De wes Ss lo Ma weet Ga an ge a as A ore Hcy 2A Configuratio d ee asc sn hak ae a a ag na e a aa a AT ahah a al ara DED SEIXECULIONE ese Len en LLO eee e CLORO e en ee et ge ne Be ae ne Be ate he 3 Using Open Chord 3 1 Architecture of Open Chord u 2 m ep ds Seta Bee o do el en 3 2 Available communication protocols ara Aa ee A RRS 2 0 3 3 The Chord and AsynChord interfaces 2a es o ti a a SMa Examples er su ee re eure re re re u a 3 4 1 Creating a new Chord overlay network o aooaa 3 4 2 Joining an existing Chord overlay network 3 4 3 Leaving a network oa yo gl hy AA TOA a eg a AA 3 4 4 Inserting and Removing data Zr yes tee eS ee le 3 45 Data retrieval S56 Ta ar A re PA ek BY gold Bi ae 4 The Open Chord Console 4 1 Simulating a Chord overl
15. ame of this peer must be provided to these commands Names of peers have to be unique within the JVM and an URL of a peer that uses the oclocal protocol contains the name of the peer as the host part of the URL e g oclocal mypeer These commands are e create A new network can be created or an existing network can be joined with this command To create a new network this command expects one name of a peer provided with help of the names parameter e g create names mypeer If a network exists this command can be used to create a number of peers at once The names of the peers must be concatenated with help of _ In addition to the names a list of bootstrap peers is required These list must at least contain one name of an existing peer If there is more than one bootstrap peer the names must again be separated by _ Example oc gt create names mypeer0 Creating new chord network oc gt create names mypeeri_mypeer2 bootstraps mypeerO Starting node with name mypeer1 with bootstrap node mypeerO Starting node with name mypeer2 with bootstrap node mypeerO oc gt create names mypeer3_mypeer4_mypeerb bootstraps mypeerO_mypeeri Starting node with name mypeer3 with bootstrap node mypeerO Starting node with name mypeer4 with bootstrap node mypeer1 Starting node with name mypeer5 with bootstrap node mypeer1 oc gt First a new network with a single peer with
16. and easy to use software for com plex systems in general while putting a focus on the problems and issues regarding the software development for distributed as well as mobile systems on all levels Our current research acti vities are focussed on different aspects centered around that theme e Robust and adaptive Service oriented Architectures Development of design methods lan guages and middleware to ease the development of SOAs with an emphasis on provable correct systems that allow for early design evaluation due to rigorous development me thods and tools Additionally we work on approaches to autonomic components and container support for such components in order to ensure robustness also at runtime e Agent and Multi Agent MAS Technology Development of new approaches to use Multi Agent Systems and negotiation techniques for designing organizing and optimizing com plex distributed systems esp service based architectures e Peer to Peer Systems Development of algorithms techniques and middleware suitable for building applications based on unstructured as well as structured P2P systems A specific focus is put on privacy as well as anonymity issues e Context Models and Context Support for small mobile devices Investigation of techni ques for providing representing and exchanging context information in networks of small mobile devices like e g PDAs or smart phones The focus is on the development of a tru ly distributed context
17. anges Lernen und virtuelle Lehre globale und lokale Verbesserungspotenziale Erschienen in Kerres Michael Keil Slawik Reinhard Hrsg Hochschulen im digitalen Zeitalter Innovationspotenziale und Strukturwandel S 247 263 Reihe education quality forum herausgegeben durch das Centrum f r eCompetence in Hochschulen NRW Band 2 M nster New York M nchen Berlin Waxmann 2005 Sch nberger Andreas Modelling and Validating Business Collaborations A Case Study on RosettaNet Markus Dorsch Martin Grote Knut Hildebrandt Maximilian R glinger Matthias Sehr Christian Wilms Karsten Loesing and Guido Wirtz Concealing Presence Information in Instant Messaging Systems April 2006 Marco Fischer Andreas Gr nert Sebastian Hudert Stefan K nig Kira Lenskaya Gregor Scheithauer Sven Kaffille and Guido Wirtz Decentralized Reputation Management for Cooperating Software Agents in Open Multi Agent Systems April 2006 Michael Mendler Thomas R Shiple G rard Berry Constructive Circuits and the Exactness of Ternary Simulation Sebastian Hudert A Proposal for a Web Services Agreement Negotiation Protocol Framework to be announced Thomas Meins Integration eines allgemeinen Service Centers fiir PC und Medientechnik an der Universitat Bamberg Analyse und Realisierungs Szenarien to be announced Andreas Griinert Life cycle assistance capabilities of cooperating Software Agents for Virtual Enterprises to be announced Michael M
18. at is used to configure log4j If the file is available from the classpath it can just be the file name If the file is located in a directory not on the classpath this must be the full path to the file in a format suitable for your operating system e de uniba wiai lspi Chord data ID number of displayed bytes This property defines how many bytes of an identifier of a peer or data item within the DHT should be displayed in logging output The properties to configure maintenance and replication of the Open Chord DHT are e de uniba wiai lspi chord service impl ChordImpl successors This property must be set to an integer value that represents the number of replicas that are created from a data value e de uniba wiai lspi chord service impl ChordImpl StabilizeTask start This property must be set to an integer value that specifies the number of seconds to wait until the task to stabilize the Open Chord network is started after Open Chord has been initialized e de uniba wiai lspi chord service impl ChordImpl StabilizeTask interval This property specifies with help of an integer value the timespan in seconds between successive executions of the task to stabilize the Open Chord network e de uniba wiai lspi chord service impl ChordImpl FixFingerTask start This property must be set to an integer value that specifies the number of seconds to wait until the task to fix the routing table of an Open Chord peer is started after Open Chord has
19. ay network in one JVM 4 2 Connecting to and using a remote network o 5 Limitations of current implementation Bibliography 12 12 13 14 14 17 18 19 23 25 26 II A List of previous University of Bamberg reports 27 1 What is Open Chord As Peer to Peer P2P computing becomes more important for distributed applications which have to be reliable load balanced and scalable the underlying technologies must also provide these properties This is also important for data storage in P2P networks In recent years new data structures so called distributed hash tables DHT have been shown to provide a reliable load balanced and scalable mechanism to store data in a P2P network DHT differ from P2P networks developed before e g Gnutella in their structural organization While DHTs are based on structured networks where for example the nodes in the network are organized in a ring former P2P networks had no structure which ordered the nodes of the networks in a particular way Therefore these networks could not provide guarantees for data stored in the network to be found The structure of DHTs allows to exactly locate desired data with help of a unique key associated to this data similar to conventional hash tables In a DHT every peer of the underlying P2P network takes responsibility for certain data values that it must store and provide to the other participants of the
20. been initialized e de uniba wiai lspi chord service impl ChordImpl FixFingerTask interval This property specifies with help of an integer value the timespan in seconds between successive executions of the task to fix the routing table of an Open Chord peer e de uniba wiai lspi chord service impl ChordImpl CheckPredecessorTask start This property must be set to an integer value that specifies the number of seconds to 6 2 SETTING UP OPEN CHORD wait until the task to check the predecessor of an Open Chord peer is started after Open Chord has been initialized e de uniba wiai lspi chord service impl ChordImpl CheckPredecessorTask interval This property specifies with help of an integer value the timespan in seconds between successive executions of the task to check the predecessor of an Open Chord peer The properties to configure the number of concurrently serviceable requests from other peers are e de uniba wiai lspi chord com socket InvocationThread corepoolsize This property must be set to an integer value that specifies the number of threads that are always available to serve incoming requests from other Open Chord peers e de uniba wiai lspi chord com socket InvocationThread maxpoolsize This property must be set to an integer value which specifies the maximum number of threads that can be available to serve incoming requests from other Open Chord peers e de uniba wiai lspi chord com socket InvocationThread keepalivetim
21. chen Verlag der Augustinus Buchhandlung Ferstl O K Datenkommunikation In Schulte Ch Hrsg Lexikon der Logistik Oldenbourg Verlag M nchen 1998 Sinz E J Proze gestaltung und Proze unterst tzung im Pr fungswesen Erschie nen in Proceedings Workshop Informationssysteme f r das Hochschulmanage ment Aachen September 1997 Sinz E J Wismans B Das Elektronische Pr fungsamt Erscheint in Wirt schaftswissenschaftliches Studium WiSt 1998 Haase O Henrich A A Hybrid Respresentation of Vague Collections for Distri buted Object Management Systems Erscheint in IEEE Transactions on Know ledge and Data Engineering Henrich A Applying Document Retrieval Techniques in Software Engineering Environments In Proc International Conference on Database and Expert Systems 29 30 Nr 50 1999 Nr 51 1999 N 52 1999 Nr 53 1999 Nr 54 1999 N 55 2000 Nr 56 2000 Nr 57 2000 Nr 58 2000 Nr 59 2001 N 60 2001 A LIST OF PREVIOUS UNIVERSITY OF BAMBERG REPORTS Applications DEXA 98 Vienna Austria Aug 98 pp 240 249 Springer Lec ture Notes in Computer Sciences No 1460 Henrich A Jamin S On the Optimization of Queries containing Regular Path Expressions Erscheint in Proceedings of the Fourth Workshop on Next Genera tion Information Technologies and Systems NGITS 99 Zikhron Yaakov Israel July 1999 Springe
22. ctly manage data storage The method insert Key key Serializable entry inserts the provided instance entry into the DHT associated with the given key This key can later on be used to retrieve or remove entry In order to remove an entry the entry and its key must be known as indicated by the method remove Key key Serializable entry It is important to note that with the current implementation of Open Chord class definitions the byte code of classes whose instances are used as Key or as data associated with a Key must be present on every peer within the network as Open Chord does not support class loading from remote peers The methods of the Chord interface are synchronous and block the thread that invokes them until the operation has been performed and a result has been obtained This may not be desired 11 A peer does not crash but leaves the network without notifying other peers 3 3 The Chord and AsynChord interfaces 11 in all cases as invocation of the methods described above may take some time While data is retrieved it may be possible that the same thread which wants the data wants to insert remove or retrieve some other data in parallel For this purpose Open Chord provides an interface with methods that allow asynchronous processing of data retrieval removal and storage These methods can be divided into two kinds The first kind of methods presented in listing 4 in addition to the provided Key or data requires a
23. d by the retrieval 3 Asynchronous retrieval with AsynChord retrieveAsync Key key This method immediately returns an instance of ChordRetrievalFuture which can be used to obtain the result of the retrieval with help of the method ChordRetrievalFu ture getResult This method works similar to ChordFuture waitForBeingDone but returns a Set possibly empty if no data is associated with the key used for retrieval as soon as the retrieval has finished If retrieval fails a ServiceException is raised As the thread may be interrupted an InterruptedException is thrown in that case For this reason if the thread invoking getResult must wait until retrieval is finished the invocation of getResult must be guarded by a while loop as described earlier for ChordFuture waitForBeingDone 18 4 THE OPEN CHORD CONSOLE 4 The Open Chord Console For testing purposes Open Chord provides a console from which a network can be created For this console a Key implementation based on String similar to that described in the previous section is being used Instances of String are used as data There are two possibilities two create join an Open Chord network The first one uses the oclocal protocol to create a network within one JVM Therefore many local peers can be created with help of the console The other possibility is to instantiate a single peer that uses ocsocket protocol to create or join a remote Open Chord network In order to start the conso
24. e This property defines in seconds how long threads for incoming requests are allowed to be kept alive when they are idle 2 5 Execution You may start Open Chord either by starting the Open Chord console see section 4 or by initializing an Open Chord peer and invoking API methods see section 3 in your own project In the latter case you need to make sure that the classpath is set correctly Apart from the Open Chord classes you need to include the config directory and maybe a log4j library in the classpath The config directory contains a property file for Open Chord which is required to run Open Chord This properties must be loaded before intializing Open Chord or you may also set the properties specified in chord properties within your code with help of System setProperty String String 3 Using Open Chord After Open Chord has successfully been compiled and set up it can be used from any Java application This section describes the interfaces of Open Chord and how they can be used For this purpose first a short overview of the architecture and the available communication protocols is provided Afterward the interfaces relevant to an application programmer and their usage in typical use cases as e g creating and joining a network or inserting and retrieving data from the DHT are explained 3 1 Architecture of Open Chord The architecture of Open Chord is divided into three layers These layers are shown in figure 1 below the layer
25. e node mypeer1 key test value test Value test with key test removed successfully from node mypeerl1 oc gt After execution of this command the command entries should yield no peer that holds any data e refs This command prints the reference a peer has in its finger table SMK O1 It requires one parameter node that defines the name of the node whose finger table is shown Example oc gt refs node mypeer3 Retrieving node mypeer3 Finger table E5 0 155 19 156 157 21 158 BE 159 oc gt This command prints the identifier of a peer in the finger table and behind an identifier a range of numbers This range represents the indexes the node with that identifier has in the finger table 22 4 THE OPEN CHORD CONSOLE e successors This command prints out the successors SMK 01 of a peer It requires one parameter node that defines the name of the node whose finger table is shown Example oc gt successors node mypeerl Successor List 19 21 oc gt shutdown This command can be used to orderly shutdown a number of nodes of the Chord DHT that then notify their predecessors and successors in the Chord ring so that they can update their finger tables and successor lists This command requires one parameter called names that defines a list of names of peers in a similar fashion as the create command This command has an optional parameter all which shuts down all peers E
26. ed Business Process Modeling Using the SOM Approach Ferstl O K Sinz E J From Business Process Modeling to the Specification of Distributed Business Application Systems An Object Oriented Approach 1 edition June 1994 Ferstl O K Sinz E J Multi Layered Development of Business Process Models and Distributed Business Application Systems An Object Oriented Approach 2 edition November 1994 Ferstl O K Sinz E J Der Ansatz des Semantischen Objektmodells zur Modellie rung von Gesch ftsprozessen Augsburger W Schwab K Using Formalism and Semi Formal Constructs for Modeling Information Systems Ferstl O K Hagemann U Simulation hierarischer objekt und transaktionsorien tierter Modelle Sinz E J Das Informationssystem der Universitat als Instrument zur zielgerichteten Lenkung von Universit tsprozessen Wittke M Mekinic G Kooperierende Informationsr ume Ein Ansatz f r ver teilte F hrungsinformationssysteme Ferstl O K Sinz E J Re Engineering von Gesch ftsprozessen auf der Grundlage des SOM Ansatzes Ferstl O K Mannmeusel Th Dezentrale Produktionslenkung Erscheint in CIM Management 3 1995 Ludwig H Schwab K Integrating cooperation systems an event based approach Augsburger W Ludwig H Schwab K Koordinationsmethoden und werkzeuge bei der computergest tzten kooperativen Arbeit Ferstl O K Mannmeusel T Gestaltung industrieller Gesch ftsprozesse Gunzenh user R Duske A
27. endler Gerald L ttgen Is Observational Congruence on u Expressions Axiomatisable in Equational Horn Logic Martin Schissler to be announced Sven Kaffille Karsten Loesing Open chord version 1 0 4 User s Manual 31
28. erfaces for synchronous and asynchronous utilization of a Chord SMK 01 DHT e Possibility to store every serializable Java object within the DHT e Creation of custom keys to associated data with Sun Microsystems Java 2 platform standard edition j2se 5 0 http java sun com j2se 1 5 0 download jsp 2Free Software Foundation Gnu general public license http www gnu org copyleft gpl html 1 WHAT IS OPEN CHORD Transparent maintenance of Chord DHT routing Transparent replication of stored data A remote communication protocol based on Java sockets A local communication protocol for testing and presentation purposes 2 Setting up Open Chord This section describes what is required to use Open Chord and how to compile and configure it 2 1 Requirements As Open Chord is Java based it can be run on any Operating System for which a Java Virtual Machine for Java 5 0 is available In order to be compiled Open Chord requires e Java 2 Platform Standard Edition Development Kit 5 0 e the Apache Ant build tool e anda library of Apache log4j logging framework that must be placed in the 1ib directory and can be obtained from the Apache Software Foundation In order to be executed Open Chord just requires a Java 2 Platform Standard Edition Runtime Environment 5 0 Log4j is only required to compile Open Chord and does not need to be available at runtime 2 2 Installation In order to install Open Chord it has t
29. formedURLException e throw new RuntimeException e URL bootstrapURL null try bootstrapURL new URL protocol localhost 8080 catch MalformedURLException e throw new RuntimeException e Chord chord new de uniba wiai lspi chord service impl ChordImpl 14 3 USING OPEN CHORD 17 try 18 chord join localURL bootstrapURL 19 catch ServiceException e 20 throw new RuntimeException Could not join DHT e 21 22 po 23 This works similar to network creation but additionally a URL of a peer which already is part of the network that should be joined is required This peer is called a bootstrap peer and its URL is called a bootstrap URL How this URL is obtained depends on the application that wants to use the DHT Both URLs used in listing 8 must represent an URL of the same protocol Please note that the URL of a peer must reflect the real host name of the host on which the peer is located In this examples we used localhost so that the examples can only be executed on one machine It is possible to provide the host name as a parameter to the main method or to determine it with help of the Java API java net InetAddress It is also possible to create more than one chord peer that uses the ocsocket protocol within one JVM 3 4 3 Leaving a network To leave a network the leave method of Chord or AsynChord has to be invoked 3 4 4 Inserting and Removing data In orde
30. found in package de uniba wiai lspi chord com socket This protocol facilitates reliable communication between Open Chord peers based on TCP IP sockets The protocol which is used by an Open Chord peer is determined by its URL An implemen tation of URL is provided in package de uniba wiai lspi chord data This URL currently provides some public constants which can be used to create Strings representing an appro priate URL for one of the protocols described above The String array URL KNOWN_PROTOCOLS contains the names of the two protocols and the integer constants URL LOCAL_PROTOCOL and URL SOCKET_PROTOCOL represent their corresponding index So this can be used to cre ate appropriate Strings representing an URL which can be used with the public constructor URL String url 8This mapping from communication protocol with help of URL to the Proxy of Endpoint implementation is currently hard coded within the corresponding factory methods For details how the Chord DHT works refer to SMK 01 10This should be changed in future releases to allow addition of custom communication protocols without change of implementation of URL and factory methods of Proxy and Endpoint 3 3 The Chord and AsynChord interfaces 9 3 3 The Chord and AsynChord interfaces As presented before figure 1 Open Chord provides two interfaces which can be used by an application built on top of Open Chord to retrieve remove and store data from to the underl
31. hord network that runs within one JVM The second kind of commands is designed to be used with a single peer that is connected to other remote peers to create a Open Chord network The next sections 4 1 4 2 describe these commands and how they can be used There are also some other commands available from the console To get a list of available commands from the console type help at the prompt and press enter Every listed command 4 1 Simulating a Chord overlay network in one JVM 19 also provides help to the user when it is issued with the parameter h or help To close the console type exit In order to prevent the console from becoming unreadable if classes use System out System out is redirected and the output is saved in memory To display this output type displaySystemOut Output of System err is still printed to the console Some times it may be useful to repeatedly execute the same commands in the same order For this purpose a macro can be created This macro is a simple text file which contains a command in each line This macro file can be loaded and executed with help of the executeMacro command 4 1 Simulating a Chord overlay network in one JVM With the oclocal communication protocol for Open Chord it is possible to create an Open Chord network within one JVM For this purpose the console provides commands that can be used to e g create a network insert data or crash a node As most of the commands affect only one peer the n
32. ing can be found in Chr05 Then just the Key implementation for keys of class definitions must be present on each peer 2 Another possibility is to store objects in their byte representation within the DHT To convert objects to their byte representation and recreate an object from this representation the classes ByteArrayOutputStream and ByteArrayInputStream in conjunction with ObjectOutputStream and ObjectInputStream provided in the java io package can be used This would only provide the possibility to store objects of arbitrary classes as data within the DHT For keys there still must be a common Key implementation that is available on each peer It is also not possible to easily exchange the communication protocol ocsocket or oclocal of Open Chord as the available protocols are hard coded into the URL class Based on this the factory methods for the corresponding Proxy and Endpoint implementations are also hard coded Therefore to add a new communication protocol to Open Chord not only classes that implement the protocol must be created but also the factory methods for Proxy and Endpoint implementations must be changed and the Proxy and Endpoint classes have to be recompiled This should be changed into a mechanism that allows registration of new communication protocols and their implementing classes Open Chord currently assumes that every participant of the DHT is trustworthy Therefore every participant can remove arbitrary data This
33. le the following command has to be executed java cp OC_DIR build classes 0C_DIR config 0C_DIR 1lib log4j jar de uniba wiai lspi chord console Main OC_DIR is the directory where the directory structure of Open Chord as described in section 2 2 has been created If console execution is successful your screen looks as presented in figure 2 Note that the reference to log4j in the classpath cp is optional as log4j is not required to use Open Chord system32 cmd exe This program is free software you can redistribute it and or modify it under the terms of the GNU General Public License as published hy the Free Software Foundation either version 2 of the License or at your option any later version A copy of the license can be found in the license txt file supplied with this software or at http www gnu org copyleft gp1 html main INFO de uniba wiai lspi util logging Log4jLogger Configuring log4j with log4j pr operties main INFO de uniba wiai lspi util logging Log4jLogger log4j configured with log4j pro perties Welcome to Open Chord test environment lt C gt 2664 2665 Distributed and Mobile Systems Group University of Bamberg Type help for a list of available commands Console ready oc gt Figure 2 Open Chord console When the console is running it waits for commands to be typed in There are two kinds of commands The first kind of commands is designed to be used with an Open C
34. lling thread until the end of the operation This method throws a ServiceException if the operation fails and an InterruptedException occurs when the thread has been interrupted When this method returns the associated operation has been performed Listing 6 The ChordRetrievalFuture interface 1 package de uniba wiai lspi chord service 2 public interface ChordRetrievalFuture extends ChordFuture 3 public Set lt Serializable gt getResult throws ServiceException 4 InterruptedException 5 The method to retrieve data from the DHT returns a ChordRetrievalFuture presented in listing 6 This interface extends ChordFuture by a method to obtain the result of the retrieval This method behaves like waitForBeingDone regarding the declared exceptions but returns the result as soon as the retrieval has been performed to the calling thread If there is no data associated with the provided Key an empty Set is returned 3 4 Examples 3 4 1 Creating a new Chord overlay network In order to create a new network one of the create methods of the Chord interface or AsynChord interface has to be invoked on an instance of de uniba wiai lspi chord service impl ChordImpl Listing 7 Creating an Open Chord network 1 public static void main String args 2 de uniba wiai lspi chord service PropertiesLoader loadPropertyFile 3 String protocol URL KNOWN PROTOCOLS get URL SOCKET PROTOCOL 4 URL localURL null 5 try
35. may be prevented by addition of a security manager that checks incoming requests Replication is only guaranteed when peers are trust worthy as not the peer that inserts data but the peer responsible for a data item is responsible to replicate this item Also data of arbitrary size can be stored in the DHT as it is assumed that peers are trustworthy For the same reason peers are expected to remove data they do not need anymore Therefor data is stored for an arbitrary time in Open Chord as there exists no leasing mechanisms that can be used to store data for a certain time To get access to the Open Chord DHT the current implementation requires that an application instantiates a full peer that provides storage space to the network Therefor it is not possible to use the DHT without participating in it 26 REFERENCES References Chr05 SMK 01 Binildas Christudas Internals of Java Class Loading http www onjava com pub a onjava 2005 01 26 classloading html January 2005 Ion Stoica Robert Morris David Karger M Frans Kaashoek and Hari Balakrish nan Chord A scalable peer to peer lookup service for internet applications In Proceedings of the 2001 conference on applications technologies architectures and protocols for computer communications pages 149 160 ACM Press 2001 A List of previous University of Bamberg reports Bamberger Beitr ge zur Wirtschaftsinformatik Nr Nr Nr Nr Nr Nr
36. n instance of interface de uniba wiai lspi chord service ChordCallback which is presented in listing 3 The other kind of methods returns instances of de uniba wiai lspi chord service ChordFuture listing 5 which can be used later on to determine if an asynchronous invocation has been completed and to obtain its result if necessary Listing 3 The ChordCallback interface 1 package de uniba wiai lspi chord service 2 3 public interface ChordCallback 4 public void retrieved Key key Set lt Serializable gt entries Throwable t 5 public void inserted Key key Serializable entry Throwable t 6 public void removed Key key Serializable entry Throwable t T The methods of the first kind require an instance of ChordCallback which is notified when asynchronously performed retrieval removal or storage of data has been completed These methods return directly after invocation and notification takes place with help of the cor responding callback method retrieved removed or inserted To these method the affected Key and entry if required or result in case of data retrieval is provided If the processing of retrieval removal or storage of data has failed a Throwable that represents the cause of the failure is provided This Throwable is null if invocation completes successfully Listing 4 The AsynChord interface 1 package de uniba wiai lspi chord service 2 public interface AsynChord 3 4
37. name mypeerO is created Afterward two peers that use both mypeerO as bootstrap node are simultaneously created Then three peers are created The first one uses mypeerO as bootstrap peer and the last two use 121f the examples in this section are processed in the same order as in this manual their output will look similar to the examples 20 4 THE OPEN CHORD CONSOLE mypeeri as bootstrap peer Bootstrap peers from the list are assigned to the peers at the same position of the list of peers to create If there are fewer bootstrap peers than peers to create the last bootstrap peer of the bootstrap peer list is assigned to all peers at the end of the list as a bootstrap peer insert This command can be used to insert a String with a certain key into the Chord DHT This command expects three parameters node key and value The first one is the name of the peer from which the insert request is issued The second parameter is the key that is used to store the String which is provided with help of the third parameter Example oc gt insert node mypeeri key test value test Value test with key test inserted successfully from node mypeer oc gt entries This command can be used to print the data and the associated keys stored by all peers in the network If the name of the peer is provided with help of parameter node the entries of this peer are printed to the console Example oc gt entries Node mypeerb
38. o be downloaded from its website There the sources and any other files required can be found in zip archive This archive has to be extracted in any desired directory The contents of the directory after extraction should contain the following directories and files e bin This directory contains scripts to start the Open Chord Console The instructions in these scripts work only in the directory structure described here e build This folder contains the compiled source files after Open Chord has been compiled e config Within this folder the configuration file Java property file for Open Chord and a sample configuration file for log4j reside e dist Ifa jar file of Open Chord is created during compilation this directory will contain it should be created during the compilation process e docs This directory contains this manual and the Open Chord API description e lib This directory contains third party libraries used by Open Chord Currently the only required library is log4j 3http ant apache org 4http logging apache org http www lspi wiai uni bamberg de dmsg software open_chord 4 2 SETTING UP OPEN CHORD e src This directory contains the source files of Open Chord e build xml This is the build file used to compile Open Chord with help of the Ant build tool e license txt This file contains a copy of GNU General Public License 2 3 Compilation Open Chord can be compiled with help of the Apache An
39. ods the Chord interface provides the methods shown in listing 2 They can be used to retrieve insert and remove data As data is associated with a unique identifier within a DHT an instance of interface de uniba wiai lspi chord service Key Key must be provided for these methods with which the data to retrieve insert or remove can be asso ciated Any Serializable Java object can be associated with a custom Key implementation Listing 2 The Chord interface 1 package de uniba wiai lspi chord service 2 public interface Chord 3 4 public Set lt Serializable gt retrieve Key key 5 throws ServiceException 6 public void insert Key key Serializable entry 7 throws ServiceException 8 public void remove Key key Serializable entry 9 throws ServiceException 10 A Key implementation must just be able to create a byte representation of itself which can be obtained by its getBytes method within a byte array These bytes are used by Open Chord to create a hash value for a given data item with help of a hash function As more than one instance may be associated with a single Key an invocation of retrieve Key key may return a Set of associated instances For Key implementations and classes whose instances should be stored in the DHT it is strongly recommended as with every class used in data structures or the Java Collections API to overwrite the equals Object and hashCode method of class Object to ensure that Open Chord can corre
40. peer Based on the communication abstraction layer the logic of the Chord overlay network such as how to find the successor of a peer has been implemented This layer provides two in terfaces to Java applications which abstract from the implementation of routing within the Chord DHT One interface de uniba wiai lspi chord service Chord Chord provides syn chronous methods to retrieve store and remove values within the DHT The other interface de uniba wiai lspi chord service AsynChord AsynChord can be used for asynchronous retrieval storage and removal of data from the DHT The Chord logic layer also is responsible for replication of data and maintenance of the properties that are necessary to keep the DHT running as described in SMK 01 This processes are transparent to the application using Open Chord but must be configured as described in section 2 4 3 2 Available communication protocols Currently two communication protocol implementations are available for Open Chord 1 Local within one JVM communication protocol oclocal The implementation of this protocol with help of sub classes of Proxy and Endpoint can be found in package de uniba wiai lspi chord com local This protocol has been developed in order to fa cilitate creation of an Open Chord network within a single JVM for testing purposes 2 Socket based protocol ocsocket The implementation of this protocol with help of sub classes of Proxy and Endpoint can be
41. public void retrieve Key key ChordCallback callback 5 public void insert Key key Serializable entry ChordCallback callback 6 public void remove Key key Serializable entry ChordCallback callback 7 public ChordRetrievalFuture retrieveAsync Key key 8 public ChordFuture insertAsync Key key Serializable entry 9 public ChordFuture removeAsync Key key Serializable entry 10 The second kind of methods does not require a callback object as a parameter but instead immediately returns an instance of ChordFuture The methods to insert and remove data both return an instance of ChordFuture which can be used to test if the corresponding invocation of insertAsync or removeAsync has been done with help of the isDone method 12 3 USING OPEN CHORD Listing 5 The ChordFuture interface 1 package de uniba wiai lspi chord service 2 public interface ChordFuture 3 public Throwable getThrowable 4 public boolean isDone throws ServiceException 5 public void waitForBeingDone throws ServiceException 6 InterruptedException y i The isDone method returns true when the invocation has been performed successfully When the invocation is still being performed false is returned When the invocation has been performed but has failed a ServiceException is thrown by isDone If a thread wants to wait until the operation associated with a ChordFuture finishes it can invoke waitForBeing Done which blocks the ca
42. r Lecture Notes Haase O Henrich A A Closed Approach to Vague Collections in Partly Inacces sible Distributed Databases Erscheint in Proceedings of the Third East European Conference on Advances in Databases and Information Systems ADBIS 99 Ma ribor Slovenia September 1999 Springer Lecture Notes in Computer Science Sinz E J B hnlein M Ulbrich vom Ende A Konzeption eines Data Warehouse Systems f r Hochschulen Angenommen f r Workshop Unternehmen Hoch schule im Rahmen der 29 Jahrestagung der Gesellschaft f r Informatik Pader born 6 Oktober 1999 Sinz E J Konstruktion von Informationssystemen Der Beitrag wurde in geringf gig modifizierter Fassung angenommen f r Rechenberg P Pomberger G Hrsg Informatik Handbuch 2 aktualisierte und erweiterte Auflage Hanser M nchen 1999 Herda N Janson A Reif M Schindler T Augsburger W Entwicklung des In tranets SPICE Erfahrungsbericht einer Praxiskooperation B hnlein M Ulbrich vom Ende A Grundlagen des Data Warehousing Modellierung und Architektur Freitag B Sinz E J Wismans B Die informationstechnische Infrastruktur der Virtuellen Hochschule Bayern vhb Angenommen f r Workshop Unternehmen Hochschule 2000 im Rahmen der Jahrestagung der Gesellschaft f Informatik Berlin 19 22 September 2000 B hnlein M Ulbrich vom Ende A Developing Data Warehouse Structures from Business Process Models Knobloch B Der Data
43. r to work with the DHT at least one implementation of the Key interface must be provided Nevertheless one instance of the DHT can be used with several Key implementations For the following examples a Key implementation listing 9 which uses a String as key is used Listing 9 A Key implementation 1 public class StringKey implements de uniba wiai lspi chord service Key 2 private String theString 3 4 public StringKey String theString 5 this theString theString 6 7 public byte getBytes 8 return this theString getBytes 9 10 public int hashCode 11 return this theString hashCode 12 13 public boolean equals Object o 14 if o instanceof StringKey 3 4 Examples 15 15 StringKey o theString equals this theString 16 17 return false 18 19 To synchronously insert data into the DHT a reference to the DHT of type Chord is required On this instance the insert method can be invoked as shown in listing 10 Asynchronous insertion of data can be performed with help of a reference to the DHT of type AsynChord Listing 10 Inserting data 1 Eee 2 Chord chord 3 create or join 4 s String data Just an example s StringKey myKey new StringKey data 7 try 8 chord insert myKey data catch ServiceException e 10 handle exception Asynchronous use of the DHT is shown with help of removal of data which is analogous to asynchronous insertion of data Two po
44. roperties to configure can roughly be divided into three categories Properties to configure logging of Open Chord properties to configure maintenance and replication within DHT properties to configure handling of incoming requests The properties to configure logging of Open Chord are e de uniba wiai lspi util logging logger class This property specifies the fully qualified name FQN of the logger implementation 6Please refer to the Ant Users Manual for details on how to use Ant http ant apache org manual index html For information on how maintenance and replication is conducted in Chord refer to SMK 01 2 4 Configuration 5 that is used to log messages of Open Chord Currently a Logger that just logs on the console de uniba wiai lspi util logging SystemOutPrintlnLogger and a logger that wraps log4j de uniba wiai lspi util logging Log4jLogger are available The latter is the standard logger if no logger has been specified If log4j or a specified custom logger cannot be found on the classpath logging is turned off So Open Chord can even run if log4j or the specified custom logger are not available e de uniba wiai lspi util logging off If this property is set to true no logging is performed by Open Chord This is automat ically set to true if the standard logger or the logger specified with help of the property above cannot be found e log4j properties file This property defines the name of the property file th
45. s to use the corresponding method of AsynChord which requires an instance of ChordCallback as a parameter Listings 12 and 13 show an implementation of ChordCallback and how an invocation to remove data is made with this model Listing 12 A sample callback implementation 1 public class MyCallback implements de uniba wiai lspi chord service ChordCallback 2 public void retrieved Key key Set lt Serializable gt entries Throwable t A 5 public void inserted Key key Serializable entry Throwable t 8 public void removed Key key Serializable entry Throwable t 9 11004 mul 4 10 System out println Successfully removed 11 entry with key 12 key 13 else 14 System err println Removal of 15 entry with key 16 key failed 17 t printStackTrace 18 19 20 Listing 13 Removing data asynchronously with help of a callback instance 1 ES 2 AsynChord aChord 3 MyCallback callback new MyCallback 4 RA 5 String data Just an Example s StringKey myKey new StringKey data 3 4 Examples 17 7 aChord remove myKey data callback s do other things 9 Eee The ChordCallback implementation just prints a message to the standard output of the JVM if removal of data is successfully performed If removal fails a message is printed to the error output of the JVM and the stack trace of the Throwable that caused the failure is prin
46. ssibilities exist for asynchronous used as described in section 3 3 First removal of data using a ChordFuture is shown in listing 11 Listing 11 Removing data asynchronously 1 ee 2 AsynChord aChord 3 join or create a DHT 4 s String data Just an Example s StringKey myKey new StringKey data 7 ChordFuture future aChord removeAsync myKey data 8 do other things while operation performed O Ew 1 try 2 boolean finished future isDone 3 while finished 4 try 5 future waitForBeingDone 6 finished true 7 catch InterruptedException e 8 finished false 9 2 catch ServiceException e 22 handle exception 16 3 USING OPEN CHORD 23 24 25 The method removeAsync in line 7 of listing 11 returns immediately and provides an instance of ChordFuture to the calling thread This instance future can later on be used to test if the removal has finished when it is necessary to know that the removal has been performed For this purpose in line 12 it is tested if this is the case If it is not true fu ture waitForBeingDone is invoked to block the thread until the removal has been per formed As the thread may be interrupted while waiting a while loop line 13 ensures that the thread really waits until the removal has finished Insertion of data with this invocation model is performed analogously Another possibility to remove or insert data i
47. t build tool that can be obtained from the Apache Software Foundation for free For this purpose Open Chord is distributed with an Ant build file build xm1 This build file contains the following targets clean Deletes the build and dist directories init Creates build and dist directories if they do not exist compile Compiles Open Chord to the build directory dist Compiles Open Chord to the build directory and creates a jar file within dist directory e documentation Creates Javadoc API documentation in the docs directory To compile Open Chord at the command line of your Operating System change to the direc tory where the Open Chord build file build xml is located After Open Chord has been successfully compiled change to the bin directory and execute the script to start the Open Chord Console for your Operating System e g for Microsoft Windows execute console bat Type ant compile to create the class files for Open Chord If you want to create a jar file that can be used as a library for Java applications type ant dist In order to use Open Chord as a library for other applications make sure that the configuration file for Open Chord is available from the classpath of these applications 2 4 Configuration Open Chord can be configured with a Java property file which is located in the config directory as mentioned above In this section the possible properties that can be set to adjust Open Chord are explained The p
48. ted In order to remove data the remove method of AsynChord has to be invoked and provided with an instance of the callback The method returns immediately and the removal is performed asynchronously As soon as the removal has been performed the removed method of MyCallback is invoked and one of the messages described above is being printed Insertion of data is processed analogously to removal of data 3 4 5 Data retrieval In order to retrieve data from the DHT there are also three possibilities as for insertion or removal of data These work similar to the invocations described in the previous section Therefore here no code samples are presented and the three possibilities are explained shortly 1 Synchronous retrieval with Chord retrieve Key key An invocation of this method blocks the calling thread until the retrieval has been performed A Set of the results is returned to the calling thread 2 Asynchronous retrieval with AsynChord retrieve Key key ChordCallback callback This method returns immediately and the result of the retrieval is provided to the call back instance passed to it through the method ChordCallback retrieved Key key Set lt Serializable gt entries Throwable t The parameter key is the key for which data has been retrieved entries contains the results and t is null if the retrieval is suc cessful When the retrieval has failed t is not null and it is an instance of the exception which has been raise
49. thin a JVM If no parameters are provided the peer creates a new network and listens on the standard port 4242 of Open Chord Within one console assumed to run on a machine with IP address 192 168 0 1 just type joinN and hit enter The following should be the result Example oc gt joinN Creating new chord overlay network URL of created chord node ocsocket 192 168 0 1 oc gt In another console assumed to run on a machine with IP address 192 168 0 2 just do the following oc gt joinN port 8080 bootstrap 192 168 0 1 4242 Trying to join chord network with boostrap URL ocsocket 192 168 0 1 4242 URL of created chord node ocsocket 192 168 0 2 8080 oc gt The port parameter can be used to define a port different from the standard port The bootstrap parameter requires the host and the port of the bootstrap peer in the format shown above e insertN This command inserts a String into the DHT It requires two parameters key and value Both parameters are Strings and the first defines the key with which the String defined with help of the second is inserted into the DHT Example oc gt insertN key test value test oc gt e retrieveN This command retrieves all data stored with the key provided with help of key parameter Example 24 4 THE OPEN CHORD CONSOLE oc gt retrieveN key test Values associated with key test test oc gt removeN This command requires the same parameters as
50. xample oc gt shutdown names mypeer2 Node with name mypeer2 left oc gt crash This command can be used to simulate the crash of a number of peers These peers do not notify their predecessors and successors This command requires one parameter called names that defines a list of names of peers in a similar fashion as the create command This command also has an optional parameter all which crashes all peers Example oc gt crash names mypeer3 Crashing node mypeers Node with name mypeer3 crashed oc gt show This command displays the peers currently running in the order they are located on the Chord ring It possesses an optional parameter count that requires no value and counts the number of peers currently running Example oc gt show Node list in the order as nodes are located on chord ring Node mypeerO with id 19 Node mypeer4 with id 21 Node mypeer5 with id D9 Node mypeeri with id E5 oc gt show count No of nodes currently running 4 oc gt 4 2 Connecting to and using a remote network 23 4 2 Connecting to and using a remote network The console can also be used to create a network with help of the ocsocket communication protocol For this purpose within one console a single Open Chord peer using the ocsocket pro tocol is instantiated The invocations e g insert are performed with help of the synchronous methods of Chord interface e joinN This command is used to create a single peer wi
51. ying DHT These interfaces Chord AsynChord provide some common methods that are important to create join and leave an Open Chord DHT These methods are shown in listing 1 Each peer within an Open Chord DHT is represented by a unique identifier as proposed in SMK 01 This unique identifier is usually created with help of the URL of a peer when it creates or joins a network or the method setURL URL nodeURL is invoked An identifier of a peer is represented by the class de uniba wiai lspi chord data ID An unique identifier of a peer can also be set by the application with help of the method setID ID nodeID Setting the URL or ID of a peer is only allowed before an Open Chord network is joined or created A new network can be created with help of the methods create create URL localURL and create URL localURL ID localID The first method can only be invoked if an URL and an ID is set for a peer An ID is automatically generated when an URL is set So when a custom ID should be provided the method setID ID nodeID must be invoked after invocation of setURL URL nodeURL The second create method is a convenience method to avoid setting of an URL before creation of a peer The third create method can be used to create a peer that listens on the provided URL localURL and has the ID localID Listing 1 Common Methods 1 public interface 2 public URL getURL 3 public void setURL URL nodeURL 4 throws IllegalStateException 5

Download Pdf Manuals

image

Related Search

Related Contents

  Drill Stop System Bohrer-Stopp-System Système de butées pour foret  ACR Electronics SARLink 2882 User's Manual  NST・305 NST・305C  Mode d`emploi  HelioSet - Saunier Duval  Interactive Multiple Representation Editing of Physically    manuale di installazione, uso e manutenzione installation, operation  Télécharger le fichier Aide aux vacances enfants 2014  

Copyright © All rights reserved.
Failed to retrieve file