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(); }
.setName("sleepy") .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(); }