use of org.apache.cassandra.stress.server.StressThread in project eiger by wlloyd.
the class StressServer method main.
public static void main(String[] args) throws Exception {
ServerSocket serverSocket = null;
CommandLineParser parser = new PosixParser();
InetAddress address = InetAddress.getByName("127.0.0.1");
try {
CommandLine cmd = parser.parse(availableOptions, args);
if (cmd.hasOption("h")) {
address = InetAddress.getByName(cmd.getOptionValue("h"));
}
} catch (ParseException e) {
System.err.printf("Usage: ./bin/stressd start|stop|status [-h <host>]");
System.exit(1);
}
try {
serverSocket = new ServerSocket(2159, 0, address);
} catch (IOException e) {
System.err.printf("Could not listen on port: %s:2159.%n", address.getHostAddress());
System.exit(1);
}
// one across everything here (though that's probably not what we'd want)
for (; ; ) new StressThread(serverSocket.accept(), new ClientContext()).start();
}
Aggregations