Class FilterIterators


  • public class FilterIterators
    extends java.lang.Object
    Filtering iterators that are useful for queries with limit, offset, order by, or distinct.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkMemoryLimit​(long count, QueryLimits settings)
      Verify the number of in-memory nodes is below the limit.
      static void checkReadLimit​(long count, QueryLimits settings)
      Verify the number of node read operations is below the limit.
      static <K> java.util.Iterator<K> newCombinedFilter​(java.util.Iterator<K> it, boolean distinct, long limit, long offset, java.util.Comparator<K> orderBy, QueryLimits settings)  
      static <K> org.apache.jackrabbit.oak.query.FilterIterators.DistinctIterator<K> newDistinct​(java.util.Iterator<K> it, QueryLimits settings)  
      static <K> java.util.Iterator<K> newLimit​(java.util.Iterator<K> it, long limit)  
      static <K> java.util.Iterator<K> newOffset​(java.util.Iterator<K> it, long offset)  
      static <K> java.util.Iterator<K> newSort​(java.util.Iterator<K> it, java.util.Comparator<K> orderBy, int max, QueryLimits settings)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkMemoryLimit

        public static void checkMemoryLimit​(long count,
                                            QueryLimits settings)
        Verify the number of in-memory nodes is below the limit.
        Parameters:
        count - the number of nodes
        settings - the query engine settings
        Throws:
        java.lang.UnsupportedOperationException - if the limit was exceeded
      • checkReadLimit

        public static void checkReadLimit​(long count,
                                          QueryLimits settings)
        Verify the number of node read operations is below the limit.
        Parameters:
        count - the number of read operations
        settings - the query engine settings
        Throws:
        RuntimeNodeTraversalException - if the limit was exceeded
      • newCombinedFilter

        public static <K> java.util.Iterator<K> newCombinedFilter​(java.util.Iterator<K> it,
                                                                  boolean distinct,
                                                                  long limit,
                                                                  long offset,
                                                                  java.util.Comparator<K> orderBy,
                                                                  QueryLimits settings)
      • newDistinct

        public static <K> org.apache.jackrabbit.oak.query.FilterIterators.DistinctIterator<K> newDistinct​(java.util.Iterator<K> it,
                                                                                                          QueryLimits settings)
      • newLimit

        public static <K> java.util.Iterator<K> newLimit​(java.util.Iterator<K> it,
                                                         long limit)
      • newOffset

        public static <K> java.util.Iterator<K> newOffset​(java.util.Iterator<K> it,
                                                          long offset)
      • newSort

        public static <K> java.util.Iterator<K> newSort​(java.util.Iterator<K> it,
                                                        java.util.Comparator<K> orderBy,
                                                        int max,
                                                        QueryLimits settings)