jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1002084 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state: ItemState.java NodeState.java PropertyState.java
Date Tue, 28 Sep 2010 09:59:16 GMT
Author: jukka
Date: Tue Sep 28 09:59:15 2010
New Revision: 1002084

URL: http://svn.apache.org/viewvc?rev=1002084&view=rev
Log:
JCR-2699: Improve read/write concurrency

Update node and property state size estimates to better mach the improved NodeId and Name
classes and the fact that those objects are also shared between multiple states.
Also remove the effect of the now removed node and prop def identifiers on the item state
size calculations.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java?rev=1002084&r1=1002083&r2=1002084&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
Tue Sep 28 09:59:15 2010
@@ -411,4 +411,5 @@ public abstract class ItemState {
      * @return the approximate memory consumption of this state.
      */
     public abstract long calculateMemoryFootprint();
+
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java?rev=1002084&r1=1002083&r2=1002084&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
Tue Sep 28 09:59:15 2010
@@ -864,27 +864,26 @@ public class NodeState extends ItemState
     /**
      * {@inheritDoc}
      */
+    @Override
     public long calculateMemoryFootprint() {
         /*
         private Name nodeTypeName;
         private Set mixinTypeNames = Collections.EMPTY_SET;
         private NodeId id;
         private NodeId parentId;
-        private NodeDefId defId;
         private ChildNodeEntries childNodeEntries = new ChildNodeEntries();
-        private boolean sharedChildNodeEntries = false;
         private HashSet propertyNames = new HashSet();
-        private boolean sharedPropertyNames = false;
+        private boolean sharedSet = Set<NodeId>;
+        private boolean sharedSetRW = false;
+        private NodeStateListener listener = ...;
 
-        we assume an average Name localname of 30 chars.
-        NodeId = 8 + UUID(24) + hashcode(4) = 36
-        Name = 8 + hash(4) + string(38+2*len) + namespace(4) + localName(38+2*len) ~ 250
-        NodeDefId = 8 + id(4) = 12
-        ChildNodeEntries = 8 + n * (name(256) + index(4) + id(36) + hashentry(16)) ~ n*300
-        PropNames = 8 + n * ( name(250))
+        We assume only 16 bytes per name or node id,
+        as they are shared between states
+        ChildNodeEntries = 8 + n * (name(16) + index(4) + id(16) + hashentry(16)) ~ n*52
+        MixinTypeNames/PropNames = 8 + n * (name(16) + hashentry(16))
         */
-        return 350 + mixinTypeNames.size() * 250 + childNodeEntries.size() * 300
-                + propertyNames.size() * 250;
+        return 100 + mixinTypeNames.size() * 32 + childNodeEntries.size() * 52
+                + propertyNames.size() * 32;
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java?rev=1002084&r1=1002083&r2=1002084&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java
Tue Sep 28 09:59:15 2010
@@ -196,20 +196,21 @@ public class PropertyState extends ItemS
     /**
      * {@inheritDoc}
      */
+    @Override
     public long calculateMemoryFootprint() {
         /*
         private PropertyId id;
         private InternalValue[] values;
         private int type;
         private boolean multiValued;
-        private PropDefId defId;
 
-        we assume an average Name localname of 30 chars.
-        PropertyId = 8 + nodeId(36) * name(250) + hash(4) ~ 300;
-        NodeDefId = 8 + id(4) = 12
+        We assume only 16 bytes per name or node id,
+        as they are shared between states
+        PropertyId = 8 + nodeId(16) + name(16) + hash(4) ~ 44;
         InternalValue = 8 + n * (values) ~ 8 + n*100;
         value=approx 100 bytes.
         */
-        return 350 + values.length * 100;
+        return 64 + values.length * 100;
     }
+
 }



Mime
View raw message