jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1448554 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment: NodeTemplate.java Segment.java SegmentNodeState.java SegmentReader.java SegmentWriter.java Template.java
Date Thu, 21 Feb 2013 08:56:04 GMT
Author: jukka
Date: Thu Feb 21 08:56:04 2013
New Revision: 1448554

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

Rename NodeTemplate to Template to simplify naming

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java
      - copied, changed from r1448552, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/NodeTemplate.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/NodeTemplate.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Segment.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentReader.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentWriter.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Segment.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Segment.java?rev=1448554&r1=1448553&r2=1448554&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Segment.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Segment.java
Thu Feb 21 08:56:04 2013
@@ -94,9 +94,9 @@ class Segment {
         }
     };
 
-    private final OffsetCache<NodeTemplate> templates = new OffsetCache<NodeTemplate>()
{
+    private final OffsetCache<Template> templates = new OffsetCache<Template>()
{
         @Override
-        protected NodeTemplate load(int offset) {
+        protected Template load(int offset) {
             return null;
         }
     };

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java?rev=1448554&r1=1448553&r2=1448554&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
Thu Feb 21 08:56:04 2013
@@ -43,14 +43,14 @@ class SegmentNodeState extends AbstractN
 
     private final RecordId recordId;
 
-    private NodeTemplate template = null;
+    private Template template = null;
 
     SegmentNodeState(SegmentReader reader, RecordId id) {
         this.reader = checkNotNull(reader);
         this.recordId = checkNotNull(id);
     }
 
-    private synchronized NodeTemplate getTemplate() {
+    private synchronized Template getTemplate() {
         if (template == null) {
             template = reader.readTemplate(reader.readRecordId(recordId, 0));
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentReader.java?rev=1448554&r1=1448553&r2=1448554&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentReader.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentReader.java
Thu Feb 21 08:56:04 2013
@@ -43,7 +43,7 @@ public class SegmentReader {
             .weigher(newStringWeigher())
             .build(newStringLoader());
 
-    private final LoadingCache<RecordId, NodeTemplate> templates =
+    private final LoadingCache<RecordId, Template> templates =
             CacheBuilder.newBuilder()
             .maximumSize(1000)
             .build(newTemplateLoader());
@@ -75,10 +75,10 @@ public class SegmentReader {
         };
     }
 
-    private CacheLoader<RecordId, NodeTemplate> newTemplateLoader() {
-        return new CacheLoader<RecordId, NodeTemplate>() {
+    private CacheLoader<RecordId, Template> newTemplateLoader() {
+        return new CacheLoader<RecordId, Template>() {
             @Override
-            public NodeTemplate load(RecordId key) throws Exception {
+            public Template load(RecordId key) throws Exception {
                 Segment segment = store.readSegment(key.getSegmentId());
                 int offset = key.getOffset();
 
@@ -111,9 +111,9 @@ public class SegmentReader {
                             "jcr:mixinTypes", Arrays.asList(mixins), Type.NAMES);
                 }
 
-                String childName = NodeTemplate.ZERO_CHILD_NODES;
+                String childName = Template.ZERO_CHILD_NODES;
                 if (manyChildNodes) {
-                    childName = NodeTemplate.MANY_CHILD_NODES;
+                    childName = Template.MANY_CHILD_NODES;
                 } else if (!zeroChildNodes) {
                     RecordId childNameId = segment.readRecordId(offset);
                     childName = readString(childNameId);
@@ -131,13 +131,13 @@ public class SegmentReader {
                             Type.fromTag(Math.abs(type), type < 0));
                 }
 
-                return new NodeTemplate(
+                return new Template(
                         primaryType, mixinTypes, properties, childName);
             }
         };
     }
 
-    public NodeTemplate readTemplate(RecordId recordId) {
+    public Template readTemplate(RecordId recordId) {
         try {
             return templates.get(recordId);
         } catch (ExecutionException e) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentWriter.java?rev=1448554&r1=1448553&r2=1448554&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentWriter.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentWriter.java
Thu Feb 21 08:56:04 2013
@@ -55,7 +55,7 @@ public class SegmentWriter {
 
     private final Map<String, RecordId> strings = Maps.newHashMap();
 
-    private final Map<NodeTemplate, RecordId> templates = Maps.newHashMap();
+    private final Map<Template, RecordId> templates = Maps.newHashMap();
 
     private UUID uuid = UUID.randomUUID();
 
@@ -454,7 +454,7 @@ public class SegmentWriter {
         }
     }
 
-    public synchronized RecordId writeTemplate(NodeTemplate template) {
+    public synchronized RecordId writeTemplate(Template template) {
         checkNotNull(template);
         RecordId id = templates.get(template);
         if (id == null) {
@@ -535,7 +535,7 @@ public class SegmentWriter {
             return nodeId;
         }
 
-        NodeTemplate template = new NodeTemplate(state);
+        Template template = new Template(state);
 
         List<RecordId> ids = Lists.newArrayList();
         ids.add(writeTemplate(template));

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java
(from r1448552, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/NodeTemplate.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/NodeTemplate.java&r1=1448552&r2=1448554&rev=1448554&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/NodeTemplate.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java
Thu Feb 21 08:56:04 2013
@@ -43,7 +43,7 @@ import com.google.common.base.Objects;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 
-class NodeTemplate {
+class Template {
 
     static final String ZERO_CHILD_NODES = null;
 
@@ -78,7 +78,7 @@ class NodeTemplate {
     @CheckForNull
     private final String childName;
 
-    NodeTemplate(
+    Template(
             PropertyState primaryType, PropertyState mixinTypes,
             PropertyTemplate[] properties, String childName) {
         this.primaryType = primaryType;
@@ -87,7 +87,7 @@ class NodeTemplate {
         this.childName = childName;
     }
 
-    NodeTemplate(NodeState state) {
+    Template(NodeState state) {
         PropertyState primary = null;
         PropertyState mixins = null;
         List<PropertyTemplate> templates = Lists.newArrayList();
@@ -331,7 +331,7 @@ class NodeTemplate {
 
     public void compareAgainstBaseState(
             SegmentReader reader, RecordId afterId,
-            NodeTemplate beforeTemplate, RecordId beforeId,
+            Template beforeTemplate, RecordId beforeId,
             NodeStateDiff diff) {
         checkNotNull(reader);
         checkNotNull(afterId);
@@ -445,8 +445,8 @@ class NodeTemplate {
     public boolean equals(Object object) {
         if (this == object) {
             return true;
-        } else if (object instanceof NodeTemplate) {
-            NodeTemplate that = (NodeTemplate) object;
+        } else if (object instanceof Template) {
+            Template that = (Template) object;
             return Objects.equal(primaryType, that.primaryType)
                     && Objects.equal(mixinTypes, that.mixinTypes)
                     && Arrays.equals(properties, that.properties)



Mime
View raw message