public class Commit
extends java.lang.Object
Commit
instance represents a set of related changes, which when
applied to a base node state result in a new node state.Constructor and Description |
---|
Commit(@NotNull NodeBuilder changes,
@NotNull CommitHook hook,
@NotNull CommitInfo info) |
Modifier and Type | Method and Description |
---|---|
void |
applied(SegmentNodeState merged)
Does housekeeping work needed after applying the commit.
|
SegmentNodeState |
apply(SegmentNodeState base)
Apply the changes represented by this commit to the passed
base
node state. |
@Nullable GCGeneration |
getGCGeneration()
This method makes a best effort on getting the gc generation of the current commit.
|
boolean |
hasChanges()
Checks if the commit contains any changes.
|
CommitInfo |
info() |
public Commit(@NotNull @NotNull NodeBuilder changes, @NotNull @NotNull CommitHook hook, @NotNull @NotNull CommitInfo info)
@Nullable public @Nullable GCGeneration getGCGeneration()
NodeBuilder.getName(String)
on the changes in this commit.null
if not yet available.public SegmentNodeState apply(SegmentNodeState base) throws CommitFailedException
base
node state.base
- the base node state to apply this commit tobase
.CommitFailedException
- if the commit cannot be applied to base
. (e.g.
because of a conflict.)public void applied(SegmentNodeState merged)
merged
- the current head node state, after applying the changes in the commit.public boolean hasChanges()
SegmentNodeState.fastEquals(NodeState, NodeState)
, which cannot
guarantee against false negatives.true
, if the commit has changes.public CommitInfo info()
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.