This project consists of clients and server which are communicating with each other using Remote Procedure Call(RPC). This project is divided into 3 parts. Each part consist of one client and one server class.
Part I consist of a a multi-threaded file server that supports UPLOAD, DOWNLOAD, DELETE, and RENAME file operations. This part is implemented using Java RMI API.
Part II consist of file transfer between the client and the server where client has one folder which get synchronized with the server folder. Whenever changes are made to the synchronized folder at the client side, e.g., creating a new file, updating a file, or deleting a file, the client runs a thread in the background which periodically send the updates to the server to do the synchronization. This part is also implemented using Java RMI API.
Part III implements a computation server which support add(i, j), and sort(array A) operations using synchronous, asynchronous gRPCs. In synchronous gRPC, the client makes the RPC call and waits for the result from the server. In asynchronous RPC, the client makes the RPC call and waits for an acknowledgment from the server, and continues after receiving an acknowledgment. On the other hand, after completing the computation the server sends the result of the call back to the client. This has been implemented using gRPC.
- Open IntelliJ IDEA and select _File > Open > open the directory to where the project is exported.
- Select File > Project Structure and ensure that the Project SDK and language level are set to use Java 8.
- In the Maven view, under lifecycle, execute maven clean and install.
- Open Eclipse and select File >> Import_.
- From the import wizard, choose Maven > Existing Maven Projects, then click Next.
- In the maven wizard, click on Browse and select the Project Folder.
- Click Finish to complete the import.
- Right click on the project >> run as >> Maven clean and Maven install
- project >> src/main/java It consist of folder com.ds.part1, com.ds.part2, com.ds.part3 and com.ds.part3 for implementation of each part. Folder com.ds.services consist of interfaces which are used in part 1 and part 2.
- project >> src/main/proto consists of .proto files used to implement gRPC stubs.
- project >> src/main/resources It consist of config.properties files which are used to make some variables configurable.
- Go to project >> src/main/java >> com.ds.part1
- Inside the folder com.ds.part1, open Server.java.
- Run Server.java. If the message on Console is 'Server ready'.
- Run Client.java. Run the operations from Console.
- Go to project >> src/main/java >> com.ds.part2
- Inside the folder com.ds.part2, open Server.java.
- Run Server.java. If the message on Console is 'Server ready'.
- Run Client.java. Open current directory in File explorer and go to folder 'SyncClientFolder' and do any operation on the files. Folder 'SyncServerFolder' is maintained on the server side which gets in sync with 'SyncClientFolder' every 2 minute.
-
To Execute the Asynchronous calls:
- Go to project root >> src/main/java >> com.ds.part3.async
- execute class AsyncComputationServer and input 1 to start sorting server 2 to start addition server.
- Wait for the message "Server Started successfully!" to be displayed on the console.
- execute class AsyncComputationClient and input 1 to sort an array and 2 to add 2 elements.
- Perform the operations displayed on console.
-
To Execute the Synchronous calls:
- Go to project root >> src/main/java >> com.ds.part3.sync
- execute class SyncComputationServer and input 1 to start sorting server 2 to start addition server.
- Wait for the message "Server Started successfully!" to be displayed on the console.
- execute class SyncComputationClient and input 1 to sort an array and 2 to add 2 elements.
- Perform the operations displayed on console.