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:
/**
* JSON state input:
* {
* "bucketName": "my-bucket"
* }
*/
DistributedMap distributedMap = DistributedMap.Builder.create(this, "DistributedMap")
.resultWriterV2(ResultWriterV2.Builder.create()
.bucketNamePath(JsonPath.stringAt("$.bucketName"))
.build())
.build();
distributedMap.itemProcessor(new Pass(this, "Pass"));
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.IChainable
IChainable.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.INextable
INextable.Jsii$Default, INextable.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDistributedMap(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedDistributedMap(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 BooleanReturn 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.static DistributedMapDefine a Distributed Mode Map state using JSONata in the state machine.static DistributedMapjsonata(software.constructs.Construct scope, String id, DistributedMapJsonataProps props) Define a Distributed Mode Map state using JSONata in the state machine.static DistributedMapDefine a Distributed Mode Map state using JSONPath in the state machine.static DistributedMapjsonPath(software.constructs.Construct scope, String id, DistributedMapJsonPathProps props) Define a Distributed Mode Map state using JSONPath in the state machine.com.fasterxml.jackson.databind.node.ObjectNodeReturn the Amazon States Language object for this state.com.fasterxml.jackson.databind.node.ObjectNodetoStateJson(QueryLanguage stateMachineQueryLanguage) Return the Amazon States Language object for this state.Validate this state.protected voidwhenBoundToGraph(StateGraph graph) Called whenever this state is bound to a graph.Methods inherited from class software.amazon.awscdk.services.stepfunctions.MapBase
getEndStates, getItems, getItemSelector, getItemsPath, getJsonataItemSelector, nextMethods inherited from class software.amazon.awscdk.services.stepfunctions.State
addBranch, addChoice, addChoice, addItemProcessor, addItemProcessor, addIterator, addPrefix, bindToGraph, filterNextables, findReachableEndStates, findReachableEndStates, findReachableStates, findReachableStates, getArguments, getAssign, getBranches, getComment, getDefaultChoice, getId, getInputPath, getIteration, getOutputPath, getOutputs, getParameters, getProcessor, getProcessorConfig, getProcessorMode, getQueryLanguage, getResultPath, getResultSelector, getStartState, getStateId, getStateName, makeDefault, makeNext, prefixStates, renderAssign, renderAssign, renderBranches, renderChoices, renderChoices, renderInputOutput, renderItemProcessor, renderIterator, renderNextEnd, renderQueryLanguage, renderQueryLanguage, renderResultSelector, renderRetryCatch, renderRetryCatch, setDefaultChoice, setIteration, setProcessor, setProcessorConfig, setProcessorModeMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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.
-
jsonata
@Stability(Stable) @NotNull public static DistributedMap jsonata(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable DistributedMapJsonataProps props) Define a Distributed Mode Map state using JSONata in the state machine.A
Mapstate 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
Mapstate inDistributedmode 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.- Parameters:
scope- This parameter is required.id- This parameter is required.props-- See Also:
-
jsonata
@Stability(Stable) @NotNull public static DistributedMap jsonata(@NotNull software.constructs.Construct scope, @NotNull String id) Define a Distributed Mode Map state using JSONata in the state machine.A
Mapstate 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
Mapstate inDistributedmode 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.- Parameters:
scope- This parameter is required.id- This parameter is required.- See Also:
-
jsonPath
@Stability(Stable) @NotNull public static DistributedMap jsonPath(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable DistributedMapJsonPathProps props) Define a Distributed Mode Map state using JSONPath in the state machine.A
Mapstate 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
Mapstate inDistributedmode 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.- Parameters:
scope- This parameter is required.id- This parameter is required.props-- See Also:
-
jsonPath
@Stability(Stable) @NotNull public static DistributedMap jsonPath(@NotNull software.constructs.Construct scope, @NotNull String id) Define a Distributed Mode Map state using JSONPath in the state machine.A
Mapstate 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
Mapstate inDistributedmode 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.- Parameters:
scope- This parameter is required.id- This parameter is required.- See Also:
-
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(@Nullable QueryLanguage stateMachineQueryLanguage) Return the Amazon States Language object for this state.- Overrides:
toStateJsonin classMapBase- Parameters:
stateMachineQueryLanguage-
-
toStateJson
@Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson()Return the Amazon States Language object for this state.- Overrides:
toStateJsonin classMapBase
-
validateState
Validate this state.- Overrides:
validateStatein classMapBase
-
whenBoundToGraph
Called whenever this state is bound to a graph.Can be overridden by subclasses.
- Overrides:
whenBoundToGraphin classState- Parameters:
graph- This parameter is required.
-