Class ModelCommitConflicts
java.lang.Object
io.fluxzero.common.modeling.ModelCommitConflicts
Owns generic model-commit conflict detection and conflict-policy outcomes. Stores supply their current heads,
optional relationship positions and the identities whose operation depends on a current relationship closure;
storage-specific loading remains the store's responsibility.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <H> List<ModelCommitConflict> detect(CommitModels commit, Map<String, ? extends H> heads, ToLongFunction<? super H> sequenceNumber, ToLongFunction<? super H> stateIndex, Map<String, Long> relationStateIndices) Detects stale read-state and expected-sequence conflicts in stable request order.static <H> List<ModelCommitConflict> detect(CommitModels commit, Map<String, ? extends H> heads, ToLongFunction<? super H> sequenceNumber, ToLongFunction<? super H> stateIndex, Map<String, Long> relationStateIndices, Iterable<String> relationshipSensitiveModelIds) Detects ordinary model conflicts plus relationship-only changes for identities whose evaluated operation depended on their relationship closure, such as cascade-deletion roots.static List<ModelCommitConflict> detectErasedReads(CommitModels commit, List<ModelCommitConflict> existing, ToLongFunction<String> erasedPositions) Adds conflicts for physically erased read identities without rejecting fresh reads of their absence.static List<ModelCommitConflict> detectRelationships(CommitModels commit, List<ModelCommitConflict> existing, ToLongFunction<ModelRelationshipRead> positions) Adds membership conflicts using relationship positions read under the same atomic boundary as the write.static CommitModelsResultresult(CommitModels commit, List<ModelCommitConflict> conflicts, long rebaseBoundary) Maps detected conflicts to the outcome required by the commit's resolved conflict policy.
-
Method Details
-
detect
public static <H> List<ModelCommitConflict> detect(CommitModels commit, Map<String, ? extends H> heads, ToLongFunction<? super H> sequenceNumber, ToLongFunction<? super H> stateIndex, Map<String, Long> relationStateIndices) Detects stale read-state and expected-sequence conflicts in stable request order.No collection is allocated when the commit has no conflicts, and each model occurs at most once.
-
detect
public static <H> List<ModelCommitConflict> detect(CommitModels commit, Map<String, ? extends H> heads, ToLongFunction<? super H> sequenceNumber, ToLongFunction<? super H> stateIndex, Map<String, Long> relationStateIndices, Iterable<String> relationshipSensitiveModelIds) Detects ordinary model conflicts plus relationship-only changes for identities whose evaluated operation depended on their relationship closure, such as cascade-deletion roots. -
result
public static CommitModelsResult result(CommitModels commit, List<ModelCommitConflict> conflicts, long rebaseBoundary) Maps detected conflicts to the outcome required by the commit's resolved conflict policy.- Returns:
nullwhen there are no conflicts
-
detectErasedReads
public static List<ModelCommitConflict> detectErasedReads(CommitModels commit, List<ModelCommitConflict> existing, ToLongFunction<String> erasedPositions) Adds conflicts for physically erased read identities without rejecting fresh reads of their absence. -
detectRelationships
public static List<ModelCommitConflict> detectRelationships(CommitModels commit, List<ModelCommitConflict> existing, ToLongFunction<ModelRelationshipRead> positions) Adds membership conflicts using relationship positions read under the same atomic boundary as the write.
-