Presentation is loading. Please wait.

Presentation is loading. Please wait.

July 19, 2001271th PPT, Ohokayama1 A Bytecode Translator for Distributed Execution of “ Legacy ” Java Software Michiaki Tatsubori University of Tsukuba,

Similar presentations


Presentation on theme: "July 19, 2001271th PPT, Ohokayama1 A Bytecode Translator for Distributed Execution of “ Legacy ” Java Software Michiaki Tatsubori University of Tsukuba,"— Presentation transcript:

1 July 19, 2001271th PPT, Ohokayama1 A Bytecode Translator for Distributed Execution of “ Legacy ” Java Software Michiaki Tatsubori University of Tsukuba, Japan

2 July 19, 2001271th PPT, Ohokayama2 A Bytecode Translator for Distributed Execution of “ Legacy ” Java Software Michiaki Tatsubori University of Tsukuba, Japan

3 July 19, 2001271th PPT, Ohokayama3 Development of Distributed Java Software An example scenario “We have already got nice software.” “But we want to display GUI of the software on a remote host.”  Run GUI components on a remote host, and run others on a local host

4 July 19, 2001271th PPT, Ohokayama4 Two Approaches Use X Window No need to edit a program Rewrite a program by hand Using Java RMI or CORBA

5 July 19, 2001271th PPT, Ohokayama5 X Window Distribution by the Xlib library Bad response time if GUI is complex  High communication overhead “Draw a line” “A mouse moved” “A mouse-button pushed” “A mouse-button released” User Program Xlib

6 July 19, 2001271th PPT, Ohokayama6 Rewrite a Program by Hand Good response time The programmer can tune the code. Low communication overheads. User Program Show an internal-window A click in a window ORB Library User Program Higher-level commands

7 July 19, 2001271th PPT, Ohokayama7 Automation vs. Efficiency X Window Fully automated, but Slow By hand Many man-hours, though Fast User Program Xlib User Program GUI Module

8 July 19, 2001271th PPT, Ohokayama8 Automation vs. Efficiency X Window Decomposition at the library layer For better performance, complex decomposition is necessary. User Program Xlib User Program GUI Module

9 July 19, 2001271th PPT, Ohokayama9 Addistant – Our Solution A Java program translator Translating a non-distributed program to a distributed one Decomposing at anywhere  The users can specify the decomposition in a policy file. User Program GUI Module Policy file

10 July 19, 2001271th PPT, Ohokayama10 Addistant is a Practical Tool! Bytecode translation by a class-loader Using Javassist[Chiba00]. No source code, no custom JVM. Addistant can process real applications. It can migrate Swing components to a remote host. Standard library for rich GUI

11 July 19, 2001271th PPT, Ohokayama11 Decomposition is Not Easy … A simple proxy-master implementation NEVER works. Proxy-master – a typical implementation technique for remote references MasterProxy Method Invocation Network Communications

