Class OperationIdGenerator
java.lang.Object
software.amazon.lambda.durable.execution.OperationIdGenerator
Generates operation IDs for the durable operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringhashOperationId(String rawId) Hashes the given string using SHA-256Returns the next globally unique operation ID.
-
Constructor Details
-
OperationIdGenerator
-
-
Method Details
-
hashOperationId
Hashes the given string using SHA-256- Parameters:
rawId- the string to hash- Returns:
- the hashed string
-
nextOperationId
Returns the next globally unique operation ID. Increments an internal counter, concatenates it with the context ID prefix (contextId + "-" + counter), and SHA-256 hashes the result. For root contexts the prefix is the EXECUTION operation ID; for child contexts it is the parent's hashed context ID. This produces IDs likehash("execId-1"),hash("execId-2")at the root level, andhash("<parentHash>-1"),hash("<parentHash>-2")inside a child context.
-