Reputation: 2111
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.
Upvotes: 9
Views: 10879
Reputation: 26882
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.
Upvotes: 2
Reputation: 114757
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);
Upvotes: 5
Reputation: 5921
Please also look in to SOAP based web services.. MTOM provides a way to more efficient transfer binary content.
Thanks..
Upvotes: 1