jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1170108 - in /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index: BTree.java Cursor.java PropertyIndex.java
Date Tue, 13 Sep 2011 10:48:35 GMT
Author: thomasm
Date: Tue Sep 13 10:48:35 2011
New Revision: 1170108

URL: http://svn.apache.org/viewvc?rev=1170108&view=rev
Log:
Support iterating over the whole index.

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/BTree.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Cursor.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/PropertyIndex.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/BTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/BTree.java?rev=1170108&r1=1170107&r2=1170108&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/BTree.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/BTree.java
Tue Sep 13 10:48:35 2011
@@ -68,7 +68,7 @@ public class BTree {
         int min = 0, max = keys.length - 1;
         while (min <= max) {
             int test = (min + max) >>> 1;
-            int compare = keys[test].compareTo(key);
+            int compare = key == null ? 1 : keys[test].compareTo(key);
             if (compare == 0) {
                 if (unique) {
                     return test;

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Cursor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Cursor.java?rev=1170108&r1=1170107&r2=1170108&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Cursor.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Cursor.java
Tue Sep 13 10:48:35 2011
@@ -83,7 +83,7 @@ public class Cursor implements Iterator<
             value = null;
             if (cursor.hasNext()) {
                 String k = cursor.next();
-                if (k.compareTo(maxKey) <= 0) {
+                if (maxKey == null || k.compareTo(maxKey) <= 0) {
                     value = cursor.getValue();
                 }
             }

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/PropertyIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/PropertyIndex.java?rev=1170108&r1=1170107&r2=1170108&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/PropertyIndex.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/PropertyIndex.java
Tue Sep 13 10:48:35 2011
@@ -94,7 +94,7 @@ public class PropertyIndex implements In
      * Get an iterator over the paths for the given property value. For unique
      * indexes, the iterator will contain at most one element.
      *
-     * @param propertyValue the value
+     * @param propertyValue the value, or null to return all indexed rows
      * @param revision the revision
      * @return an iterator of the paths (an empty iterator if not found)
      */



Mime
View raw message