Class CheckpointingFileDataSupplier
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
,net.devslash.AfterHook
,net.devslash.FullDataAfterHook
,net.devslash.OnError
,net.devslash.OnErrorWithState
,net.devslash.RequestDataSupplier
public final class CheckpointingFileDataSupplier implements RequestDataSupplier<List<String>>, FullDataAfterHook, AutoCloseable, OnErrorWithState
A checkpointing file data supplier works similarly to the FileDataSupplier in use under good conditions. When failing through, the checkpointing supplier will be able to capture those requests that did or didn't pass a predicate, and subsequently restart from a known state.
A caveat to this, is that depending on the side-effects of the server being called. It is possible that the request (or at least the data mutation effects) have completed from the server.
This means, that this should only be used in the event that the server requests are idempotent. Or retry is safe.
There is a startup cost to using this data supplier as well, as it has to take an exclusive copy of the request data.
Checkpoint data suppliers only create List<String> request data. This ensures serialization isn't something we have to worry about.. Maybe another day.
A checkpointing supplier is also not expected to work
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
CheckpointingFileDataSupplier.CheckpointException
-
Constructor Summary
Constructors Constructor Description CheckpointingFileDataSupplier(String fileName, String checkpointName, String split, Function1<AfterCtx<?>, Boolean> checkpointPredicate)
-
Method Summary
Modifier and Type Method Description final Unit
inject(CallBuilder<List<String>> callBuilder)
RequestData<List<String>>
getDataForRequest()
Unit
accept(HttpRequest req, HttpResponse resp, RequestData<?> data)
<T extends Any> Unit
accept(Channel<Envelope<Pair<HttpRequest, RequestData<T>>>> channel, Envelope<Pair<HttpRequest, RequestData<T>>> envelope, Exception e)
Unit
close()
-