本文整理汇总了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();
}
}
示例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();
}
示例3: declineOffer
import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status declineOffer(Protos.OfferID offerID) {
declined.add(offerID);
return Protos.Status.DRIVER_RUNNING;
}
示例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;
}
示例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;
}
示例6: abort
import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status abort() {
scheduler.disconnected(this);
return Protos.Status.DRIVER_ABORTED;
}
示例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;
}
示例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;
}
示例9: requestResources
import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status requestResources(Collection<Protos.Request> requests) {
//scheduler.resourceOffers();
return Protos.Status.DRIVER_RUNNING;
}
示例10: sendFrameworkMessage
import org.apache.mesos.Protos; //导入方法依赖的package包/类
@Override
public Protos.Status sendFrameworkMessage(
Protos.ExecutorID executorId,
Protos.SlaveID slaveId, byte[] data) {
return null;
}
示例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);
}
示例12: suppressOffers
import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status suppressOffers() {
return Protos.Status.DRIVER_RUNNING;
}
示例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;
}
示例14: declineOffer
import org.apache.mesos.Protos; //导入方法依赖的package包/类
public Protos.Status declineOffer(Protos.OfferID id) {
declinedOffers.add(id.getValue());
return status;
}
示例15: start
import org.apache.mesos.Protos; //导入方法依赖的package包/类
@Override
public Protos.Status start() {
return null;
}