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


Java FrameworkInfo.newBuilder方法代码示例

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


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

示例1: getFrameworkInfo

import org.apache.mesos.Protos.FrameworkInfo; //导入方法依赖的package包/类
public static FrameworkInfo getFrameworkInfo() {
    FrameworkInfo.Builder builder = FrameworkInfo.newBuilder();
    builder.setFailoverTimeout(5);
    builder.setUser("");
    builder.setName(FRAMEWORK_NAME);
    return builder.build();
}
 
开发者ID:hazelcast,项目名称:hazelcast-mesos,代码行数:8,代码来源:HazelcastMain.java

示例2: getFrameworkInfo

import org.apache.mesos.Protos.FrameworkInfo; //导入方法依赖的package包/类
private static FrameworkInfo getFrameworkInfo() {
	FrameworkInfo.Builder builder = FrameworkInfo.newBuilder();
	builder.setFailoverTimeout(120000);
	builder.setUser("");
	builder.setName(frameworkName);
	return builder.build();
}
 
开发者ID:lhzsantana,项目名称:federator,代码行数:8,代码来源:Manager.java

示例3: InternalSchedulerDriver

import org.apache.mesos.Protos.FrameworkInfo; //导入方法依赖的package包/类
/**
 * Creates a new driver for the specified scheduler. The master
 * must be specified as
 *
 *     zk://host1:port1,host2:port2,.../path
 *     zk://username:[email protected]:port1,host2:port2,.../path
 *
 * The driver will attempt to "failover" if the specified
 * FrameworkInfo includes a valid FrameworkID.
 */
protected InternalSchedulerDriver(final Scheduler scheduler,
                                  final FrameworkInfo frameworkInfo,
                                  final String master,
                                  boolean implicitAcknowledges,
                                  final Credential credential)
                throws IOException
{
    this.scheduler = checkNotNull(scheduler, "scheduler is null");
    checkNotNull(frameworkInfo, "frameworkInfo is null");
    checkNotNull(master, "master is null");
    this.implicitAcknowledges = implicitAcknowledges;
    this.credential = credential;

    checkState(!master.equals("local"), "Java client can not launch a local cluster!");

    // TODO - Any volunteers to do the SASL dance?
    checkState(this.credential == null, "Credential is not supported yet.");

    final FrameworkInfo.Builder frameworkInfoBuilder = FrameworkInfo.newBuilder(frameworkInfo);

    if (!frameworkInfo.hasHostname()) {
        frameworkInfoBuilder.setHostname(NetworkUtil.findPublicIp());
    }

    if (!frameworkInfo.hasUser() || "".equals(frameworkInfo.getUser())) {
        frameworkInfoBuilder.setUser(System.getProperty("user.name"));
    }

    context = new SchedulerDriverContext(frameworkInfoBuilder.build());

    this.eventBus = new ManagedEventBus("scheduler");

    this.localMessageProcessor = new LocalSchedulerMessageProcessor(context, eventBus, implicitAcknowledges);

    // Closer closes in reverse registration order.

    // Close the callback executor last, so that everything that was still scheduled to be delivered to the framework still has a chance.
    this.callbackExecutor = closer.register(CloseableExecutors.decorate(Executors.newScheduledThreadPool(5, new ThreadFactoryBuilder().setDaemon(true).setNameFormat("scheduler-callback-%d").build())));

    this.receiver = closer.register(new HttpProtocolReceiver(context.getDriverUPID(), SchedulerMessageEnvelope.class, eventBus));

    // The sender is closed before the receiver, so that possible responses are still caught
    this.sender = closer.register(new HttpProtocolSender(context.getDriverUPID()));

    // Make sure that the event bus is drained next at shutdown.
    closer.register(eventBus);

    // Close the master detector first. No more master changes required.
    this.detector = closer.register(new ZookeeperMasterDetector(master, eventBus));

}
 
开发者ID:groupon,项目名称:jesos,代码行数:62,代码来源:InternalSchedulerDriver.java


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