@Beta
public interface DataTreeCommitCohort<T extends TreeNode>
DataTreeCommitCohort
s are hooked up into commit of data tree changes and MAY
negatively affect performance of data broker / store.
Implementations of this interface are discouraged, unless you really need ability to veto data tree changes, or to provide external state change in sync with visibility of commited data.
DataTreeModification
for validation purposes.
Use of any other external mutable state is discouraged, implementation MUST NOT use any
transaction related APIs on same data broker / data store instance during invocation of
callbacks, except ones provided as argument. Note that this MAY BE enforced by some
implementations of DataBroker
or Commit coordinator
Note that this may be enforced by some implementations of DataTreeCommitCohortRegistry
and such calls may fail.
DataTreeModification
being successfully committed until associated
PostCanCommitStep.preCommit()
and
PostPreCommitStep.commit()
callback was invoked.
Validator is implementation, which only validates DataTreeModification
and does not
retain any state derived from edited data - does not care if DataTreeModification
was
rejected afterwards or transaction was cancelled.
Implementation may opt-out from receiving preCommit()
, commit()
, abort()
callbacks by returning PostCanCommitStep.NOOP
.
Modifier and Type | Method and Description |
---|---|
void |
canCommit(Object txId,
Collection<DataTreeModification<T>> modifications,
BiConsumer<DataValidationFailedException,PostCanCommitStep> callback)
Performs canCommit? message in three-phase commit algorithm.
|
void canCommit(Object txId, Collection<DataTreeModification<T>> modifications, BiConsumer<DataValidationFailedException,PostCanCommitStep> callback)
txId
- Transaction identifiermodifications
- the DataTreeModification
to validatecallback
- result callbackCopyright © 2019 OpenDaylight. All rights reserved.