Class FileSystemSerDes
- All Implemented Interfaces:
SerDes
Configure this serializer on individual operations (for example, StepConfig.builder().serDes(...)). The
global serializer also handles ordinary Lambda input/output without operation identity and is not supported. Existing
serializers can be composed using FileSystemSerDes.Builder.delegate(SerDes).
Use a durable shared mount such as EFS. Lambda's ephemeral /tmp cannot survive replay in a different
environment. A mount with delayed remote synchronization can lose payloads even after a successful local write. The
mount and base directory must be controlled by the application, not writable by untrusted processes.
Each write creates an immutable file so retrying or polling never changes an earlier checkpoint's value. Files are not automatically deleted: retain them for the execution's full replay lifetime, then apply external cleanup. Configuration is immutable; custom delegates and preview generators must support concurrent calls.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for filesystem storage and delegate serialization. -
Method Summary
Modifier and TypeMethodDescriptionstatic FileSystemSerDes.BuilderCreates a builder; defaults to ALWAYS, URI, and JacksonSerDes.<T> Tdeserialize(String data, TypeToken<T> typeToken) Deserializes a JSON string to an object of the specified generic type.<T> Tdeserialize(String data, TypeToken<T> typeToken, SerDesContext context) Deserializes an operation payload with its stable execution and entity identity.Serializes an object to a JSON string.serialize(Object value, SerDesContext context) Serializes an operation payload with its stable execution and entity identity.
-
Method Details
-
builder
Creates a builder; defaults to ALWAYS, URI, and JacksonSerDes. No files are created until serialization. -
serialize
Description copied from interface:SerDesSerializes an object to a JSON string. -
deserialize
Description copied from interface:SerDesDeserializes a JSON string to an object of the specified generic type.This method supports complex generic types like
List<MyObject>orMap<String, MyObject>that cannot be represented by a simpleClassobject.Usage example:
List<String> items = serDes.deserialize(json, new TypeToken<List<String>>() {});- Specified by:
deserializein interfaceSerDes- Type Parameters:
T- the target type- Parameters:
data- the JSON string to deserializetypeToken- the type token capturing the generic type information- Returns:
- the deserialized object, or null if data is null
-
serialize
Description copied from interface:SerDesSerializes an operation payload with its stable execution and entity identity.The default preserves existing implementations. Override this method when serialization needs external storage. References returned by such implementations must remain readable after later writes for the same entity.
-
deserialize
Description copied from interface:SerDesDeserializes an operation payload with its stable execution and entity identity.The default preserves existing implementations. The context identifies the consuming operation; externally produced callback and invoke results may have been serialized with a different context.
- Specified by:
deserializein interfaceSerDes
-