9

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:

  1. The challenge that I have presented sounds like a reflection challenge, Is this correct?
  2. Do you have any first tips on how to implement it?

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.

  1. What set of libraries do you think will help me complete this task? Remember I'm a computer science student, so complete out of the box solutions will not stick with my professors.
  2. RMI is old, any better solutions out there ?
  3. any comprehensive tutorial on TRMI?

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.

4
  • 2
    RMI is the default for inter-process communication in Java. It's "old" because it has been available and refined since the beginning of Java -- I'd rather call it mature. Depending on your requirements/professor, you could also try to base your solution on something like Hadoop or at least get some inspiration from there. Aug 29, 2011 at 8:25
  • If it's mature than great. I've found only very old documentation on it,so from my perspective i thought it didn't evolve much. Do you have a link describing the development of the library over time?
    – qballer
    Aug 29, 2011 at 8:30
  • RMI (remote method invocation) is not a library. It's some sort of technology and part of the JRE/JDK. Aug 29, 2011 at 8:44
  • @qballer There's no official history for RMI as it's really part of the JRE/JDK like Andreas noted -- the RMI release notes detail major additions/changes back till Java 1.2.2. Aug 29, 2011 at 9:14

3 Answers 3

5

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 ;)

  • Server sends out a file - Usually it's a client that sends a request to a server and the server will create a response. You should follow that convention.
  • file needs to be executed - We can't execute a file. A file may contain some script or binary code that can be executed by an interpreter or computer. Reason for being picky: you have to do something with the content of the file (parsing, compiling, interpreting, linking, ...)
  • files will implement a [...] interface - see above, the files do not implement anything.
  • The client will run the interface - An interface can't be executed or run.
  • return results of the algorithm to the server - Like mentioned above: usually it's a client that would send the file ("request") to a server. The server then would take the file, do some calculations based on the files content and return a result ("response") to the client.

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);
1
  • Thanks for the detailed answer. Regarding the terminology correction you have supplied I agree with them. Just to clarify what I meant is that the code ,send by a client and written by the user, will implement an interface written by me. I would like to create an object (on the server) of that implementation and using the interface to run the algorithm. Can you give more details on how to do that? what i refereed to as reflection.
    – qballer
    Aug 29, 2011 at 9:53
2

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.

1
  • To loaded my code using URLClassLoader Wrapper that I wrote so I choose your answer.
    – qballer
    Oct 16, 2011 at 15:40
1

Please also look in to SOAP based web services.. MTOM provides a way to more efficient transfer binary content.

Thanks..

1
  • 1
    Simple Object Access Protocol, indeed.
    – user684934
    Aug 29, 2011 at 8:56

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.