I'm starting my final year computer science project and I'm trying to figure out my first steps. For more details you can go to the project page.
Background: Because I have very little experience in distributed systems I basically though how should I face such a challenge. What I came up with is that the system should work as following:
The client sends out a file, or a set of files that contains code to be processed. That code will implement a distributed algorithm interface written by me, a specific class. The server will create an object from the class.That object will be responsible for the algorithm to be run. The server will return the results to the client. (I actually read about RMI later and found it very similar).
Sending out files is basic - common network I/O. The real problem is object creation and using it as the predefined interface in run-time.
Questions:
Looking for some distributed systems java technologies I've encountered RMI, TRMI, LINDA, CORBA, JINI and many others. RMI sounds the most appealing because it's very similar to what I've gathered to be the solution, but it's also old.
If you find my logic some how faulty, please correct it.
If you have some more tips on the subject that you think that should be discussed feel free to contact me.
A distributed system contains multiple nodes that are physically separate but linked together using the network. All the nodes in this system communicate with each other and handle processes in tandem. Each of these nodes contains a small part of the distributed operating system software.
Distributed computing and Java go together naturally. As the first language designed from the bottom up with networking in mind, Java makes it very easy for computers to cooperate. Even the simplest applet running in a browser is a distributed application, if you think about it.
Java is distributed because it facilitates users to create distributed applications in Java. RMI and EJB are used for creating distributed applications. This feature of Java makes us able to access files by calling the methods from any machine on the internet.
A distributed application consists of one or more local or remote clients that communicate with one or more servers on several machines linked through a network. With this type of application, business operations can be conducted from any geographical location.
There is not enough information for a recommendation of libraries or technologies. So I'd like to concentrate on the "more tips" part of your question ;)
remote method invocation
With RMI we usually have the following scenario: A client wants to call a remote method. The client knows the interface and the server address. The server has an implementation for that interface. Now the client contacts the server and calls the method on that server.
For your project it looks somewhat different: I think the client has an implementation of an algorithm (java source file or compiled class file) and wants to send it to one or more servers. The server shall process the file, execute the algorithm for some input (the slice) and return the result.
RMI may be a candidate for the file transfer but not for (algorithm) method call. A remote method could look like that (assuming we send a java source file):
public Result process(String javaSource, Data data);
You could use this example and send class files for execution (you can store the class files on disk, and then load them using the URLClassLoader. If you don't want to write on disk, McDowell has a suggestion).
As for communication, there are a LOT to choose from. One thing you could think about is whether to make the message passing synchronous or asynchronous. There is nothing wrong about synchronous messaging (like RMI), but you may want to look for asynchronous solutions as well as they are supposed to be "hot" recently. Or you could just go with your own protocol on top of HTTP or something like that.
One fun exercise would be to distribute data among nodes and execute the algorithm against these distributed data, and then combine the results. In this case the user will specify two algorithms. One that generates data, and one that aggregates the result.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With