Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java distributed system

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.

like image 215
qballer Avatar asked Aug 29 '11 08:08

qballer


People also ask

What is Java distributed system?

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.

Is Java good for distributed systems?

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.

Why Java is distributed example?

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.

What is a Java distributed application?

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.


2 Answers

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);
like image 181
Andreas Dolk Avatar answered Sep 29 '22 07:09

Andreas Dolk


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.

like image 44
Enno Shioji Avatar answered Sep 29 '22 09:09

Enno Shioji