All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.insight.core.mesos.MCDLauncher Maven / Gradle / Ivy

The newest version!
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);
    }

    public static void main(String[] args){
        //launch("/home/andershong/Dev/spark-2.0.2-bin-hadoop2.7","mesos://localhost:5050");
        stop("/home/datastax/Dev/spark-2.0.2-bin-hadoop2.7");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy