public class TaskLabelReader
extends java.lang.Object
Constructor and Description |
---|
TaskLabelReader(TaskInfo.Builder taskInfoBuilder) |
TaskLabelReader(TaskInfo taskInfo) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHostname()
Returns the hostname of the agent machine running the task.
|
int |
getIndex()
Returns the pod instance index of the task, or throws
TaskException if no index data was found. |
java.util.List<java.lang.String> |
getOfferAttributeStrings()
Returns the string representations of any
Offer Attribute s which were embedded in the task. |
java.util.Optional<java.lang.String> |
getRegion()
Returns the Region in which the Task was launched.
|
java.util.UUID |
getTargetConfiguration()
Returns the ID referencing a configuration in a
ConfigStore associated with the
task. |
java.lang.String |
getType()
Returns the task type string, which was embedded in the task.
|
java.util.Optional<java.lang.String> |
getZone()
Returns the Zone in which the Task was launched.
|
boolean |
hasReadinessCheckLabel()
Returns whether the task has a readiness check label.
|
boolean |
isPermanentlyFailed()
Returns whether the task is marked as permanently failed.
|
boolean |
isReadinessCheckSucceeded(TaskStatus taskStatus)
Returns whether or not a readiness check succeeded.
|
boolean |
isTransient()
Returns whether the task is marked as transient.
|
public TaskLabelReader(TaskInfo taskInfo)
LabelReader.LabelReader(String, Labels)
public TaskLabelReader(TaskInfo.Builder taskInfoBuilder)
LabelReader.LabelReader(String, Labels)
public java.lang.String getType() throws TaskException
TaskException
- if the type could not be found.public int getIndex() throws TaskException, java.lang.NumberFormatException
TaskException
if no index data was found.TaskException
- if the index data wasn't foundjava.lang.NumberFormatException
- if parsing the index as an integer failedpublic java.util.List<java.lang.String> getOfferAttributeStrings()
Offer
Attribute
s which were embedded in the task.public java.util.Optional<java.lang.String> getZone()
public java.util.Optional<java.lang.String> getRegion()
public java.lang.String getHostname() throws TaskException
TaskException
public java.util.UUID getTargetConfiguration() throws TaskException
ConfigStore
associated with the
task.TaskInfo
TaskException
- when a TaskInfo is provided which does not contain a Label
with
an indicated target configurationpublic boolean isReadinessCheckSucceeded(TaskStatus taskStatus)
taskStatus
- A TaskStatus which may or may not contain a readiness check outcome labelpublic boolean isTransient()
public boolean isPermanentlyFailed()
public boolean hasReadinessCheckLabel()