jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1528210 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment: MapEntry.java SegmentWriter.java
Date Tue, 01 Oct 2013 20:26:52 GMT
Author: jukka
Date: Tue Oct  1 20:26:52 2013
New Revision: 1528210

URL: http://svn.apache.org/r1528210
Log:
OAK-1031: SegmentMK: Fewer segment lookups

Minor MapEntry improvement

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/MapEntry.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/MapEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/MapEntry.java?rev=1528210&r1=1528209&r2=1528210&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/MapEntry.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/MapEntry.java
Tue Oct  1 20:26:52 2013
@@ -40,7 +40,7 @@ class MapEntry extends AbstractChildNode
 
     private final RecordId key;
 
-    private RecordId value;
+    private final RecordId value;
 
     MapEntry(Segment segment, String name, RecordId key, RecordId value) {
         this.segment = checkNotNull(segment);
@@ -49,6 +49,10 @@ class MapEntry extends AbstractChildNode
         this.value = value;
     }
 
+    public int getHash() {
+        return name.hashCode();
+    }
+
     //----------------------------------------------------< ChildNodeEntry >--
 
     @Override @Nonnull
@@ -76,9 +80,7 @@ class MapEntry extends AbstractChildNode
 
     @Override
     public RecordId setValue(RecordId value) {
-        RecordId old = this.value;
-        this.value = value;
-        return old;
+        throw new UnsupportedOperationException();
     }
 
     //--------------------------------------------------------< Comparable >--

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=1528210&r1=1528209&r2=1528210&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
Tue Oct  1 20:26:52 2013
@@ -241,7 +241,7 @@ public class SegmentWriter {
             RecordId id = prepare(4 + size * 4, ids);
             writeInt((level << MapRecord.SIZE_BITS) | size);
             for (MapEntry entry : array) {
-                writeInt(entry.getName().hashCode());
+                writeInt(entry.getHash());
             }
             for (MapEntry entry : array) {
                 writeRecordId(entry.getKey());



Mime
View raw message