Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Distributed Turkish Dictionary Service via RPC/RMI

Due: October 27/ 2020 11:00 pm


Note: This assignment must be done individually.

Goals
In this assignment, the goal is to get familiar with the RPC (Remote Procedure Call)
/ RMI (Remote Method Invocation) model for communication among distributed
processes. RPC model is at the core of many distributed systems today. For this purpose,
the aim in this assignment is to develop and deploy a distributed RPC/RMI service that
provides client processes Turkish dictionary operations located at the remote server side.

Tasks
You are asked to design and implement operations of the dictionary service using
RC/RMI model (either Java RMI or Sun RPC) for communication between the clients
and the server. The clients can request dictionary operations concurrently from the single
server. The server must handle incoming client connections and requests, and reply each
client eventually. For each connection, server gets the requested operation (such as
insert, search, log), and replies the output back to the client. If the client does not receive
any response back, it waits for a predefined amount of time (controlled by a timer
mechanism) and submits the same operation request again.

Overview of the system is illustrated in the figure below.


The following operations must be provided at the server side:

- Insert Word: Client can add a new word to the dictionary at the server. If the
submitted word already exists, then a warning message is returned to the client.
The client must obey the dictionary format explained in Turkish Dictionary
section.

- Search Word: Client can query a word from the dictionary server. If the word
does not exist then “Not Found” message is returned to client. If the word exists,
its description must be provided to the client. (Example: DISTRIBUTE
DAĞITMAK {V} where {V} stands for verb.)

- Logs: Server must keep log information and when a client requests the logs, they
are returned in line by line. The logs are structured as follows; client IP, requested
operation (such as insert, search, and log) and the time of operation.

- Statistics: Client can query the Turkish dictionary to get some statistics about the
dictionary. The statistics command will show how many words in file and also
groups the words based on word type. An example output format:

Dictionary Contains 100 Words


50 of them are {V} verb
50 of them are {N} noun

Insert Word
Request Operation on Search Word
Dictionary Service
Logs
Statistics

Whenever a client would like to use the dictionary service, the following steps of
interaction are performed.

• The client should provide the word or word pair in a format that server can decode
and perform the specified operation. The format of words is presented in given
dictionary.txt file. One example:

ABRUPTLY ANİDEN {ADV}


• If the client provides a wrong format or the provided word does not exist, the
server replies back with an explanation of error.

• The server must keep the history file per client that is used for holding that
client’s operation log.

• RPC/RMI will be used in all communications (between clients and the server).

• At the client side, a menu will displayed to get the operation and inputs from the
user. For each submitted operation and parameters, necessary method at the
server side is invoked and end result will be sent to and displayed by the client.

• To run the RMI server on the first the RMI service must be executed. To execute
the RMI service on the ubuntu, the command “rmiregistry &” is executed in
command line. For widows, “start rmiregistry” must be executed in command
line, then it starts running at the background.

Turkish Dictionary
With this assignment, you are provided a dictionary (dictionary.txt) where each entry
contains English word(s), Turkish meaning and the word type. One example entry is:

ACADEMICIAN AKADEMİ ÜYESİ {N}

where {N} stands for noun. There are other word types as well. The command line
structure must obey the dictionary entry format.

Error Handling
It is expected that, on both the server and the client side, errors are properly managed
(by means of exception handling). The errors may include the following:

• wrong input from the console for the parameters passed as command line

• network communication (address not reachable, bad data...)

• I/O (cannot find the dictionary file, error reading the file, etc...)

• other errors you might come up with

The service will be tested and validated against all these errors.
Deliverables
You should turn in a single .rar or .zip file including:

- Source code: a .zip or .rar file that contains all the source code with explanation.
- Report: in pdf format describing the design structure and results:
- Description of the system components.
- Critical parts of the design.
- Network throughput measurements graph and description.

In the report, you should describe your design (not the code itself) and results. A report
without any system description or analysis of work done will not be considered valid.

It is important to put your information (name and assignment number) in the submitted
.rar or .zip file.

For example: beakal_Assignment 2.rar. Submit your deliverables to the e-learning

platform.

Demo
Time slot will be allocated and announced for the practical demo of your work.

You might also like