Class DistributedMap
- All Implemented Interfaces:
IChainable
,INextable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
A Map
state can be used to run a set of steps for each element of an input array.
A Map state will execute the same steps for multiple entries of an array in the state input.
While the Parallel state executes multiple branches of steps using the same input, a Map state will execute the same steps for multiple entries of an array in the state input.
A Map
state in Distributed
mode will execute a child workflow for each iteration of the Map state.
This serves to increase concurrency and allows for larger workloads to be run in a single state machine.
Example:
DistributedMap distributedMap = DistributedMap.Builder.create(this, "Distributed Map State") .maxConcurrency(1) .itemsPath(JsonPath.stringAt("$.inputForMap")) .build(); distributedMap.itemProcessor(new Pass(this, "Pass State"));
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.IChainable
IChainable.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.INextable
INextable.Jsii$Default, INextable.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
DistributedMap
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
DistributedMap
(software.amazon.jsii.JsiiObjectRef objRef) DistributedMap
(software.constructs.Construct scope, String id) DistributedMap
(software.constructs.Construct scope, String id, DistributedMapProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddCatch
(IChainable handler) Add a recovery handler for this state.addCatch
(IChainable handler, CatchProps props) Add a recovery handler for this state.addRetry()
Add retry configuration for this state.addRetry
(RetryProps props) Add retry configuration for this state.static Boolean
Return whether the given object is a DistributedMap.itemProcessor
(IChainable processor) Define item processor in a Distributed Map.itemProcessor
(IChainable processor, ProcessorConfig config) Define item processor in a Distributed Map.com.fasterxml.jackson.databind.node.ObjectNode
Return the Amazon States Language object for this state.Validate this state.protected void
whenBoundToGraph
(StateGraph graph) Called whenever this state is bound to a graph.Methods inherited from class software.amazon.awscdk.services.stepfunctions.MapBase
getEndStates, getItemSelector, getItemsPath, next
Methods inherited from class software.amazon.awscdk.services.stepfunctions.State
addBranch, addChoice, addChoice, addItemProcessor, addItemProcessor, addIterator, addPrefix, bindToGraph, filterNextables, findReachableEndStates, findReachableEndStates, findReachableStates, findReachableStates, getBranches, getComment, getDefaultChoice, getId, getInputPath, getIteration, getOutputPath, getParameters, getProcessor, getProcessorConfig, getProcessorMode, getResultPath, getResultSelector, getStartState, getStateId, getStateName, makeDefault, makeNext, prefixStates, renderBranches, renderChoices, renderInputOutput, renderItemProcessor, renderIterator, renderNextEnd, renderResultSelector, renderRetryCatch, setDefaultChoice, setIteration, setProcessor, setProcessorConfig, setProcessorMode
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
DistributedMap
protected DistributedMap(software.amazon.jsii.JsiiObjectRef objRef) -
DistributedMap
protected DistributedMap(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DistributedMap
@Stability(Stable) public DistributedMap(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable DistributedMapProps props) - Parameters:
scope
- This parameter is required.id
- Descriptive identifier for this chainable. This parameter is required.props
-
-
DistributedMap
@Stability(Stable) public DistributedMap(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- Descriptive identifier for this chainable. This parameter is required.
-
-
Method Details
-
isDistributedMap
Return whether the given object is a DistributedMap.- Parameters:
x
- This parameter is required.
-
addCatch
@Stability(Stable) @NotNull public DistributedMap addCatch(@NotNull IChainable handler, @Nullable CatchProps props) Add a recovery handler for this state.When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.
- Parameters:
handler
- This parameter is required.props
-
-
addCatch
Add a recovery handler for this state.When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.
- Parameters:
handler
- This parameter is required.
-
addRetry
Add retry configuration for this state.This controls if and how the execution will be retried if a particular error occurs.
- Parameters:
props
-
-
addRetry
Add retry configuration for this state.This controls if and how the execution will be retried if a particular error occurs.
-
itemProcessor
@Stability(Stable) @NotNull public DistributedMap itemProcessor(@NotNull IChainable processor, @Nullable ProcessorConfig config) Define item processor in a Distributed Map.A Distributed Map must have a non-empty item processor
- Parameters:
processor
- This parameter is required.config
-
-
itemProcessor
Define item processor in a Distributed Map.A Distributed Map must have a non-empty item processor
- Parameters:
processor
- This parameter is required.
-
toStateJson
@Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson()Return the Amazon States Language object for this state.- Overrides:
toStateJson
in classMapBase
-
validateState
Validate this state.- Overrides:
validateState
in classMapBase
-
whenBoundToGraph
Called whenever this state is bound to a graph.Can be overridden by subclasses.
- Overrides:
whenBoundToGraph
in classState
- Parameters:
graph
- This parameter is required.
-