public class TaskLabelWriter
extends java.lang.Object
| Constructor and Description |
|---|
TaskLabelWriter(TaskInfo.Builder taskInfoBuilder) |
TaskLabelWriter(TaskInfo taskInfo) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Optional<HealthCheck> |
getReadinessCheck()
Returns the embedded readiness check, or an empty Optional if no readiness check is configured.
|
TaskLabelWriter |
setGoalState(GoalState goalState)
Sets a label on a TaskInfo indicating the Task's
GoalState, e.g. |
TaskLabelWriter |
setHostname(Offer launchOffer)
Stores the agent hostname from the provided
Offer. |
TaskLabelWriter |
setIndex(int index)
Assigns the pod instance index to the provided task.
|
TaskLabelWriter |
setOfferAttributes(Offer launchOffer)
Stores the
Attributes from the provided Offer. |
TaskLabelWriter |
setPermanentlyFailed()
Ensures that the task is identified as permanently failed.
|
TaskLabelWriter |
setReadinessCheck(HealthCheck readinessCheck)
Stores an encoded version of the
HealthCheck as a readiness check. |
TaskLabelWriter |
setReadinessCheckEnvvar(java.lang.String key,
java.lang.String value)
Updates the stored readiness check, if any, to have the provided environment variable.
|
TaskLabelWriter |
setRegion(Protos.DomainInfo.FaultDomain.RegionInfo region)
Stores the
org.apache.mesos.Protos.DomainInfo.FaultDomain.RegionInfo. |
TaskLabelWriter |
setTargetConfiguration(java.util.UUID targetConfigurationId)
Sets a
Label indicating the target configuration. |
TaskLabelWriter |
setTransient()
Ensures that the task is identified as a transient task.
|
TaskLabelWriter |
setType(java.lang.String taskType)
Stores the provided task type string.
|
TaskLabelWriter |
setZone(Protos.DomainInfo.FaultDomain.ZoneInfo zone)
Stores the
org.apache.mesos.Protos.DomainInfo.FaultDomain.ZoneInfo. |
Labels |
toProto()
Returns a protobuf representation of all contained label entries.
|
public TaskLabelWriter(TaskInfo taskInfo)
LabelWriter.LabelWriter(Labels)public TaskLabelWriter(TaskInfo.Builder taskInfoBuilder)
LabelWriter.LabelWriter(Labels)public TaskLabelWriter setTransient()
public TaskLabelWriter setPermanentlyFailed()
public TaskLabelWriter setType(java.lang.String taskType)
public TaskLabelWriter setIndex(int index)
public TaskLabelWriter setOfferAttributes(Offer launchOffer)
Attributes from the provided Offer.
Any existing stored attributes are overwritten.public TaskLabelWriter setZone(Protos.DomainInfo.FaultDomain.ZoneInfo zone)
org.apache.mesos.Protos.DomainInfo.FaultDomain.ZoneInfo.
Any existing stored zone information is overwritten.public TaskLabelWriter setRegion(Protos.DomainInfo.FaultDomain.RegionInfo region)
org.apache.mesos.Protos.DomainInfo.FaultDomain.RegionInfo.
Any existing stored region information is overwritten.public TaskLabelWriter setHostname(Offer launchOffer)
Offer.
Any existing stored hostname is overwritten.public TaskLabelWriter setGoalState(GoalState goalState)
GoalState, e.g. RUNNING, FINISH or ONCE.public TaskLabelWriter setTargetConfiguration(java.util.UUID targetConfigurationId)
Label indicating the target configuration.targetConfigurationId - ID referencing a particular Configuration in the
ConfigStorepublic TaskLabelWriter setReadinessCheck(HealthCheck readinessCheck)
HealthCheck as a readiness check.
Any existing stored readiness check is overwritten.public TaskLabelWriter setReadinessCheckEnvvar(java.lang.String key, java.lang.String value) throws TaskException
TaskException - if parsing a previously set HealthCheckpublic Labels toProto()
protected java.util.Optional<HealthCheck> getReadinessCheck()
throws TaskException
TaskException