jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1381177 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/index/PrefixIndex.java plugins/index/PropertyIndex.java plugins/index/PropertyIndexFactory.java spi/query/IndexManagerImpl.java
Date Wed, 05 Sep 2012 13:36:06 GMT
Author: alexparvulescu
Date: Wed Sep  5 13:36:06 2012
New Revision: 1381177

URL: http://svn.apache.org/viewvc?rev=1381177&view=rev
Log:
OAK-269 Query: IndexManager to manage existing indexes

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexFactory.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java?rev=1381177&r1=1381176&r2=1381177&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java
Wed Sep  5 13:36:06 2012
@@ -152,8 +152,8 @@ public class PrefixIndex implements PInd
     @Override
     public NodeState processCommit(NodeStore store, NodeState before,
             NodeState after) throws CommitFailedException {
-        // TODO Auto-generated method stub
-        return null;
+        // TODO wire-in the processCommit mechanism
+        return after;
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java?rev=1381177&r1=1381176&r2=1381177&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java
Wed Sep  5 13:36:06 2012
@@ -153,8 +153,8 @@ public class PropertyIndex implements PI
     @Override
     public NodeState processCommit(NodeStore store, NodeState before,
             NodeState after) throws CommitFailedException {
-        // TODO Auto-generated method stub
-        return null;
+        // TODO wire-in the processCommit mechanism
+        return after;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexFactory.java?rev=1381177&r1=1381176&r2=1381177&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexFactory.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexFactory.java
Wed Sep  5 13:36:06 2012
@@ -33,6 +33,9 @@ public class PropertyIndexFactory implem
     public static final String TYPE_PROPERTY = "property";
     public static final String TYPE_PREFIX = "prefix";
 
+    public static final String PROPERTY_NAME_PROPERTY = "property";
+    public static final String PROPERTY_NAME_PREFIX = "prefix";
+
     private static final Logger LOG = LoggerFactory
             .getLogger(PropertyIndexFactory.class);
 
@@ -52,14 +55,15 @@ public class PropertyIndexFactory implem
 
     private Index createIndex(IndexDefinition indexDefinition) {
         if (TYPE_PREFIX.equals(indexDefinition.getType())) {
-            String prefix = indexDefinition.getProperties().get("prefix");
+            String prefix = indexDefinition.getProperties().get(
+                    PROPERTY_NAME_PREFIX);
             if (prefix != null) {
                 return new PrefixIndex(indexer, prefix, indexDefinition);
             }
-            return null;
         }
         if (TYPE_PROPERTY.equals(indexDefinition.getType())) {
-            String name = indexDefinition.getProperties().get("pname");
+            String name = indexDefinition.getProperties().get(
+                    PROPERTY_NAME_PROPERTY);
             if (name != null) {
                 return new PropertyIndex(indexer, name,
                         indexDefinition.isUnique(), indexDefinition);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java?rev=1381177&r1=1381176&r2=1381177&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java
Wed Sep  5 13:36:06 2012
@@ -92,7 +92,7 @@ public class IndexManagerImpl implements
             IndexDefinition def = IndexUtils.getDefinition(indexConfigPath, c);
             if (def == null) {
                 if (log) {
-                    LOG.warn("Skipping illegal index definition name {} @ {}",
+                    LOG.warn("Skipping illegal index definition '{}' @ {}",
                             c.getName(), indexConfigPath);
                 }
                 continue;



Mime
View raw message