当前位置: 首页>>代码示例>>Java>>正文


Java MesosExecutorDriver.run方法代码示例

本文整理汇总了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();
    }
}
 
开发者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: 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

示例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);
}
 
开发者ID:mesosphere,项目名称:cassandra-mesos-deprecated,代码行数:22,代码来源:CassandraExecutor.java

示例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();
}
 
开发者ID:HubSpot,项目名称:Singularity,代码行数:19,代码来源:SingularityExecutorRunner.java

示例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);
    }
}
 
开发者ID:triforkse,项目名称:logstash-mesos,代码行数:35,代码来源:Application.java

示例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);
        }
    }
 
开发者ID:mesos,项目名称:logstash,代码行数:28,代码来源:Application.java

示例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();
}
 
开发者ID:WTIGER001,项目名称:Brigade,代码行数:6,代码来源:MyExecutor.java


注:本文中的org.apache.mesos.MesosExecutorDriver.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。