180 likes | 191 Views
Java Distributed Object System. Main Module of a Distributed System. Global address space global identifier registry/ name service ( central, distributed, replicated) Transportation system Global Control flow (Invocation/Control flow Protocol) parameter passing across address space
E N D
Main Module of a Distributed System • Global address space • global identifier • registry/ name service ( central, distributed, replicated) • Transportation system • Global Control flow (Invocation/Control flow Protocol) • parameter passing across address space • method invocation semantic • entity activation • Failure Behavior • exception • consistency and persistency CS491 presented by Peng Wu
RMI Overview RMI provides distributed computing ability on the specific system(JVM) for the specific language(Java) • CORBA, RPC • System Heterogeneity • Language Heterogeneity • RMI based on homogeneity and strength it • Language Integration -- distributed object model • similar interface, preserve some behavior • exception • System Integration • garbage collection • mobile behavior • security CS491 presented by Peng Wu
Java Object model Object Interface declare a set of methods for Java object without implementation Method Invocation primitive type passed by value object passed by reference Distributed Object model Remote object object whose methods can be accessed from another address space Remote interface an interface that declares the methods of a remote object Remote Implementation RMI non-remote object passed by value remote object passed by reference Language Integration -- Distributed Object Model CS491 presented by Peng Wu
RMI Interfaces and Classes Object classes Interfaces Remote RemoteObject IOException RemoteServer RemoteException Client stub ... ... UnicastRemoteObject extension implementation CS491 presented by Peng Wu
System Integration • Distributed Garbage Collection • Dynamic Stub loading • specialized class loader • security manager • pickling system • When marshalling remote object, marshal stream embeds URL info of the stub code • On demarshalling, marshal stream loads stub code if it’s not available locally CS491 presented by Peng Wu
System Architecture • Stub/Skeleton layer • Remote reference layer • Transport layer Application Client Server Stubs Skeleton RMI System Remote Reference layer Transport CS491 presented by Peng Wu
Distributed object Across Address Space • Name Service • URL based name lookup, no location transparency • Non-persistent database • java..rmi.registry.Registry • java.rmi.LocateRegistry • java.rmi.naming export export Remote Server Remote Server registry registry Locate Reg Locate Reg naming naming client client binding binding CS491 presented by Peng Wu
Distributed object Across Address Space • Pickling -- Object transmission across address space • Serialized representation of objects: • object type • object persistent state • relationships between objects within a stream • object implementation info • Pickling remote object • remote interface • remote object reference CS491 presented by Peng Wu
RMI Performance • RMI vs. Local call(PPro 200Mhz, NT, JDK no JIT) • Call time (no configuration available) • setup time: RMI 40% slower than CORBA • binding: RMI 200-1500ms slower than CORBA • CORBA vs. RMI • 1000 calls, one argument, JDK1.1.1 CS491 presented by Peng Wu
CORBA and RMI Performance(1000 calls, one argument) CS491 presented by Peng Wu
RMI Performance • Scalability -- ability of handling multiple connections to one remote object • HelloImpl.sayHello() JDK1.1, Win95, 133-Pentium • 150 threads in 2 sec interval, 200 threads in 5 sec interval(RMI) • 1000 threads(Java IDL) • Serialization • 100 times, default serialization, buffered stream, primitive type, small array, small object array(10) • RMI 64500ms (object) • CORBA 3485ms (IDL struct) • different serialization schemes Object[1000], each 3 attributes(String, Double,util.Data) CS491 presented by Peng Wu
Performance of different serialization scheme(Solaris2.5 Ultra-1 with attributes String, Double,Data) CS491 presented by Peng Wu
Summary Pros • Integrating distribute object model seamlessly into Java object model • Homogeneity • Communication with non-Java object may work through JNI and JDBC Cons • Make distributed computing in Java easily to approach, but not efficiently • Heterogeneity • A primitive implementation currently CS491 presented by Peng Wu
JavaSpace -- a new distributed computing paradigm • JavaSpace -- A reliable distributed storage system • Goal -- facilitating cooperate distributed computing • Utilization • Distributed algorithms as flow of object • establish connections between participants(Client/Server, RPC, RMI) • build interfaces and protocols between participants • establish connections with a broker(JavaSpace) • build interfaces and protocols with the broker • Distributed persistence CS491 presented by Peng Wu
read Client Identities write JavaSpace Write event Client write Event Dispatcher Transaction notify take notify write JavaSpace JavaSpace CS491 presented by Peng Wu
JavaSpace model • Entry basic unit of JavaSpace, a typed group of objects • Template a “partial” entry used to match entries with specific properties • Operation • read • write • take • notify CS491 presented by Peng Wu
A reliable distributed storage system • Store and retrieve entries -- object • Weak query ability • Handle concurrent access • Global control flow across multiple JavaSpaces • asynchronous retrieval • distributed transaction mechanism CS491 presented by Peng Wu