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


Java Protos.Status方法代码示例

本文整理汇总了Java中org.apache.mesos.Protos.Status方法的典型用法代码示例。如果您正苦于以下问题:Java Protos.Status方法的具体用法?Java Protos.Status怎么用?Java Protos.Status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.mesos.Protos的用法示例。


在下文中一共展示了Protos.Status方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.apache.mesos.Protos; //导入方法依赖的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: launchTasks

import org.apache.mesos.Protos; //导入方法依赖的package包/类
@Deprecated
public Protos.Status launchTasks(Protos.OfferID offerId,
                                 Collection<Protos.TaskInfo> tasksToLaunch,
                                 Protos.Filters filters) {
    // Shouldn't be used
    throw new UnknownError();
}
 
开发者ID:retz,项目名称:retz,代码行数:8,代码来源:LocalSchedulerDriver.java

示例3: declineOffer

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status declineOffer(Protos.OfferID offerID) {
    declined.add(offerID);
    return Protos.Status.DRIVER_RUNNING;
}
 
开发者ID:retz,项目名称:retz,代码行数:5,代码来源:MesosSchedulerDummyDriver.java

示例4: sendFrameworkMessage

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status sendFrameworkMessage(Protos.ExecutorID executorID,
                                          Protos.SlaveID slaveID,
                                          byte[] data) {
    return Protos.Status.DRIVER_RUNNING;
}
 
开发者ID:retz,项目名称:retz,代码行数:6,代码来源:MesosSchedulerDummyDriver.java

示例5: exitCode

import org.apache.mesos.Protos; //导入方法依赖的package包/类
private static final int exitCode(final Protos.Status status) {
    return (status == Protos.Status.DRIVER_ABORTED ||
            status == Protos.Status.DRIVER_NOT_STARTED) ?
            -1 : 0;
}
 
开发者ID:mesosphere,项目名称:dcos-cassandra-service,代码行数:6,代码来源:ExecutorDriverDispatcher.java

示例6: abort

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status abort() {
    scheduler.disconnected(this);
    return Protos.Status.DRIVER_ABORTED;
}
 
开发者ID:retz,项目名称:retz,代码行数:5,代码来源:MesosSchedulerDummyDriver.java

示例7: sendFrameworkMessage

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status sendFrameworkMessage(Protos.ExecutorID executorId, Protos.SlaveID slaveId, byte[] data) {
    sentFrameworkMessages.add(new Message(executorId.getValue(), slaveId.getValue(), data));
    return status;
}
 
开发者ID:elodina,项目名称:java-mesos-util,代码行数:5,代码来源:TestSchedulerDriver.java

示例8: stop

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status stop(boolean b) {
    scheduler.disconnected(this);
    scheduler.reregistered(this, masterInfo);
    running.lazySet(false);
    return Protos.Status.DRIVER_STOPPED;
}
 
开发者ID:retz,项目名称:retz,代码行数:7,代码来源:LocalSchedulerDriver.java

示例9: requestResources

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status requestResources(Collection<Protos.Request> requests) {
    //scheduler.resourceOffers();
    return Protos.Status.DRIVER_RUNNING;
}
 
开发者ID:retz,项目名称:retz,代码行数:5,代码来源:LocalSchedulerDriver.java

示例10: sendFrameworkMessage

import org.apache.mesos.Protos; //导入方法依赖的package包/类
@Override
public Protos.Status sendFrameworkMessage(
    Protos.ExecutorID executorId,
    Protos.SlaveID slaveId, byte[] data) {
  return null;
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:7,代码来源:FakeSchedulerDriver.java

示例11: run

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public static int run(String... argv) {

        Configuration conf;
        try {
            conf = parseConfiguration(argv);
            if (conf.fileConfig.isTLS()) {
                LOG.warn("Make sure a valid certificate is being used or RetzExecutor may not work.");
            }
            Database.getInstance().init(conf.getServerConfig());
            if (conf.getServerConfig().getGc()) {
                GarbageJobCollector.start(conf.getServerConfig().getGcLeeway(), conf.getServerConfig().getGcInterval());
            } else {
                LOG.info("Automatic garbage collection is turned off; use retz-admin gc to collect old jobs");
            }

            RetzJmxServer.start(conf.getServerConfig());
        } catch (ParseException | URISyntaxException | IOException | JMException e) {
            LogUtil.error(LOG, "launch error", e);
            return -1;
        }

        Protos.FrameworkInfo fw = buildFrameworkInfo(conf);
        RetzScheduler scheduler;

        try {
            scheduler = new RetzScheduler(conf, fw);
        } catch (Throwable t) {
            LOG.error("Cannot initialize scheduler", t);
            return -1;
        }
        SchedulerDriver driver = SchedulerDriverFactory.create(scheduler, conf, fw);

        Protos.Status status = driver.start();

        if (status != Protos.Status.DRIVER_RUNNING) {
            LOG.error("Cannot start Mesos scheduler: {}", status.name());
            System.exit(-1);
            //} else if (status == Protos.Status.DRIVER_ABORTED) {
            //} else if (status == Protos.Status.DRIVER_NOT_STARTED) {
            //} else if (status == Protos.Status.DRIVER_STOPPED) {
        }

        LOG.info("Mesos scheduler started: {}", status.name());

        // Start web server
        WebConsole.start(conf.fileConfig);
        WebConsole.set(scheduler, driver);
        LOG.info("Web console has started with port {}", conf.getPort());

        java.lang.Runtime.getRuntime().addShutdownHook(new ShutdownThread(driver));

        // Stop them all, usually don't come here
        // Wait for Mesos framework stop
        status = driver.join();
        LOG.info("{} has been stopped: {}", RetzScheduler.FRAMEWORK_NAME, status.name());

        WebConsole.stop(); // Stop web server
        GarbageJobCollector.stop();
        Database.getInstance().stop();
        RetzJmxServer.stop();

        return (status == Protos.Status.DRIVER_STOPPED ? 0 : 255);
    }
 
开发者ID:retz,项目名称:retz,代码行数:64,代码来源:Launcher.java

示例12: suppressOffers

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status suppressOffers() {
    return Protos.Status.DRIVER_RUNNING;
}
 
开发者ID:retz,项目名称:retz,代码行数:4,代码来源:LocalSchedulerDriver.java

示例13: launchTasks

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status launchTasks(Collection<Protos.OfferID> offerIds, Collection<Protos.TaskInfo> tasks) {
    for (Protos.OfferID offerId : offerIds) acceptedOffers.add(offerId.getValue());
    launchedTasks.addAll(tasks);
    return status;
}
 
开发者ID:elodina,项目名称:java-mesos-util,代码行数:6,代码来源:TestSchedulerDriver.java

示例14: declineOffer

import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status declineOffer(Protos.OfferID id) {
    declinedOffers.add(id.getValue());
    return status;
}
 
开发者ID:elodina,项目名称:java-mesos-util,代码行数:5,代码来源:TestSchedulerDriver.java

示例15: start

import org.apache.mesos.Protos; //导入方法依赖的package包/类
@Override
public Protos.Status start() {
  return null;
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:5,代码来源:FakeSchedulerDriver.java


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