You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by mr...@apache.org on 2014/09/23 17:00:22 UTC
svn commit: r1627047 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java
Author: mreutegg
Date: Tue Sep 23 15:00:22 2014
New Revision: 1627047
URL: http://svn.apache.org/r1627047
Log:
OAK-2120: Simplify BranchStates
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java?rev=1627047&r1=1627046&r2=1627047&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java Tue Sep 23 15:00:22 2014
@@ -522,13 +522,11 @@ public abstract class AbstractNodeStoreB
}
/**
- * Instances of this class represent a branch whose base and head differ.
- * All changes are persisted to an underlying branch in the {@code MicroKernel}.
+ * Instances of this class represent a branch whose head is persisted to an
+ * underlying branch in the {@code MicroKernel}.
* <p>
* Transitions to:
* <ul>
- * <li>{@link Unmodified} on {@link #setRoot(NodeState)} if the new root is the same
- * as the base of this branch.
* <li>{@link ResetFailed} on failed reset in {@link #merge(CommitHook, CommitInfo)}</li>
* <li>{@link Merged} on successful {@link #merge(CommitHook, CommitInfo)}</li>
* </ul>
@@ -569,9 +567,7 @@ public abstract class AbstractNodeStoreB
@Override
void setRoot(NodeState root) {
- if (base.equals(root)) {
- branchState = new Unmodified(base);
- } else if (!head.equals(root)) {
+ if (!head.equals(root)) {
persistTransientHead(root);
}
}
@@ -579,15 +575,9 @@ public abstract class AbstractNodeStoreB
@Override
void rebase() {
N root = getRoot();
- if (head.equals(root)) {
- // Nothing was written to this branch: set new base revision
- head = root;
- base = root;
- } else {
- // perform rebase in store
- head = AbstractNodeStoreBranch.this.rebase(head, root);
- base = root;
- }
+ // perform rebase in store
+ head = AbstractNodeStoreBranch.this.rebase(head, root);
+ base = root;
}
@Override