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 org.apache.mesos.v1.Protos.FrameworkInfoOrBuilder getFrameworkInfoOrBuilder() { if (frameworkInfoBuilder_ != null) { return frameworkInfoBuilder_.getMessageOrBuilder(); } else { return frameworkInfo_ == null ? org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance() : frameworkInfo_; } } /**
.setFrameworkId(frameworkInfo.getId()) .setSubscribe(Call.Subscribe.newBuilder() .setFrameworkInfo(frameworkInfo)
org.apache.mesos.v1.Protos.FrameworkInfo.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = frameworkInfo_.toBuilder();
.setFrameworkId(frameworkInfo.getId()) .setSubscribe(Call.Subscribe.newBuilder() .setFrameworkInfo(frameworkInfo)
org.apache.mesos.v1.Protos.FrameworkInfo.Builder subBuilder = null; if (((bitField0_ & 0x00000001) == 0x00000001)) { subBuilder = frameworkInfo_.toBuilder();
Protos.FrameworkInfo.newBuilder() .setId(stateObject.getFwId()) .setUser(Optional.ofNullable(System.getenv("user")).orElse("root")) // https://issues.apache.org/jira/browse/MESOS-3747
if (hasFrameworkInfo()) { result = result && getFrameworkInfo() .equals(other.getFrameworkInfo());
return false; if (!getFrameworkInfo().isInitialized()) { memoizedIsInitialized = 0; return false;
/** * 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); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasExecutorInfo()) { hash = (37 * hash) + EXECUTOR_INFO_FIELD_NUMBER; hash = (53 * hash) + getExecutorInfo().hashCode(); } if (hasFrameworkInfo()) { hash = (37 * hash) + FRAMEWORK_INFO_FIELD_NUMBER; hash = (53 * hash) + getFrameworkInfo().hashCode(); } if (hasAgentInfo()) { hash = (37 * hash) + AGENT_INFO_FIELD_NUMBER; hash = (53 * hash) + getAgentInfo().hashCode(); } if (hasContainerId()) { hash = (37 * hash) + CONTAINER_ID_FIELD_NUMBER; hash = (53 * hash) + getContainerId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * 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); }
/** * <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 mergeFrameworkInfo(org.apache.mesos.v1.Protos.FrameworkInfo value) { if (frameworkInfoBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && frameworkInfo_ != null && frameworkInfo_ != org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance()) { frameworkInfo_ = org.apache.mesos.v1.Protos.FrameworkInfo.newBuilder(frameworkInfo_).mergeFrom(value).buildPartial(); } else { frameworkInfo_ = value; } onChanged(); } else { frameworkInfoBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
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(); }
public final boolean isInitialized() { if (!hasExecutorInfo()) { return false; } if (!hasFrameworkInfo()) { return false; } if (!hasAgentInfo()) { return false; } if (!getExecutorInfo().isInitialized()) { return false; } if (!getFrameworkInfo().isInitialized()) { return false; } if (!getAgentInfo().isInitialized()) { return false; } if (hasContainerId()) { if (!getContainerId().isInitialized()) { return false; } } return true; }
/** * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code> */ public Builder mergeFrameworkInfo(org.apache.mesos.v1.Protos.FrameworkInfo value) { if (frameworkInfoBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && frameworkInfo_ != null && frameworkInfo_ != org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance()) { frameworkInfo_ = org.apache.mesos.v1.Protos.FrameworkInfo.newBuilder(frameworkInfo_).mergeFrom(value).buildPartial(); } else { frameworkInfo_ = value; } onChanged(); } else { frameworkInfoBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.mesos.v1.scheduler.Protos.Call.Subscribe)) { return super.equals(obj); } org.apache.mesos.v1.scheduler.Protos.Call.Subscribe other = (org.apache.mesos.v1.scheduler.Protos.Call.Subscribe) obj; boolean result = true; result = result && (hasFrameworkInfo() == other.hasFrameworkInfo()); if (hasFrameworkInfo()) { result = result && getFrameworkInfo() .equals(other.getFrameworkInfo()); } result = result && getSuppressedRolesList() .equals(other.getSuppressedRolesList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasFrameworkInfo()) { hash = (37 * hash) + FRAMEWORK_INFO_FIELD_NUMBER; hash = (53 * hash) + getFrameworkInfo().hashCode(); } if (getSuppressedRolesCount() > 0) { hash = (37 * hash) + SUPPRESSED_ROLES_FIELD_NUMBER; hash = (53 * hash) + getSuppressedRolesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasFrameworkInfo()) { memoizedIsInitialized = 0; return false; } if (!getFrameworkInfo().isInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
/** * <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 org.apache.mesos.v1.Protos.FrameworkInfo getFrameworkInfo() { if (frameworkInfoBuilder_ == null) { return frameworkInfo_ == null ? org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance() : frameworkInfo_; } else { return frameworkInfoBuilder_.getMessage(); } } /**