jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1501746 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property: PropertyIndexEditor.java PropertyIndexLookup.java strategy/ContentMirrorStoreStrategy.java
Date Wed, 10 Jul 2013 12:15:01 GMT
Author: thomasm
Date: Wed Jul 10 12:15:00 2013
New Revision: 1501746

URL: http://svn.apache.org/r1501746
Log:
OAK-894 Query: coding style

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/ContentMirrorStoreStrategy.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexEditor.java?rev=1501746&r1=1501745&r2=1501746&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexEditor.java
Wed Jul 10 12:15:00 2013
@@ -86,19 +86,19 @@ class PropertyIndexEditor implements Ind
      * Flag to indicate whether individual property changes should
      * be tracked for this node.
      */
-    private boolean trackChanges = false;
+    private boolean trackChanges;
 
     /**
      * Matching property value keys from the before state,
      * or {@code null} if this node is not indexed.
      */
-    private Set<String> beforeKeys = null;
+    private Set<String> beforeKeys;
 
     /**
      * Matching property value keys from the after state,
      * or {@code null} if this node is not indexed.
      */
-    private Set<String> afterKeys = null;
+    private Set<String> afterKeys;
 
     public PropertyIndexEditor(NodeBuilder definition, NodeState root) {
         this.parent = null;
@@ -161,7 +161,8 @@ class PropertyIndexEditor implements Ind
     }
 
     private boolean isOfMatchingType(NodeState state) {
-        return primaryTypes == null // no type limitations
+        // no type limitations
+        return primaryTypes == null 
                 || primaryTypes.contains(state.getName(JCR_PRIMARYTYPE))
                 || any(state.getNames(JCR_MIXINTYPES), in(mixinTypes));
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java?rev=1501746&r1=1501745&r2=1501746&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
Wed Jul 10 12:15:00 2013
@@ -139,7 +139,7 @@ public class PropertyIndexLookup {
      *         definition or index data node was found
      */
     @Nullable
-    private NodeState getIndexDataNode(
+    private static NodeState getIndexDataNode(
             NodeState node, String propertyName, Set<String> supertypes) {
         //keep a fallback to a matching index def that has *no* node type constraints
         NodeState fallback = MISSING_NODE;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/ContentMirrorStoreStrategy.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/ContentMirrorStoreStrategy.java?rev=1501746&r1=1501745&r2=1501746&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/ContentMirrorStoreStrategy.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/ContentMirrorStoreStrategy.java
Wed Jul 10 12:15:00 2013
@@ -74,7 +74,7 @@ public class ContentMirrorStoreStrategy 
         }
     }
 
-    private void remove(NodeBuilder index, String key, String value) {
+    private static void remove(NodeBuilder index, String key, String value) {
         NodeBuilder builder = index.getChildNode(key);
         if (builder.exists()) {
             // Collect all builders along the given path
@@ -103,7 +103,7 @@ public class ContentMirrorStoreStrategy 
         }
     }
 
-    private void insert(NodeBuilder index, String key, String value) {
+    private static void insert(NodeBuilder index, String key, String value) {
         NodeBuilder builder = index.child(key);
         for (String name : PathUtils.elements(value)) {
             builder = builder.child(name);
@@ -143,6 +143,8 @@ public class ContentMirrorStoreStrategy 
             CountingNodeVisitor v = new CountingNodeVisitor(max);
             v.visit(index);
             count = v.getEstimatedCount();
+            // "is not null" queries typically read more data
+            count *= 10;
         } else {
             int size = values.size();
             if (size == 0) {



Mime
View raw message