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 2016/07/25 08:19:15 UTC
svn commit: r1753961 - in /jackrabbit/oak/trunk/oak-core/src:
main/java/org/apache/jackrabbit/oak/plugins/document/
main/java/org/apache/jackrabbit/oak/plugins/document/secondary/
test/java/org/apache/jackrabbit/oak/plugins/document/ test/java/org/apac...
Author: mreutegg
Date: Mon Jul 25 08:19:15 2016
New Revision: 1753961
URL: http://svn.apache.org/viewvc?rev=1753961&view=rev
Log:
OAK-4470: Remove read revision method from DocumentNodeState
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/AbstractDocumentNodeState.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeState.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/PathFilteringDiff.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterRevisionComparisonTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CommitQueueTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStateTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeStoreDiffTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeStateTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/SecondaryStoreObserverTest.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/AbstractDocumentNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/AbstractDocumentNodeState.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/AbstractDocumentNodeState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/AbstractDocumentNodeState.java Mon Jul 25 08:19:15 2016
@@ -39,8 +39,6 @@ public abstract class AbstractDocumentNo
public abstract String getPath();
- public abstract RevisionVector getRevision();
-
public abstract RevisionVector getLastRevision();
public abstract RevisionVector getRootRevision();
@@ -119,10 +117,9 @@ public abstract class AbstractDocumentNo
perfLogger
.end(start,
1,
- "compareAgainstBaseState, path={}, readRevision={}, lastRevision={}, base.path={}, base.readRevision={}, base.lastRevision={}",
- getPath(), getRevision(), getLastRevision(),
- mBase.getPath(), mBase.getRevision(),
- mBase.getLastRevision());
+ "compareAgainstBaseState, path={}, lastRevision={}, base.path={}, base.lastRevision={}",
+ getPath(), getLastRevision(),
+ mBase.getPath(), mBase.getLastRevision());
}
}
}
@@ -135,15 +132,14 @@ public abstract class AbstractDocumentNo
//------------------------------< internal >--------------------------------
/**
- * Returns {@code true} if this state has the same revision as the
- * {@code other} state. This method first compares the {@link #readRevision}
- * and then the {@link #lastRevision}.
+ * Returns {@code true} if this state has the same last revision as the
+ * {@code other} state.
*
* @param other the other state to compare with.
- * @return {@code true} if the revisions are equal, {@code false} otherwise.
+ * @return {@code true} if the last revisions are equal, {@code false} otherwise.
*/
private boolean revisionEquals(AbstractDocumentNodeState other) {
- return this.getRevision().equals(other.getRevision())
- || this.getLastRevision().equals(other.getLastRevision());
+ return this.getLastRevision() != null
+ && this.getLastRevision().equals(other.getLastRevision());
}
}
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java Mon Jul 25 08:19:15 2016
@@ -71,7 +71,6 @@ public class DocumentNodeState extends A
static final int MAX_FETCH_SIZE = INITIAL_FETCH_SIZE << 4;
final String path;
- final RevisionVector readRevision;
RevisionVector lastRevision;
final RevisionVector rootRevision;
final boolean fromExternalChange;
@@ -84,29 +83,27 @@ public class DocumentNodeState extends A
DocumentNodeState(@Nonnull DocumentNodeStore store,
@Nonnull String path,
- @Nonnull RevisionVector readRevision) {
- this(store, path, readRevision, false);
+ @Nonnull RevisionVector rootRevision) {
+ this(store, path, rootRevision, false);
}
DocumentNodeState(@Nonnull DocumentNodeStore store, @Nonnull String path,
- @Nonnull RevisionVector readRevision, boolean hasChildren) {
- this(store, path, readRevision, new HashMap<String, PropertyState>(),
- hasChildren, null, null, false);
+ @Nonnull RevisionVector rootRevision, boolean hasChildren) {
+ this(store, path, rootRevision, new HashMap<String, PropertyState>(),
+ hasChildren, null, false);
}
private DocumentNodeState(@Nonnull DocumentNodeStore store,
@Nonnull String path,
- @Nonnull RevisionVector readRevision,
+ @Nonnull RevisionVector rootRevision,
@Nonnull Map<String, PropertyState> properties,
boolean hasChildren,
@Nullable RevisionVector lastRevision,
- @Nullable RevisionVector rootRevision,
boolean fromExternalChange) {
this.store = checkNotNull(store);
this.path = checkNotNull(path);
- this.readRevision = checkNotNull(readRevision);
+ this.rootRevision = checkNotNull(rootRevision);
this.lastRevision = lastRevision;
- this.rootRevision = rootRevision != null ? rootRevision : readRevision;
this.fromExternalChange = fromExternalChange;
this.hasChildren = hasChildren;
this.properties = checkNotNull(properties);
@@ -131,8 +128,8 @@ public class DocumentNodeState extends A
if (rootRevision.equals(root) && fromExternalChange == externalChange) {
return this;
} else {
- return new DocumentNodeState(store, path, readRevision, properties,
- hasChildren, lastRevision, root, externalChange);
+ return new DocumentNodeState(store, path, root, properties,
+ hasChildren, lastRevision, externalChange);
}
}
@@ -142,8 +139,8 @@ public class DocumentNodeState extends A
*/
@Nonnull
DocumentNodeState fromExternalChange() {
- return new DocumentNodeState(store, path, readRevision, properties, hasChildren,
- lastRevision, rootRevision, true);
+ return new DocumentNodeState(store, path, rootRevision, properties, hasChildren,
+ lastRevision, true);
}
/**
@@ -157,22 +154,13 @@ public class DocumentNodeState extends A
//--------------------------< AbstractDocumentNodeState >-----------------------------------
- @Override
- @Nonnull
- public RevisionVector getRevision() {
- return readRevision;
- }
-
/**
- * Returns the root revision for this node state. This is the read revision
+ * Returns the root revision for this node state. This is the root revision
* passed from the parent node state. This revision therefore reflects the
* revision of the root node state where the traversal down the tree
- * started. The returned revision is only maintained on a best effort basis
- * and may be the same as {@link #getRevision()} if this node state is
- * retrieved directly from the {@code DocumentNodeStore}.
+ * started.
*
- * @return the revision of the root node state is available, otherwise the
- * same value as returned by {@link #getRevision()}.
+ * @return the revision of the root node state.
*/
@Nonnull
public RevisionVector getRootRevision() {
@@ -285,9 +273,9 @@ public class DocumentNodeState extends A
@Override
public NodeBuilder builder() {
if ("/".equals(getPath())) {
- if (readRevision.isBranch()) {
+ if (getRootRevision().isBranch()) {
// check if this node state is head of a branch
- Branch b = store.getBranches().getBranch(readRevision);
+ Branch b = store.getBranches().getBranch(getRootRevision());
if (b == null) {
if (store.isDisableBranches()) {
if (DocumentNodeStoreBranch.getCurrentBranch() != null) {
@@ -296,10 +284,10 @@ public class DocumentNodeState extends A
return new MemoryNodeBuilder(this);
}
} else {
- throw new IllegalStateException("No branch for revision: " + readRevision);
+ throw new IllegalStateException("No branch for revision: " + getRootRevision());
}
}
- if (b.isHead(readRevision.getBranchRevision())
+ if (b.isHead(getRootRevision().getBranchRevision())
&& DocumentNodeStoreBranch.getCurrentBranch() != null) {
return new DocumentRootBuilder(this, store);
} else {
@@ -356,7 +344,8 @@ public class DocumentNodeState extends A
public String toString() {
StringBuilder buff = new StringBuilder();
buff.append("{ path: '").append(path).append("', ");
- buff.append("readRevision: '").append(readRevision).append("', ");
+ buff.append("rootRevision: '").append(rootRevision).append("', ");
+ buff.append("lastRevision: '").append(lastRevision).append("', ");
buff.append("properties: '").append(properties.values()).append("' }");
return buff.toString();
}
@@ -393,7 +382,6 @@ public class DocumentNodeState extends A
@Override
public int getMemory() {
int size = 40 // shallow
- + readRevision.getMemory()
+ (lastRevision != null ? lastRevision.getMemory() : 0)
+ rootRevision.getMemory()
+ estimateMemoryUsage(path);
@@ -486,7 +474,7 @@ public class DocumentNodeState extends A
public String asString() {
JsopWriter json = new JsopBuilder();
json.key("path").value(path);
- json.key("rev").value(readRevision.toString());
+ json.key("rev").value(rootRevision.toString());
if (lastRevision != null) {
json.key("lastRev").value(lastRevision.toString());
}
@@ -506,10 +494,10 @@ public class DocumentNodeState extends A
public static DocumentNodeState fromString(DocumentNodeStore store, String s) {
JsopTokenizer json = new JsopTokenizer(s);
String path = null;
- RevisionVector rev = null;
+ RevisionVector rootRev = null;
RevisionVector lastRev = null;
boolean hasChildren = false;
- DocumentNodeState state = null;
+ DocumentNodeState state;
HashMap<String, String> map = new HashMap<String, String>();
while (true) {
String k = json.readString();
@@ -517,7 +505,7 @@ public class DocumentNodeState extends A
if ("path".equals(k)) {
path = json.readString();
} else if ("rev".equals(k)) {
- rev = RevisionVector.fromString(json.readString());
+ rootRev = RevisionVector.fromString(json.readString());
} else if ("lastRev".equals(k)) {
lastRev = RevisionVector.fromString(json.readString());
} else if ("hasChildren".equals(k)) {
@@ -540,7 +528,7 @@ public class DocumentNodeState extends A
}
json.read(',');
}
- state = new DocumentNodeState(store, path, rev, hasChildren);
+ state = new DocumentNodeState(store, path, rootRev, hasChildren);
state.setLastRevision(lastRev);
for (Entry<String, String> e : map.entrySet()) {
state.setProperty(e.getKey(), e.getValue());
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java Mon Jul 25 08:19:15 2016
@@ -511,7 +511,7 @@ public final class DocumentNodeStore
initializeRootState(rootDoc);
// check if _lastRev for our clusterId exists
if (!rootDoc.getLastRev().containsKey(clusterId)) {
- unsavedLastRevisions.put("/", getRoot().getRevision().getRevision(clusterId));
+ unsavedLastRevisions.put("/", getRoot().getRootRevision().getRevision(clusterId));
if (!readOnlyMode) {
backgroundWrite();
}
@@ -1653,7 +1653,7 @@ public final class DocumentNodeStore
@Nonnull
public RevisionVector getHeadRevision() {
- return root.getRevision();
+ return root.getRootRevision();
}
@Nonnull
@@ -2425,7 +2425,7 @@ public final class DocumentNodeStore
@Override
public String getHead(){
- return getRoot().getRevision().toString();
+ return getRoot().getRootRevision().toString();
}
@Override
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java Mon Jul 25 08:19:15 2016
@@ -286,7 +286,7 @@ class DocumentNodeStoreBranch implements
DocumentNodeState base,
CommitInfo info) {
boolean success = false;
- Commit c = store.newCommit(base.getRevision(), this);
+ Commit c = store.newCommit(base.getRootRevision(), this);
RevisionVector rev;
try {
op.with(c);
@@ -296,7 +296,7 @@ class DocumentNodeStoreBranch implements
return base;
}
c.apply();
- rev = store.done(c, base.getRevision().isBranch(), info);
+ rev = store.done(c, base.getRootRevision().isBranch(), info);
success = true;
} finally {
if (!success) {
@@ -561,7 +561,7 @@ class DocumentNodeStoreBranch implements
* @return the branch state.
*/
final DocumentNodeState createBranch(DocumentNodeState state) {
- return store.getRoot(state.getRevision().asBranchRevision(store.getClusterId()));
+ return store.getRoot(state.getRootRevision().asBranchRevision(store.getClusterId()));
}
@Override
@@ -581,7 +581,7 @@ class DocumentNodeStoreBranch implements
void rebase() {
DocumentNodeState root = store.getRoot();
// perform rebase in store
- head = store.getRoot(store.rebase(head.getRevision(), root.getRevision()));
+ head = store.getRoot(store.rebase(head.getRootRevision(), root.getRootRevision()));
base = root;
}
@@ -603,7 +603,7 @@ class DocumentNodeStoreBranch implements
checkForConflicts();
NodeState toCommit = checkNotNull(hook).processCommit(base, head, info);
head = DocumentNodeStoreBranch.this.persist(toCommit, head, info);
- return store.getRoot(store.merge(head.getRevision(), info));
+ return store.getRoot(store.merge(head.getRootRevision(), info));
}
});
branchState = new Merged(base);
@@ -633,8 +633,8 @@ class DocumentNodeStoreBranch implements
private void resetBranch(DocumentNodeState branchHead, DocumentNodeState ancestor) {
try {
head = store.getRoot(
- store.reset(branchHead.getRevision(),
- ancestor.getRevision()));
+ store.reset(branchHead.getRootRevision(),
+ ancestor.getRootRevision()));
} catch (Exception e) {
CommitFailedException ex = new CommitFailedException(
OAK, 100, "Branch reset failed", e);
@@ -650,7 +650,7 @@ class DocumentNodeStoreBranch implements
* of the commits on this branch.
*/
private void checkForConflicts() throws CommitFailedException {
- Branch b = store.getBranches().getBranch(head.getRevision());
+ Branch b = store.getBranches().getBranch(head.getRootRevision());
if (b == null) {
return;
}
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeState.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeState.java Mon Jul 25 08:19:15 2016
@@ -63,7 +63,6 @@ class DelegatingDocumentNodeState extend
private final RevisionVector rootRevision;
private final boolean fromExternalChange;
private RevisionVector lastRevision;
- private RevisionVector readRevision;
private String path;
/**
@@ -105,7 +104,6 @@ class DelegatingDocumentNodeState extend
this.rootRevision = rootRevision;
this.fromExternalChange = fromExternalChange;
this.path = original.path;
- this.readRevision = original.readRevision;
this.lastRevision = original.lastRevision;
}
@@ -120,14 +118,6 @@ class DelegatingDocumentNodeState extend
}
@Override
- public RevisionVector getRevision() {
- if (readRevision == null){
- this.readRevision = RevisionVector.fromString(getRequiredProp(PROP_REVISION));
- }
- return readRevision;
- }
-
- @Override
public RevisionVector getLastRevision() {
if (lastRevision == null){
this.lastRevision = RevisionVector.fromString(getRequiredProp(PROP_LAST_REV));
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/PathFilteringDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/PathFilteringDiff.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/PathFilteringDiff.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/PathFilteringDiff.java Mon Jul 25 08:19:15 2016
@@ -101,7 +101,7 @@ class PathFilteringDiff extends ApplyDif
}
static void copyMetaProperties(AbstractDocumentNodeState state, NodeBuilder builder) {
- builder.setProperty(asPropertyState(PROP_REVISION, state.getRevision()));
+ builder.setProperty(asPropertyState(PROP_REVISION, state.getRootRevision()));
builder.setProperty(asPropertyState(PROP_LAST_REV, state.getLastRevision()));
builder.setProperty(createProperty(PROP_PATH, state.getPath()));
}
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterRevisionComparisonTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterRevisionComparisonTest.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterRevisionComparisonTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterRevisionComparisonTest.java Mon Jul 25 08:19:15 2016
@@ -145,7 +145,7 @@ public class ClusterRevisionComparisonTe
// read again starting at root node with a invalidated cache
// and purged revision comparator
c1ns1 = c1.getRoot();
- c1.invalidateNodeCache("/", c1ns1.getRevision());
+ c1.invalidateNodeCache("/", c1ns1.getRootRevision());
c1ns1 = c1.getRoot();
c1.invalidateNodeCache("/a", c1ns1.getLastRevision());
assertTrue("/a missing", c1ns1.hasChildNode("a"));
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CommitQueueTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CommitQueueTest.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CommitQueueTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CommitQueueTest.java Mon Jul 25 08:19:15 2016
@@ -76,7 +76,7 @@ public class CommitQueueTest {
@Override
public void contentChanged(@Nonnull NodeState root, @Nullable CommitInfo info) {
DocumentNodeState after = (DocumentNodeState) root;
- RevisionVector r = after.getRevision();
+ RevisionVector r = after.getRootRevision();
LOG.debug("seen: {}", r);
if (r.compareTo(before) < 0) {
exceptions.add(new Exception(
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStateTest.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStateTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStateTest.java Mon Jul 25 08:19:15 2016
@@ -35,7 +35,7 @@ public class DocumentNodeStateTest {
DocumentNodeStore store = builderProvider.newBuilder().getNodeStore();
RevisionVector rv = new RevisionVector(Revision.newRevision(1));
DocumentNodeState state = new DocumentNodeState(store, "/foo", rv);
- assertEquals(232, state.getMemory());
+ assertEquals(164, state.getMemory());
}
@Test
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java Mon Jul 25 08:19:15 2016
@@ -1670,14 +1670,10 @@ public class DocumentNodeStoreTest {
merge(ns2, b2);
// on cluster node 2, remove of child-0 is not yet visible
- List<ChildNodeEntry> children = Lists.newArrayList(ns2.getRoot().getChildNode("foo").getChildNode("bar").getChildNodeEntries());
+ DocumentNodeState bar = asDocumentNodeState(ns2.getRoot().getChildNode("foo").getChildNode("bar"));
+ List<ChildNodeEntry> children = Lists.newArrayList(bar.getChildNodeEntries());
assertEquals(2, Iterables.size(children));
- RevisionVector invalidate = null;
- for (ChildNodeEntry entry : children) {
- if (entry.getName().equals("child-0")) {
- invalidate = asDocumentNodeState(entry.getNodeState()).getRevision();
- }
- }
+ RevisionVector invalidate = bar.getLastRevision();
assertNotNull(invalidate);
// this will make changes from cluster node 1 visible
@@ -2227,7 +2223,7 @@ public class DocumentNodeStoreTest {
afterTest.compareAgainstBaseState(beforeTest, new DefaultNodeStateDiff());
assertEquals(1, startValues.size());
- Revision localHead = before.getRevision().getRevision(ns.getClusterId());
+ Revision localHead = before.getRootRevision().getRevision(ns.getClusterId());
assertNotNull(localHead);
long beforeModified = getModifiedInSecs(localHead.getTimestamp());
// startValue must be based on the revision of the before state
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeStoreDiffTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeStoreDiffTest.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeStoreDiffTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeStoreDiffTest.java Mon Jul 25 08:19:15 2016
@@ -226,7 +226,7 @@ public class NodeStoreDiffTest {
private void prRev(NodeState ns){
if(ns instanceof DocumentNodeState){
DocumentNodeState dns = ((DocumentNodeState) ns);
- LOG.info("Root at {} ({})", dns.getRevision(), dns.getLastRevision());
+ LOG.info("Root at {} ({})", dns.getRootRevision(), dns.getLastRevision());
}
}
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java Mon Jul 25 08:19:15 2016
@@ -477,7 +477,7 @@ public class VersionGarbageCollectorIT {
}
// invalidate cached DocumentNodeState
DocumentNodeState state = (DocumentNodeState) store.getRoot().getChildNode(name);
- store.invalidateNodeCache(state.getPath(), state.getRevision());
+ store.invalidateNodeCache(state.getPath(), store.getRoot().getLastRevision());
while (!f.isDone()) {
docs.poll();
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeStateTest.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeStateTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/DelegatingDocumentNodeStateTest.java Mon Jul 25 08:19:15 2016
@@ -52,7 +52,6 @@ public class DelegatingDocumentNodeState
builder.setProperty(createProperty(PROP_PATH, "foo"));
AbstractDocumentNodeState state = DelegatingDocumentNodeState.wrap(builder.getNodeState(), NodeStateDiffer.DEFAULT_DIFFER);
- assertEquals(rv1, state.getRevision());
assertEquals(rv1, state.getRootRevision());
assertEquals(rv2, state.getLastRevision());
assertEquals("foo", state.getPath());
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/SecondaryStoreObserverTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/SecondaryStoreObserverTest.java?rev=1753961&r1=1753960&r2=1753961&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/SecondaryStoreObserverTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/SecondaryStoreObserverTest.java Mon Jul 25 08:19:15 2016
@@ -141,7 +141,7 @@ public class SecondaryStoreObserverTest
}
private static void assertMetaState(AbstractDocumentNodeState a, AbstractDocumentNodeState b){
- assertEquals(a.getRevision(), b.getRevision());
+ assertEquals(a.getLastRevision(), b.getLastRevision());
assertEquals(a.getRootRevision(), b.getRootRevision());
assertEquals(a.getPath(), b.getPath());
}