Skip to content
Snippets Groups Projects
Commit 912d379f authored by tmp1u19's avatar tmp1u19 :octopus:
Browse files

Add the skeleton of the java classes needed for this project

parent b7526d47
No related branches found
No related tags found
No related merge requests found
public class Client {
// controller port to communicate with
int cport;
// timeout in milliseconds
long timeout;
public Client(int cport, long timeout) {
this.cport = cport;
this.timeout = timeout;
}
}
\ No newline at end of file
import java.io.*;
import java.net.*;
public class Controller {
// port to listen on
private int cport;
// replication factor => number of Dstores to join
private int R;
// timeout in milliseconds
private long timeout;
// how long to wait to start the next rebalance operation
private long rebalance_period;
public Controller (int cport, int R, long timeout, long rebalance_period) {
this.cport = cport;
this.R = R;
this.timeout = timeout;
this.rebalance_period = rebalance_period;
}
// orchestrates client requests
// maintains an index with the allocation of files to Dstores
// waits for Dstores to join the datastore (rebalance operation)
// it doesn't serve any client request until at least R Dstores have joined the system
}
\ No newline at end of file
public class Dstore {
// port to listen on
int port;
// controller's port to talk to
int cport;
// timeout in milliseconds
long timeout;
// where to store the data locally
String file_folder;
public Dstore (int port, int cport, long timeout, String file_folder) {
this.port = port;
this.cport = cport;
this.timeout = timeout;
this. file_folder = file_folder;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment