Class DistributedMap

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IChainable, INextable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:17.534Z") @Stability(Stable) public class DistributedMap extends MapBase implements INextable
Define a Distributed Mode Map state in the state machine.

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:
  • 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

      @Stability(Stable) @NotNull public static Boolean isDistributedMap(@NotNull Object x)
      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

      @Stability(Stable) @NotNull public DistributedMap addCatch(@NotNull IChainable handler)
      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

      @Stability(Stable) @NotNull public DistributedMap addRetry(@Nullable RetryProps props)
      Add retry configuration for this state.

      This controls if and how the execution will be retried if a particular error occurs.

      Parameters:
      props -
    • addRetry

      @Stability(Stable) @NotNull public DistributedMap 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

      @Stability(Stable) @NotNull public DistributedMap itemProcessor(@NotNull IChainable processor)
      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 class MapBase
    • validateState

      @Stability(Stable) @NotNull protected List<String> validateState()
      Validate this state.
      Overrides:
      validateState in class MapBase
    • whenBoundToGraph

      @Stability(Stable) protected void whenBoundToGraph(@NotNull StateGraph graph)
      Called whenever this state is bound to a graph.

      Can be overridden by subclasses.

      Overrides:
      whenBoundToGraph in class State
      Parameters:
      graph - This parameter is required.