Class DefaultModelRepository.Commit
java.lang.Object
io.fluxzero.sdk.persisting.repository.DefaultModelRepository.Commit
- Enclosing class:
DefaultModelRepository
Converts a side-effect-free
CommitAttempt evaluation into one authoritative runtime commit package.
The original event payload is serialized once per substep. Per-target stream membership remains separate, while global publication is the union of all targeted model publication policies. Optional direct documents and snapshots travel with the same package. The runtime durably retains incomplete materialization work and reports completion before a successful model commit returns, preserving immediate direct-search visibility across retries and restarts.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe one repository-owned carrier from prepared request through authoritative accepted result. -
Constructor Summary
ConstructorsConstructorDescriptionCommit(EventStoreClient eventStoreClient, Serializer serializer, DocumentSerializer documentSerializer, DispatchInterceptor dispatchInterceptor, String source, Serializer snapshotSerializer, GraphProjectionCompletion graphProjectionCompletion) -
Method Summary
Modifier and TypeMethodDescriptionbeginBatch(int producers) Begins a batch for the supplied number of producers, or returns null if the event-store client does not support batching.Begins a batch for independently ready commits, or returns null when that batching mode is unsupported.commit(String commitId, CommitAttempt evaluation) Prepares and commits an attempt withModelConflictPolicy.ACCEPT; returns an empty result when there is no commit to send.commit(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy) Prepares and commits an attempt with the supplied conflict policy.commitPrepared(DefaultModelRepository.Commit.Outcome prepared, ModelCommitBatchingClient.ModelCommitBatch batch, int batchSlot) Submits a prepared commit directly or through a reserved batch slot and completes required result processing.prepare(String commitId, CommitAttempt evaluation) Prepares the wire commit and change correlation for an attempt usingModelConflictPolicy.ACCEPT, without submitting it.prepare(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy) Prepares an ordinary, non-migration commit with the supplied conflict policy, without submitting it.prepare(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy, boolean migration) Prepares a commit with the supplied conflict and migration policies, without treating its input as an already stored event or submitting it.prepare(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy, boolean migration, boolean existingEvent) Prepares the wire commit and change correlation using the supplied conflict, migration, and existing-event policies, without submitting the commit.prepareDeadlineReevaluation(String commitId, DefaultModelRepository.Commit.Outcome original, CommitAttempt evaluation) Rebuilds all deadline metadata and effects without changing the original conflict or event policy.prepareRebased(String commitId, DefaultModelRepository.Commit.Outcome original, CommitAttempt evaluation) Prepares an ACCEPT rebase with the original commit shape, delivery guarantee, duplicate flag, and migration policy.trackLocalCommit(CommitAttempt attempt, DeserializingMessage message, boolean migration, Supplier<CompletableFuture<Optional<CommitModelsResult>>> operation) Keeps tracker fencing around the complete commit and retry lifecycle.trackLocalCommit(CommitAttempt attempt, DeserializingMessage message, boolean migration, Supplier<CompletableFuture<Optional<CommitModelsResult>>> operation, Runnable afterCommit) Releases process-local commit ordering after cache/tracker publication and before optional Graph waiting.
-
Constructor Details
-
Commit
public Commit(EventStoreClient eventStoreClient, Serializer serializer, DocumentSerializer documentSerializer, DispatchInterceptor dispatchInterceptor, String source, Serializer snapshotSerializer, GraphProjectionCompletion graphProjectionCompletion)
-
-
Method Details
-
commit
public CompletableFuture<Optional<CommitModelsResult>> commit(String commitId, CommitAttempt evaluation) Prepares and commits an attempt withModelConflictPolicy.ACCEPT; returns an empty result when there is no commit to send. -
commit
public CompletableFuture<Optional<CommitModelsResult>> commit(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy) Prepares and commits an attempt with the supplied conflict policy. The future contains the authoritative result, or an empty optional when no commit is required. -
commitPrepared
public CompletableFuture<Optional<CommitModelsResult>> commitPrepared(DefaultModelRepository.Commit.Outcome prepared, ModelCommitBatchingClient.ModelCommitBatch batch, int batchSlot) Submits a prepared commit directly or through a reserved batch slot and completes required result processing. A preparation without a commit returns an already-completed empty optional. -
beginBatch
Begins a batch for the supplied number of producers, or returns null if the event-store client does not support batching. -
beginReadyBatch
Begins a batch for independently ready commits, or returns null when that batching mode is unsupported. -
trackLocalCommit
public CompletableFuture<Optional<CommitModelsResult>> trackLocalCommit(CommitAttempt attempt, DeserializingMessage message, boolean migration, Supplier<CompletableFuture<Optional<CommitModelsResult>>> operation) Keeps tracker fencing around the complete commit and retry lifecycle. -
trackLocalCommit
public CompletableFuture<Optional<CommitModelsResult>> trackLocalCommit(CommitAttempt attempt, DeserializingMessage message, boolean migration, Supplier<CompletableFuture<Optional<CommitModelsResult>>> operation, Runnable afterCommit) Releases process-local commit ordering after cache/tracker publication and before optional Graph waiting. -
prepare
Prepares the wire commit and change correlation for an attempt usingModelConflictPolicy.ACCEPT, without submitting it. -
prepare
public DefaultModelRepository.Commit.Outcome prepare(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy) Prepares an ordinary, non-migration commit with the supplied conflict policy, without submitting it. -
prepare
public DefaultModelRepository.Commit.Outcome prepare(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy, boolean migration) Prepares a commit with the supplied conflict and migration policies, without treating its input as an already stored event or submitting it. -
prepare
public DefaultModelRepository.Commit.Outcome prepare(String commitId, CommitAttempt evaluation, ModelConflictPolicy conflictPolicy, boolean migration, boolean existingEvent) Prepares the wire commit and change correlation using the supplied conflict, migration, and existing-event policies, without submitting the commit. -
prepareRebased
public DefaultModelRepository.Commit.Outcome prepareRebased(String commitId, DefaultModelRepository.Commit.Outcome original, CommitAttempt evaluation) Prepares an ACCEPT rebase with the original commit shape, delivery guarantee, duplicate flag, and migration policy. Empty originals and incompatible shapes are rejected. -
prepareDeadlineReevaluation
public DefaultModelRepository.Commit.Outcome prepareDeadlineReevaluation(String commitId, DefaultModelRepository.Commit.Outcome original, CommitAttempt evaluation) Rebuilds all deadline metadata and effects without changing the original conflict or event policy.
-