This project implements a multithreaded key-value store using RPC (Java RMI). The project includes the following components:
RemoteCommandHandler- RMI interface for remote commands.RemoteCommandHandlerImpl- Implementation of the RMI interface.RMIServer- RMI server implementation.RMIClient- RMI client implementation.
Ensure that you have the Java Development Kit (JDK) installed on your system. You can download it from here.
To compile the Java files, open a terminal or command prompt and navigate to the directory containing the source files. Use the following commands to compile each file:
javac RemoteCommandHandler.java RemoteCommandHandlerImpl.java RMIServer.java RMIClient.java
To start the RMI server, use the following commands. Replace <port> with the port number you wish to use (e.g., 32000).
java RMIServer <port>
To start the RMI client, use the following commands. Replace <hostname> with the server's hostname or IP address (e.g., localhost), and <port> with the same port number used for the server.
java RMIClient <hostname> <port>
Here is an example of how to run the servers and clients using port 32000 and localhost as the hostname.
java RMIServer 32000
java RMIClient localhost 32000
Note: Ensure that the server is running first and use separate terminals or consoles for each client/server.