Make room for JavaSpaces, Part 2
Build a compute server with JavaSpaces
By Eric Freeman, JavaWorld.com, 01/21/00
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
I've just returned from the second Jini Community Summit, where Ken Arnold and I led a birds-of-a-feather session on JavaSpaces.
This encouraging meeting highlighted a number of interesting JavaSpaces applications, including Bill Olivier's JavaSpaces-based
email system at the University of Wales. Also featured was the Department of Defense's explorations of battlefield management
software, in which battlefield resources, such as tanks, are represented in a space.
TEXTBOX: TEXTBOX_HEAD: Make room for JavaSpaces: Read the whole series!
:END_TEXTBOX
In addition, there was significant interest in continuing to advance the JavaSpaces technology, and a number of areas were
suggested for its improvement. One problem that the conference attendees wanted to confront was the painful process of setting
up and running JavaSpaces (as well as Jini) for the first time -- probably the greatest barrier to using the technology. This
problem is now being addressed in a new working group started by Ken Arnold, called Out of the Box (for more information,
see the Resources section at the end of the article). Another area of community effort involves the development of helper or utility interfaces
and classes that provide a valuable set of tools for new JavaSpaces developers. This article is based around one of those
tools in particular: the compute server.
Basically, a compute server is an implementation of a powerful, all-purpose computing engine using a JavaSpace. Tasks are
dropped into the space, picked up by processes, and then computed; the result is written back into the space and, at some
point, retrieved. Beginning JavaSpaces programmers often ask how to implement such a system; in fact, the JavaSpaces Technology
Kit ships with two sample compute servers, which perform computations for ray tracing and cryptography.
Compute servers are quite useful even for advanced programming. At the Jini Summit, it was decided that a common set of interfaces
should be created to standardize JavaSpaces-based compute servers so that programmers could avoid reinventing the wheel every
time they wanted to implement one. As a result, the community has created a working group whose goal is to build a specification
and reference implementation of a compute-server architecture. One aim of this article is to kick off that work.
The compute server explained
A compute server provides a service that accepts tasks, computes them, and returns results. The server itself is responsible
for computing the results and managing the resources that complete the job. Behind the scenes, the service might use multiple
CPUs or special-purpose hardware to compute the tasks more quickly than a single-CPU machine could.
Historically, compute servers have been used to take advantage of the resources of large farms of processors in order to tackle
computationally intensive problems -- ray tracing, weather modeling, cryptography, and so-called "grand challenge" computational
problems. More recently, compute servers have begun to move into the mainstream, and have been put to work in a variety of
environments, from the creation of financial models for Wall Street to the construction of large-scale order-entry and fulfillment
centers that service the Web. All of these applications use the compute server to break a large computational problem into
smaller problems, and then allow a distributed set of processors to solve these smaller problems in parallel.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
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/
- "Make room for JavaSpaces, Part 1," Eric Freeman and Susanne Hupfer (JavaWorld, November 1999) -- an introduction to JavaSpaces
http://www.javaworld.com/javaworld/jw-11-1999/jw-11-jiniology.html
- "The Nuts and Bolts of Compiling and Running JavaSpaces Programs," Susanne Hupfer
http://developer.java.sun.com/developer/technicalArticles/Programming/javaspaces/index.html
- 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 PatternsElements 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.