private FrameworkInfo buildFrameworkInfo() { final FrameworkInfo.Builder frameworkInfoBuilder = FrameworkInfo.newBuilder() .setCheckpoint(mesosConfiguration.isCheckpoint()) .setFailoverTimeout(mesosConfiguration.getFrameworkFailoverTimeout()) .setName(mesosConfiguration.getFrameworkName()) .setId(FrameworkID.newBuilder().setValue(mesosConfiguration.getFrameworkId())) .setUser(mesosConfiguration.getFrameworkUser()); // https://issues.apache.org/jira/browse/MESOS-3747 if (configuration.getMesosConfiguration().getCredentialPrincipal().isPresent()) { frameworkInfoBuilder.setPrincipal(configuration.getMesosConfiguration().getCredentialPrincipal().get()); } if (configuration.getHostname().isPresent()) { frameworkInfoBuilder.setHostname(configuration.getHostname().get()); } // only set the web UI URL if it's fully qualified if (singularityUriBase.startsWith("http://") || singularityUriBase.startsWith("https://")) { if (configuration.getUiConfiguration().getRootUrlMode() == UIConfiguration.RootUrlMode.INDEX_CATCHALL) { frameworkInfoBuilder.setWebuiUrl(singularityUriBase); } else { frameworkInfoBuilder.setWebuiUrl(singularityUriBase + UiResource.UI_RESOURCE_LOCATION); } } if (mesosConfiguration.getFrameworkRole().isPresent()) { frameworkInfoBuilder.setRole(mesosConfiguration.getFrameworkRole().get()); } return frameworkInfoBuilder.build(); }
/** * Utility method to more succinctly construct a {@link Call Call} of type {@link Type#SUBSCRIBE SUBSCRIBE}. * <p> * * @param frameworkId The frameworkId to set on the {@link Protos.FrameworkInfo FrameworkInfo} and * {@link Call Call} messages. * @param user The user to set on the {@link Protos.FrameworkInfo FrameworkInfo} message. * @param frameworkName The name to set on the {@link Protos.FrameworkInfo FrameworkInfo} message. * @param failoverTimeoutSeconds The failoverTimeoutSeconds to set on the * {@link Protos.FrameworkInfo FrameworkInfo} message. * @return An {@link Call Call} of type {@link Type#SUBSCRIBE SUBSCRIBE} with the configured * {@link Subscribe Subscribe} sub-message. */ @NotNull public static Call subscribe( @NotNull final Protos.FrameworkID frameworkId, @NotNull final String user, @NotNull final String frameworkName, final long failoverTimeoutSeconds ) { final Protos.FrameworkInfo frameworkInfo = Protos.FrameworkInfo.newBuilder() .setId(frameworkId) .setUser(user) .setName(frameworkName) .setFailoverTimeout(failoverTimeoutSeconds) .build(); return subscribe(frameworkId, frameworkInfo); }
/** * Utility method to more succinctly construct a {@link Call Call} of type {@link Type#SUBSCRIBE SUBSCRIBE}. * <p> * * @param frameworkId The frameworkId to set on the {@link Protos.FrameworkInfo FrameworkInfo} and * {@link Call Call} messages. * @param user The user to set on the {@link Protos.FrameworkInfo FrameworkInfo} message. * @param frameworkName The name to set on the {@link Protos.FrameworkInfo FrameworkInfo} message. * @param failoverTimeoutSeconds The failoverTimeoutSeconds to set on the * {@link Protos.FrameworkInfo FrameworkInfo} message. * @return An {@link Call Call} of type {@link Type#SUBSCRIBE SUBSCRIBE} with the configured * {@link Subscribe Subscribe} sub-message. */ @NotNull public static Call subscribe( @NotNull final Protos.FrameworkID frameworkId, @NotNull final String user, @NotNull final String frameworkName, final long failoverTimeoutSeconds ) { final Protos.FrameworkInfo frameworkInfo = Protos.FrameworkInfo.newBuilder() .setId(frameworkId) .setUser(user) .setName(frameworkName) .setFailoverTimeout(failoverTimeoutSeconds) .build(); return subscribe(frameworkId, frameworkInfo); }
.setFailoverTimeout(0) .setRole(stateObject.getResourceRole()) .build() );
private FrameworkInfo buildFrameworkInfo() { final FrameworkInfo.Builder frameworkInfoBuilder = FrameworkInfo.newBuilder() .setCheckpoint(mesosConfiguration.isCheckpoint()) .setFailoverTimeout(mesosConfiguration.getFrameworkFailoverTimeout()) .setName(mesosConfiguration.getFrameworkName()) .setId(FrameworkID.newBuilder().setValue(mesosConfiguration.getFrameworkId())) .setUser(mesosConfiguration.getFrameworkUser()); // https://issues.apache.org/jira/browse/MESOS-3747 if (configuration.getMesosConfiguration().getCredentialPrincipal().isPresent()) { frameworkInfoBuilder.setPrincipal(configuration.getMesosConfiguration().getCredentialPrincipal().get()); } if (configuration.getHostname().isPresent()) { frameworkInfoBuilder.setHostname(configuration.getHostname().get()); } // only set the web UI URL if it's fully qualified if (singularityUriBase.startsWith("http://") || singularityUriBase.startsWith("https://")) { if (configuration.getUiConfiguration().getRootUrlMode() == UIConfiguration.RootUrlMode.INDEX_CATCHALL) { frameworkInfoBuilder.setWebuiUrl(singularityUriBase); } else { frameworkInfoBuilder.setWebuiUrl(singularityUriBase + UiResource.UI_RESOURCE_LOCATION); } } if (mesosConfiguration.getFrameworkRole().isPresent()) { frameworkInfoBuilder.setRole(mesosConfiguration.getFrameworkRole().get()); } return frameworkInfoBuilder.build(); }
/** * <pre> * See the comments below on 'framework_id' on the semantics for * 'framework_info.id'. * </pre> * * <code>required .mesos.v1.FrameworkInfo framework_info = 1;</code> */ public Builder setFrameworkInfo( org.apache.mesos.v1.Protos.FrameworkInfo.Builder builderForValue) { if (frameworkInfoBuilder_ == null) { frameworkInfo_ = builderForValue.build(); onChanged(); } else { frameworkInfoBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000001; return this; } /**
/** * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code> */ public Builder setFrameworkInfo( org.apache.mesos.v1.Protos.FrameworkInfo.Builder builderForValue) { if (frameworkInfoBuilder_ == null) { frameworkInfo_ = builderForValue.build(); onChanged(); } else { frameworkInfoBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; return this; } /**