/**
	 * @param args contains the program's input args (here for signature purposes)
	 */
public static void main(String[] args) {
		try {
			if (args.length != 6) {
				logger.error("Error! Invalid number of arguments!");
				logger.error("Usage: Server <name> <port> <ZooKeeper Port> <ECS IP> <isLoadReplica> <parentName>!");
				System.exit(1);
			} else {
				String name = args[0];
				int port = Integer.parseInt(args[1]);
				int zkPort = Integer.parseInt(args[2]);
				String ECSIP = args[3];
				boolean isLoadReplica = Boolean.parseBoolean(args[4]);
				String parentName = args[5];
				SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
				new LogSetup("logs/" + name + "_" + fmt.format(new Date()) + ".log", Level.ALL, true);
				// No need to use the run method here since the contructor is supposed to
				// start the server on its own
				// TODO: Allow passing additional arguments from the command line:
				new KVServer(START_CACHE_SIZE, START_CACHE_STRATEGY, name, port, zkPort, ECSIP, isLoadReplica, parentName);
			}
		} catch (IOException e) {
			System.out.println("Error! Unable to initialize logger!");
			e.printStackTrace();
			System.exit(1);
		} catch (NumberFormatException nfe) {
			System.out.println("Error! Invalid argument <port>! Not a number!");
			System.out.println("Usage: Server <port>!");
			System.exit(1);
		}
	}
public static void main(String[] args) {
try {
if (args.length != 6) {
logger.error("Error! Invalid number of arguments!");
logger.error("Usage: Server <name> <port> <ZooKeeper Port> <ECS IP> <isLoadReplica> <parentName>!");
System.exit(1);
} else {
String name = args[0];
int port = Integer.parseInt(args[1]);
int zkPort = Integer.parseInt(args[2]);
String ECSIP = args[3];
boolean isLoadReplica = Boolean.parseBoolean(args[4]);
String parentName = args[5];
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
new LogSetup("logs/" + name + "_" + fmt.format(new Date()) + ".log", Level.ALL, true);
// No need to use the run method here since the contructor is supposed to
// start the server on its own
// TODO: Allow passing additional arguments from the command line:
new KVServer(START_CACHE_SIZE, START_CACHE_STRATEGY, name, port, zkPort, ECSIP, isLoadReplica, parentName);
}
} catch (IOException e) {
System.out.println("Error! Unable to initialize logger!");
e.printStackTrace();
System.exit(1);
} catch (NumberFormatException nfe) {
System.out.println("Error! Invalid argument <port>! Not a number!");
System.out.println("Usage: Server <port>!");
System.exit(1);
}
}
public static void main(String[] args) {
try {
if (args.length != 6) {
logger.error("Error! Invalid number of arguments!");
logger.error("Usage: Server <name> <port> <ZooKeeper Port> <ECS IP> <isLoadReplica> <parentName>!");
System.exit(1);
} else {
String name = args[0];
int port = Integer.parseInt(args[1]);
int zkPort = Integer.parseInt(args[2]);
String ECSIP = args[3];
boolean isLoadReplica = Boolean.parseBoolean(args[4]);
String parentName = args[5];
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
new LogSetup("logs/" + name + "_" + fmt.format(new Date()) + ".log", Level.ALL, true);
// No need to use the run method here since the contructor is supposed to
// start the server on its own
// TODO: Allow passing additional arguments from the command line:
new KVServer(START_CACHE_SIZE, START_CACHE_STRATEGY, name, port, zkPort, ECSIP, isLoadReplica, parentName);
}
} catch (IOException e) {
System.out.println("Error! Unable to initialize logger!");
e.printStackTrace();
System.exit(1);
} catch (NumberFormatException nfe) {
System.out.println("Error! Invalid argument <port>! Not a number!");
System.out.println("Usage: Server <port>!");
System.exit(1);
}
}
public static void main(String[] args) {
try {
if (args.length != 6) {
logger.error("Error! Invalid number of arguments!");
logger.error("Usage: Server <name> <port> <ZooKeeper Port> <ECS IP> <isLoadReplica> <parentName>!");
System.exit(1);
} else {
String name = args[0];
int port = Integer.parseInt(args[1]);
int zkPort = Integer.parseInt(args[2]);
String ECSIP = args[3];
boolean isLoadReplica = Boolean.parseBoolean(args[4]);
String parentName = args[5];
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
new LogSetup("logs/" + name + "_" + fmt.format(new Date()) + ".log", Level.ALL, true);
// No need to use the run method here since the contructor is supposed to
// start the server on its own
// TODO: Allow passing additional arguments from the command line:
new KVServer(START_CACHE_SIZE, START_CACHE_STRATEGY, name, port, zkPort, ECSIP, isLoadReplica, parentName);
}
} catch (IOException e) {
System.out.println("Error! Unable to initialize logger!");
e.printStackTrace();
System.exit(1);
} catch (NumberFormatException nfe) {
System.out.println("Error! Invalid argument <port>! Not a number!");
System.out.println("Usage: Server <port>!");
System.exit(1);
}
}