本文整理汇总了Java中org.apache.mesos.MesosExecutorDriver类的典型用法代码示例。如果您正苦于以下问题:Java MesosExecutorDriver类的具体用法?Java MesosExecutorDriver怎么用?Java MesosExecutorDriver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MesosExecutorDriver类属于org.apache.mesos包,在下文中一共展示了MesosExecutorDriver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public static void main(String[] args) {
System.out.println("Starting executor");
if (new File("config").mkdir()) {
System.out.println("Created config directory");
}
MustacheFactory mustacheFactory = new DefaultMustacheFactory();
final Mustache filebeatMustache = mustacheFactory.compile("filebeat.yaml.mustache");
final Mustache metricbeatMustache = mustacheFactory.compile("metricbeat.yaml.mustache");
try {
MesosExecutorDriver driver = new MesosExecutorDriver(new HumioExecutor(filebeatMustache, metricbeatMustache));
final Protos.Status status = driver.run();
System.out.println("status = " + status);
if (status.equals(Protos.Status.DRIVER_STOPPED)) {
System.exit(0);
} else {
System.err.println("Error: " + status);
}
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:humio,项目名称:dcos2humio,代码行数:25,代码来源:ExecutorApplication.java
示例2: run
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public Protos.Status run() {
LOG.info("{} starting MesosExecutorDriver...", name);
final MesosExecutorDriver driver = new MesosExecutorDriver(singularityExecutor);
Runtime.getRuntime().addShutdownHook(new Thread("SingularityExecutorRunnerGracefulShutdown") {
@Override
public void run() {
LOG.info("Executor is shutting down, ensuring shutdown via shutdown hook");
monitor.shutdown(Optional.of((ExecutorDriver) driver));
}
});
return driver.run();
}
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:18,代码来源:SingularityExecutorRunner.java
示例3: prepare
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
@Override
public void prepare(Map conf, String localDir) {
_executor = new StormExecutor();
_driver = new MesosExecutorDriver(_executor);
_driver.start();
LOG.info("Waiting for executor to initialize...");
_conf = conf;
try {
_executor.waitUntilRegistered();
if (startLogViewer(conf)) {
LOG.info("Starting logviewer...");
LogViewerController logController = new LogViewerController(conf);
logController.start();
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
LOG.info("Executor initialized...");
Thread suicide = new SuicideDetector(conf);
suicide.setDaemon(true);
suicide.start();
}
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:25,代码来源:MesosSupervisor.java
示例4: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public static void main(final String[] args) {
final MesosExecutorDriver driver = new MesosExecutorDriver(new HazelcastExecutor());
final int status;
switch (driver.run()) {
case DRIVER_STOPPED:
status = 0;
break;
case DRIVER_ABORTED:
status = 1;
break;
case DRIVER_NOT_STARTED:
status = 2;
break;
default:
status = 3;
break;
}
driver.stop();
System.exit(status);
}
开发者ID:hazelcast,项目名称:hazelcast-mesos,代码行数:22,代码来源:HazelcastExecutor.java
示例5: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public static void main(final String[] args) {
final MesosExecutorDriver driver = new MesosExecutorDriver(new CassandraExecutor(new ProdObjectFactory()));
final int status;
switch (driver.run()) {
case DRIVER_STOPPED:
status = 0;
break;
case DRIVER_ABORTED:
status = 1;
break;
case DRIVER_NOT_STARTED:
status = 2;
break;
default:
status = 3;
break;
}
driver.stop();
System.exit(status);
}
开发者ID:mesosphere,项目名称:cassandra-mesos-deprecated,代码行数:22,代码来源:CassandraExecutor.java
示例6: run
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public Protos.Status run() {
LOG.info("{} starting MesosExecutorDriver...", name);
final MesosExecutorDriver driver = new MesosExecutorDriver(singularityExecutor);
monitor.start(driver);
Runtime.getRuntime().addShutdownHook(new Thread("SingularityExecutorRunnerGracefulShutdown") {
@Override
public void run() {
LOG.info("Executor is shutting down, ensuring shutdown via shutdown hook");
monitor.shutdown(driver);
}
});
return driver.run();
}
开发者ID:HubSpot,项目名称:Singularity,代码行数:19,代码来源:SingularityExecutorRunner.java
示例7: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public static void main(String[] args) {
BasicConfigurator.configure(); // log4j setup
LOGGER.info("Starting Executer");
MesosExecutorDriver driver = new MesosExecutorDriver(new EchoExecutor());
System.exit(driver.run() == Protos.Status.DRIVER_STOPPED ? 0 : 1);
}
开发者ID:mason,项目名称:mesos-echo,代码行数:8,代码来源:EchoExecutor.java
示例8: addShutdownHook
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
private static void addShutdownHook(final CrateExecutor executor, final MesosExecutorDriver driver) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
executor.forceShutdownCrate(driver);
}
});
}
开发者ID:crate,项目名称:crate-mesos-framework,代码行数:9,代码来源:CrateExecutor.java
示例9: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
/**
* Main method for executor.
*/
public static void main(String[] args) throws IOException {
BasicConfigurator.configure();
LOGGER.debug("Launch executor process ...");
final CrateExecutor executor = new CrateExecutor();
MesosExecutorDriver driver = new MesosExecutorDriver(executor);
addShutdownHook(executor, driver);
System.exit(driver.run() == Status.DRIVER_STOPPED ? 0 : 1);
}
开发者ID:crate,项目名称:crate-mesos-framework,代码行数:12,代码来源:CrateExecutor.java
示例10: run
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public void run() {
DockerClient dockerClient = new DockerClient();
FileLogSteamWriter writer = new FileLogSteamWriter(MAX_LOG_SIZE);
DockerStreamer streamer = new DockerStreamer(writer, dockerClient);
DockerLogStreamManager streamManager = new DockerLogStreamManager(streamer);
LogstashService logstashService = new LogstashService(dockerClient);
logstashService.start();
ConfigManager configManager = new ConfigManager(logstashService, dockerClient, streamManager);
LiveState liveState = new LiveState(logstashService, dockerClient, streamManager);
LogstashExecutor executor = new LogstashExecutor(configManager, dockerClient, liveState);
MesosExecutorDriver driver = new MesosExecutorDriver(executor);
// we start after the config manager is initiated
// because it's sets a frameworkListener
dockerClient.start();
LOGGER.info("Mesos Logstash Executor Started");
Protos.Status status = driver.run();
LOGGER.info("Mesos Logstash Executor Stopped");
logstashService.stop();
dockerClient.stop();
if (status.equals(Protos.Status.DRIVER_STOPPED)) {
System.exit(0);
} else {
System.exit(1);
}
}
开发者ID:triforkse,项目名称:logstash-mesos,代码行数:35,代码来源:Application.java
示例11: run
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public void run() {
LogstashService logstashService = new LogstashService();
// LiveState liveState = new LiveState(logstashService, dockerClient);
LogstashExecutor executor = new LogstashExecutor(logstashService);
MesosExecutorDriver driver = new MesosExecutorDriver(executor);
// we start after the config manager is initiated
// because it's sets a frameworkListener
// dockerClient.start();
LOGGER.info("Mesos Logstash Executor Started");
Protos.Status status = driver.run();
LOGGER.info("Mesos Logstash Executor Stopped");
// logstashService.stop();
// dockerClient.stop();
if (status.equals(Protos.Status.DRIVER_STOPPED)) {
System.exit(0);
}
else {
System.exit(1);
}
}
开发者ID:mesos,项目名称:logstash,代码行数:28,代码来源:Application.java
示例12: serviceStart
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
@Override
protected void serviceStart() throws Exception {
LOGGER.info("Starting MyriadExecutor...");
myriadExecutorThread = new Thread(new Runnable() {
public void run() {
driver = new MesosExecutorDriver(new MyriadExecutor(containerIds));
LOGGER.error("MyriadExecutor exit with status " + Integer.toString(driver.run() == Status.DRIVER_STOPPED ? 0 : 1));
}
});
myriadExecutorThread.start();
}
开发者ID:apache,项目名称:incubator-myriad,代码行数:13,代码来源:MyriadExecutorAuxService.java
示例13: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
/**
* Main method for executor, which injects the configuration and state and starts the driver.
*/
public static void main(String[] args) {
Injector injector = Guice.createInjector();
MesosExecutorDriver driver = new MesosExecutorDriver(injector.getInstance(NodeExecutor.class));
System.exit(driver.run() == Status.DRIVER_STOPPED ? 0 : 1);
}
开发者ID:jan-zajic,项目名称:mesos-hbase,代码行数:10,代码来源:NodeExecutor.java
示例14: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
/**
* Main method which injects the configuration and state and creates the driver.
*/
public static void main(String[] args) {
Injector injector = Guice.createInjector();
MesosExecutorDriver driver = new MesosExecutorDriver(
injector.getInstance(AbstractNodeExecutor.class));
System.exit(driver.run() == Status.DRIVER_STOPPED ? 0 : 1);
}
开发者ID:jan-zajic,项目名称:mesos-hbase,代码行数:10,代码来源:AbstractNodeExecutor.java
示例15: REEFExecutor
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
@Inject
REEFExecutor(final EvaluatorControlHandler evaluatorControlHandler,
final MesosRemoteManager mesosRemoteManager,
final REEFFileNames fileNames,
@Parameter(MesosExecutorId.class) final String mesosExecutorId) {
this.mesosRemoteManager = mesosRemoteManager;
this.mesosRemoteManager.registerHandler(EvaluatorControl.class, evaluatorControlHandler);
this.mesosExecutorDriver = new MesosExecutorDriver(this);
this.executorService = Executors.newCachedThreadPool();
this.fileNames = fileNames;
this.mesosExecutorId = mesosExecutorId;
}
开发者ID:apache,项目名称:reef,代码行数:13,代码来源:REEFExecutor.java
示例16: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
/**
* Main: Entry point for executor, invoked by Mesos framework
*/
public static void main(String[] args) throws Exception {
System.out.println("Starting executor: " + BdsMesosExecutor.class.getSimpleName());
MesosExecutorDriver driver = new MesosExecutorDriver(new BdsMesosExecutor());
System.out.println("Finished executor: " + BdsMesosExecutor.class.getSimpleName());
System.exit(driver.run() == Status.DRIVER_STOPPED ? 0 : 1);
}
开发者ID:pcingola,项目名称:BigDataScript,代码行数:10,代码来源:BdsMesosExecutor.java
示例17: execute
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
/**
* 执行作业.
*/
public static void execute() {
MesosExecutorDriver driver = new MesosExecutorDriver(new TaskExecutor());
System.exit(Protos.Status.DRIVER_STOPPED == driver.run() ? 0 : -1);
}
开发者ID:elasticjob,项目名称:elastic-job-cloud,代码行数:8,代码来源:JobBootstrap.java
示例18: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public static void main(String[] args) {
MesosExecutorDriver mesosExecutorDriver = new MesosExecutorDriver(new PiExecutor());
System.exit(mesosExecutorDriver.run() == Protos.Status.DRIVER_STOPPED ? 0 : 1);
}
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:5,代码来源:PiExecutor.java
示例19: main
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
public static void main(String[] args) {
MesosExecutorDriver driver = new MesosExecutorDriver(new MesosExecutor());
System.exit(driver.run() == Status.DRIVER_STOPPED ? 0 : 1);
}
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:5,代码来源:MesosExecutor.java
示例20: getDriver
import org.apache.mesos.MesosExecutorDriver; //导入依赖的package包/类
@Override
public ExecutorDriver getDriver(Executor executor) {
return new MesosExecutorDriver(executor);
}
开发者ID:mesosphere,项目名称:dcos-cassandra-service,代码行数:5,代码来源:MesosExecutorDriverFactory.java
注:本文中的org.apache.mesos.MesosExecutorDriver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论