本文整理汇总了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();
}
示例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();
}
示例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));
}