com.datastax.insight.core.mesos.MCDLauncher Maven / Gradle / Ivy
package com.datastax.insight.core.mesos;
import com.datastax.util.lang.ProcessUtil;
import com.datastax.util.lang.SystemUtil;
/**
* Mesos Cluster Dispatcher Launcher
*/
public class MCDLauncher {
final static String START_SH ="/sbin/start-mesos-dispatcher.sh";
final static String STOP_SH ="/sbin/stop-mesos-dispatcher.sh";
public final static String DEFAULT_CLUSTER_URL="mesos://"+ SystemUtil.getHostName()+":7077";
public static void launch(String sparkDir,String mesosUrl, String host){
String cmd=sparkDir+ START_SH +" -m "+mesosUrl + " -h " + host;
new ProcessUtil().executeBlock(cmd);
}
public static void stop(String sparkDir){
String cmd=sparkDir+ STOP_SH;
new ProcessUtil().executeBlock(cmd);
}
}