jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1547246 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java
Date Tue, 03 Dec 2013 00:26:42 GMT
Author: jukka
Date: Tue Dec  3 00:26:42 2013
New Revision: 1547246

URL: http://svn.apache.org/r1547246
Log:
OAK-593: Segment-based MK

Simplify SegmentNodeStoreBranch by dropping the obsolete NodeStoreBranch interface

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java?rev=1547246&r1=1547245&r2=1547246&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java
Tue Dec  3 00:26:42 2013
@@ -33,9 +33,8 @@ import org.apache.jackrabbit.oak.spi.com
 import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 
-class SegmentNodeStoreBranch implements NodeStoreBranch {
+class SegmentNodeStoreBranch {
 
     private static final Random RANDOM = new Random();
 
@@ -59,25 +58,13 @@ class SegmentNodeStoreBranch implements 
         this.maximumBackoff = maximumBackoff;
     }
 
-    @Override @Nonnull
-    public NodeState getBase() {
-        return base.getChildNode(ROOT);
-    }
-
-    @Override @Nonnull
-    public synchronized NodeState getHead() {
-        return new SegmentRootState(head);
-    }
-
-    @Override
-    public synchronized void setRoot(NodeState newRoot) {
+    void setRoot(NodeState newRoot) {
         NodeBuilder builder = head.builder();
         builder.setChildNode(ROOT, newRoot);
         head = writer.writeNode(builder.getNodeState());
     }
 
-    @Override
-    public synchronized void rebase() {
+    private void rebase() {
         SegmentNodeState newBase = store.head;
         if (!base.getRecordId().equals(newBase.getRecordId())) {
             NodeBuilder builder = newBase.builder();
@@ -89,7 +76,7 @@ class SegmentNodeStoreBranch implements 
         }
     }
 
-    private synchronized long optimisticMerge(CommitHook hook, CommitInfo info)
+    private long optimisticMerge(CommitHook hook, CommitInfo info)
             throws CommitFailedException, InterruptedException {
         long timeout = 1;
 
@@ -136,7 +123,7 @@ class SegmentNodeStoreBranch implements 
         return MILLISECONDS.convert(timeout, NANOSECONDS);
     }
 
-    private synchronized void pessimisticMerge(
+    private void pessimisticMerge(
             CommitHook hook, long timeout, CommitInfo info)
             throws CommitFailedException, InterruptedException {
         while (true) {
@@ -185,9 +172,8 @@ class SegmentNodeStoreBranch implements 
         }
     }
 
-    @Override @Nonnull
-    public synchronized NodeState merge(
-            @Nonnull CommitHook hook, @Nullable CommitInfo info)
+    @Nonnull
+    SegmentRootState merge(@Nonnull CommitHook hook, @Nullable CommitInfo info)
             throws CommitFailedException {
         checkNotNull(hook);
         if (base != head) {
@@ -205,11 +191,7 @@ class SegmentNodeStoreBranch implements 
                 }
             }
         }
-        return getHead();
+        return new SegmentRootState(head);
     }
 
-    @Override
-    public String toString() {
-        return getHead().toString();
-    }
 }



Mime
View raw message