12 July 19, 2001271th PPT, Ohokayama12 JavaRMI ’ s Way Doesn ’ t Work To be remotely accessible, We must translate … class WidgetImpl { … } implements Widget { interface Widget { … } class WidgetProxy implements Widget { … } If WidgetImpl is a system class, we cannot modify the class declaration! The JVM prohibits it. If WidgetImpl is a system class, we cannot modify the class declaration! The JVM prohibits it.

13 July 19, 2001271th PPT, Ohokayama13 System Classes For implementing remote references, different way for a different class is used. Scopes of the required code modification are different in each implementation Choosing implementation method avoiding any modification of system classes “ 長いものには巻かれましょう ” Declarative specification in a policy file “Replace”, “Rename”, “Subclass”, “Copy”

14 July 19, 2001271th PPT, Ohokayama14 In a Policy File of Addistant Users choose one of four implementation techniques for each class. Those techniques modify code in different ways.  But they have different limitations in use. Some techniques do not modify an original class, so they can be used for system classes.

15 July 19, 2001271th PPT, Ohokayama15 Distributed Swing Application A policy file subclass@java.awt.- subclass@javax.swing.-.. exactsubclass@java.io.[InputStream|OutputStream|..] exactsubclass@javax.swing.filechooser.* subclass@java.util.[AbstractCollection|..] array@- user@- -

16 July 19, 2001271th PPT, Ohokayama16 “ Replace ” Approach (e.g. user classes) Replaces the master class declaration with a proxy version When the target class is modifiable Only one version exists on a single JVM. Widget w = new Widget(); w.show(); Widget show() Make it distributed Widget show().. Show.... Send.. Replace all

17 July 19, 2001271th PPT, Ohokayama17 “ Rename ” technique (e.g. for java.awt.Window) It does not modify the original class. But local and remote references cannot coexist on the same host. Widget w = new Widget(); w.show(); Widget show().. Show.. Caller-sideClass declaration WidgetProxy show().. Send.. WidgetProxy w = new WidgetProxy(); w.show();

18 July 19, 2001271th PPT, Ohokayama18 “ Subclass ” technique (e.g. for java.util.Vector) Local and remote references can coexist on the same host. But the original class must not be final.  If final, it must be modifiable. Widget w = new Widget(); w.show(); Widget show().. Show.. Caller-sideClass declaration WidgetProxy show().. Send.. Local reference Remote reference

19 July 19, 2001271th PPT, Ohokayama19 “ Copy ” Approach (e.g. java.lang.String) Does not create any proxy class, but transfers serialized objects to remote host at RMI Shallow copy A Variation – “Write-back Copy” Approach For arrays byte[] buf = … ; istream.read(buf);

20 July 19, 2001271th PPT, Ohokayama20 Experiment: Response time “Click” to “Pop-up a Window” Application Host  Sparc 440MHz GUI Host  PentiumII 500MHz Network  10Base-T Half  100Base-TX Full

21 July 19, 2001271th PPT, Ohokayama21 Experiment: Response time “Click” to “Pop-up a Window” Application Host  Sparc 440MHz GUI Host  PentiumII 500MHz Network  10Base-T Half  100Base-TX Full

22 July 19, 2001271th PPT, Ohokayama22 Results of Experiments Addistant showed good results. Response Time (sec.) 10base-t / 100base-tx Transferred data size (kb) (±0.1 sec.) X WindowRawtAddistant 1st pop-up5.6 / 1.63.2 / 2.62.0 / 2.0 2nd pop-up5.6 / 1.40.0 / 0.0 X WindowRawtAddistant 1st pop-up3493.57116.2081.88 2nd pop-up3438.9610.950.06 IBM ’ s awt-compatible library for remote GUI

23 July 19, 2001271th PPT, Ohokayama23 Concluding Remarks Addistant – an adapter of “legacy” Java programs for their distributed execution on multiple hosts A translator (automation) approach for complex decomposition of a program A practical technology which can handle Swing Other Contribution A case-study of the usefulness of Javassist

24 July 19, 2001271th PPT, Ohokayama24 PTT ここだけの話 - Caving into Addistant 分散透過なシステムが気をつけなければなら ないこと Global references Field referencing Callback thread context Locking Reference assignment Exception handling Garbage collection

25 July 19, 2001271th PPT, Ohokayama25 Appetizer - Field Referencing Proxy-Master では、フィールドアクセ スは扱えない が、フィールドアクセスの対象となってい るオブジェクトの実際の型は静的に決まっ ている MyWindowB winb = ….. win.id.. MyWindowA wina = winb;.. win.id.. MyWindowB winb = ….. MyWindowBProxy._id(win).. MyWindowA wina = winb;.. MyWindowAProxy._id(win)..

26 July 19, 2001271th PPT, Ohokayama26 Main Dish - Distributed Callback コールバックされた synchronized メ ソッドは、ナイーブな実装ではデット ロックを起こす。 Method Invocation pushed() getState() Button ButtonListener handlePush()

27 July 19, 2001271th PPT, Ohokayama27 Dessert - Locking, DGC, Fault Tolerance Bare lock synchronized 文( synchronized メソッドは OK ) Remote thread communication wait() と notify() Distributed cyclic garbage Collection Tolerance for network communication failure

28 July 19, 2001271th PPT, Ohokayama28 早く飲みにいきましょう

29 July 19, 2001271th PPT, Ohokayama29 Automating Development of Distributed Ver. of “ Legacy ” Soft Less Developing Costs by Automation Reusing “Legacy”, Existing, Software Ordinary Environments (Auto Remote GUI) X Window System 、 VNC 、 Rawt[IBM Haifa 98] Ordinary Tools for (Semi-Auto) Distribution JavaRMI, ObjectSpace, Corba-compliant ORB… ”remotenew”[Nagaratnam 96], JavaParty[Philippen 99] 、 …

30 July 19, 2001271th PPT, Ohokayama30 Distributed Execution of Software For example, Separating GUI from application logic Reduces administration costs, and Makes use of ubiquitous client-machines “Zero Administration” “Thin Client”


Download ppt "July 19, 2001271th PPT, Ohokayama1 A Bytecode Translator for Distributed Execution of “ Legacy ” Java Software Michiaki Tatsubori University of Tsukuba,"

Similar presentations


Ads by Google