jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1537548 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentRootBuilder.java
Date Thu, 31 Oct 2013 16:38:52 GMT
Author: jukka
Date: Thu Oct 31 16:38:51 2013
New Revision: 1537548

URL: http://svn.apache.org/r1537548
Log:
OAK-1132: QueryEngine #executeQuery creates a new revision on each call

Only update the SegmentRootBuilder state in getNodeState() if there are transient changes.

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentRootBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentRootBuilder.java?rev=1537548&r1=1537547&r2=1537548&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentRootBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentRootBuilder.java
Thu Oct 31 16:38:51 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.segment;
 
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+
 class SegmentRootBuilder extends SegmentNodeBuilder {
 
     /**
@@ -44,9 +46,15 @@ class SegmentRootBuilder extends Segment
 
     @Override
     public SegmentNodeState getNodeState() {
-        set(writer.writeNode(super.getNodeState()));
-        updateCount = 0;
-        return writer.writeNode(super.getNodeState());
+        NodeState state = super.getNodeState();
+        if (state instanceof SegmentNodeState) {
+            return (SegmentNodeState) state;
+        } else {
+            SegmentNodeState segmentState = writer.writeNode(state);
+            set(segmentState);
+            updateCount = 0;
+            return segmentState;
+        }
     }
 
 }



Mime
View raw message