public static final class TaskState.Builder extends Object implements InputOutputResultPathBuilder<TaskState.Builder>, ParametersBuilder<TaskState.Builder>, ResultSelectorBuilder<TaskState.Builder>
TaskState
.Buildable.Utils
public TaskState.Builder resource(String resource)
resource
- URI of resource.public TaskState.Builder inputPath(String inputPath)
InputOutputPathBuilder
inputPath
in interface InputOutputPathBuilder<TaskState.Builder>
inputPath
- New path value.public TaskState.Builder resultPath(String resultPath)
ResultPathBuilder
resultPath
in interface ResultPathBuilder<TaskState.Builder>
resultPath
- New path value.public TaskState.Builder outputPath(String outputPath)
InputOutputPathBuilder
outputPath
in interface InputOutputPathBuilder<TaskState.Builder>
outputPath
- New path value.public TaskState.Builder parameters(String parameters)
ParametersBuilder
{
...
"Parameters": {
"flagged": true,
"parts": {
"first.$": "$.vals[0]",
"last3.$": "$.vals[3:]"
}
}
...
}
And suppose that the input to the state is as follows:
{
"flagged": 7,
"vals": [0, 10, 20, 30, 40, 50]
}
Then the effective input to the task will be as follows:
{
"flagged": true,
"parts": {
"first": 0,
"last3": [30, 40, 50]
}
}
parameters
in interface ParametersBuilder<TaskState.Builder>
parameters
- Raw JSON string representing Parameters value.public TaskState.Builder parameters(Object parameters)
ParametersBuilder
{
...
"Parameters": {
"flagged": true,
"parts": {
"first.$": "$.vals[0]",
"last3.$": "$.vals[3:]"
}
}
...
}
And suppose that the input to the state is as follows:
{
"flagged": 7,
"vals": [0, 10, 20, 30, 40, 50]
}
Then the effective input to the task will be as follows:
{
"flagged": true,
"parts": {
"first": 0,
"last3": [30, 40, 50]
}
}
parameters
in interface ParametersBuilder<TaskState.Builder>
parameters
- Object that will be serialized into the JSON document representing this states parameters.public TaskState.Builder resultSelector(String resultSelector)
ResultSelectorBuilder
{
...
"ResultSelector": {
"ClusterId.$": "$.output.ClusterId",
"ResourceType.$": "$.resourceType"
},
"ResultPath": "$.EMROutput"
...
}
Suppose the result of the Task is as follows:
{
...
"resourceType": "elasticmapreduce",
"output": {
"ClusterId": "AKIAIOSFODNN7EXAMPLE"
}
...
}
Then the effective result from the task will be as follows:
{
...
"EMROutput": {
"ClusterId": "AKIAIOSFODNN7EXAMPLE",
"ResourceType": "elasticmapreduce"
}
...
}
resultSelector
in interface ResultSelectorBuilder<TaskState.Builder>
resultSelector
- Raw JSON string representing ResultSelector value.public TaskState.Builder resultSelector(Object resultSelector)
ResultSelectorBuilder
{
...
"ResultSelector": {
"ClusterId.$": "$.output.ClusterId",
"ResourceType.$": "$.resourceType"
},
"ResultPath": "$.EMROutput"
...
}
Suppose the result of the Task is as follows:
{
...
"resourceType": "elasticmapreduce",
"output": {
"ClusterId": "AKIAIOSFODNN7EXAMPLE"
}
...
}
Then the effective result from the task will be as follows:
{
...
"EMROutput": {
"ClusterId": "AKIAIOSFODNN7EXAMPLE",
"ResourceType": "elasticmapreduce"
}
...
}
resultSelector
in interface ResultSelectorBuilder<TaskState.Builder>
resultSelector
- Object that will be serialized into the JSON document representing this state's ResultSelector.public TaskState.Builder comment(String comment)
comment
- New comment.public TaskState.Builder timeoutSeconds(Integer timeoutSeconds)
ErrorCodes.TIMEOUT
error.
TimeoutSeconds and TimeoutSecondsPath are mutually exclusive fields.timeoutSeconds
- Timeout value.public TaskState.Builder timeoutSecondsPath(String timeoutSecondsPath)
ErrorCodes.TIMEOUT
error.
TimeoutSeconds and TimeoutSecondsPath are mutually exclusive fields.timeoutSecondsPath
- Reference path to Timeout value in the input.public TaskState.Builder heartbeatSeconds(Integer heartbeatSeconds)
ErrorCodes.TIMEOUT
. If not set then no heartbeats are required. Heartbeats are a more granular
way
for a task to report it's progress to the state machine.
HeartbeatSeconds and HeartbeatSecondsPath are mutually exclusive fields.heartbeatSeconds
- Heartbeat value.public TaskState.Builder heartbeatSecondsPath(String heartbeatSecondsPath)
ErrorCodes.TIMEOUT
. If not set then no heartbeats are required. Heartbeats are a more granular
way
for a task to report it's progress to the state machine.
HeartbeatSeconds and HeartbeatSecondsPath are mutually exclusive fields.heartbeatSecondsPath
- Reference path to Heartbeat value in the input.public TaskState.Builder transition(Transition.Builder transition)
transition
- New transition.public TaskState.Builder retriers(Retrier.Builder... retrierBuilders)
Retrier
s to this states retriers. If the task exits abnormally (throws exception, times
out,
etc) it will be considered failed and eligible to be retried.retrierBuilders
- Instances of Retrier.Builder
. Note
that the Retrier
object is not built until the ParallelState
is built so any modifications on
the state builder will be reflected in this object.public TaskState.Builder retrier(Retrier.Builder retrierBuilder)
Retrier
to this states retriers. If the task exits abnormally (throws exception, times out,
etc) it will be considered failed and eligible to be retried.retrierBuilder
- Instance of Retrier.Builder
. Note
that the Retrier
object is not built until the ParallelState
is built so any modifications on
the
state builder will be reflected in this object.public TaskState.Builder catchers(Catcher.Builder... catcherBuilders)
Catcher
s to this states catchers. If the task exits abnormally (throws exception, times
out,
etc) it will be considered failed and eligible to be caught.catcherBuilders
- Instances of Catcher.Builder
. Note
that the Catcher
object is not built until the TaskState
is built so any modifications on the
state builder will be reflected in this object.public TaskState.Builder catcher(Catcher.Builder catcherBuilder)
Catcher
to this states catchers. If the task exits abnormally (throws exception, times out,
etc) it will be considered failed and eligible to be caught.catcherBuilder
- Instance of Catcher.Builder
. Note
that the Catcher
object is not built until the TaskState
is built so any modifications on the
state builder will be reflected in this object.