Make Room for JavaSpaces, Part II
Build a Compute Server with JavaSpaces
by Eric Freeman
First Published in JavaWorld, January 2000
<< Page 7 of 7
Summary
I've demonstrated a simple compute server in this article. With a small amount of code, we've implemented a server capable of executing arbitrary code on behalf of a master process. It would take some work to make this code ready for general use, and even more to create a compute server that is industrial strength and will soldier on in the face of partial failure. For instance, at this stage in our server's development, there is no method of distinguishing one master's tasks from another -- if we ran two concurrent instances of the master, then we'd most likely get mixed result sets returned by the collectResults method. We also have no way to handle exceptions in the task code when it is running within the worker's environment, or to handle the failure of workers when they are computing tasks. If either of these events occurred, the tasks being computed would be lost, which would lead to the master computing incorrectly. If the task to compute a piece of a ray-traced image was lost, for instance, then the image would never be completed.
Susanne and I will tackle many of these issues in remaining articles of this series, and in the compute-server working group at Jini.org. Please come and join us.
About the Author
Dr. Eric Freeman, recently named one of the top 100 young innovators by MIT's Technology Review, is chief technologist of Mirror Worlds Technologies, a Java- and Jini-based software applications company, and a research affiliate in the department of computer science at Yale University. Eric recently coauthored JavaSpaces Principles, Patterns, and Practice, the official Sun Microsystems Jini Series book on the JavaSpaces distributed computing technology, along with Susanne Hupfer and Ken Arnold. Previously, Eric spent several years working closely with David Gelernter as a PhD student at Yale University on space-based systems (which are the progenitors of the JavaSpaces technology). Eric would like to thank Elisabeth Freeman and Susanne Hupfer for their careful reading, feedback, and comments on drafts of this article.
Resources
- The complete source code for this example:
http://www.javaworld.com/jw-01-2000/jini/code.zip
- The source code from the JavaSpaces book:
http://java.sun.com/docs/books/jini/javaspaces/JSBookExamples.zip
- The Compute Server Jini working group (requires free registration at Jini.org):
http://developer.jini.org/exchange/projects/computeserver/
- Ken Arnold's Out of the Box working group:
http://developer.jini.org/exchange/projects/outofbox/
- "The Nuts and Bolts of Compiling and Running JavaSpaces Programs," Susanne Hupfer:
http://developer.java.sun.com/developer/technicalArticles/Programming/javaspaces/index.html
- Read the whole "Make Room for JavaSpaces" series:
- More information on the latest Jini Community Summit:
http://www.jini.org/NEWS/1026.communitymeeting2.html
- The definition of
MultTask:
http://www.javaworld.com/jw-01-2000/jini/MultTask.java
- The definition of
MultResult:
http://www.javaworld.com/jw-01-2000/jini/MultResult.java
- More on space models and compute servers:
http://www.cs.yale.edu/Linda/piranha.html
- Design Patterns: Elements of Reusable Object-Oriented Software, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Addison-Wesley, 1995) -- more information on design patterns:
http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0201633612&from=NCN454
- The official JavaSpaces users mailing list:
http://archives.java.sun.com/archives/javaspaces-users.html
- The Jini users mailing list also has a fair amount of JavaSpaces-related discussion:
http://archives.java.sun.com/archives/jini-users.html.
- For an exploration of space-based programming and an in-depth look at the JavaSpaces technology APIs, refer to JavaSpaces Principles, Patterns, and Practice by Eric Freeman, Susanne Hupfer, and Ken Arnold (Addison-Wesley, 1999). Chapters 6 and 11 contain more information about compute servers:
http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0201309556
JavaSpaces Principles, Patterns, and Practice is also freely available on the Web:
http://java.sun.com/docs/books/jini/javaspaces/JSBookExamples.zip
- For nitty-gritty API details, see the definitive references are the Jini specifications from Sun Microsystems (starting with the Jini Entry Specification and the JavaSpaces Specification):
http://www.sun.com/jini/specs/
- The Jini specs are also conveniently provided in The Jini Specification (The Jini Technology Series), Ken Arnold, Bryan O'Sullivan, Robert W. Scheifler, Jim Waldo, Ann Wollrath, and Bryan O'Sullivan (Addison-Wesley, 1999):
http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0201616343
- Core Jini, W. Keith Edwards (Prentice-Hall, 1999) provides a more general treatment of every aspect of Jini technology:
http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=013014469x
- For pointers to the JavaSpaces FAQ and other documentation, visit the Sun Microsystems JavaSpaces page:
http://java.sun.com/products/javaspaces/.
- To gain insight into the philosophy that underlies Sun's approach to distributed computing, read "A note on distributed computing," Jim Waldo, Geoff Wyant, Ann Wollrath, and Sam Kendall, Sun Microsystems TR-94-29:
http://www.sunlabs.com/technical-reports/1994/abstract-29.html.
"Make Room for JavaSpaces, Part II" by Eric Freeman was originally published by JavaWorld (www.javaworld.com), copyright IDG,
January 2000. Reprinted with permission.
http://www.javaworld.com/jw-01-2000/jw-01-jiniology.html
<< Page 7 of 7