本文整理汇总了Java中org.apache.mesos.MesosExecutorDriver.run方法的典型用法代码示例。如果您正苦于以下问题:Java MesosExecutorDriver.run方法的具体用法?Java MesosExecutorDriver.run怎么用?Java MesosExecutorDriver.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.mesos.MesosExecutorDriver
的用法示例。
在下文中一共展示了MesosExecutorDriver.run方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例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();
}
示例3: 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);
}
示例4: 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);
}
示例5: 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();
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: main
import org.apache.mesos.MesosExecutorDriver; //导入方法依赖的package包/类
public static void main(String[] args) {
MyExecutor exe = new MyExecutor();
MesosExecutorDriver driver = new MesosExecutorDriver(exe);
driver.run();
}