Class FilteringIndexStoreStrategy

  • All Implemented Interfaces:
    IndexStoreStrategy

    public class FilteringIndexStoreStrategy
    extends Object
    implements IndexStoreStrategy
    A delegating IndexStoreStrategy that filters out updates that are not accepted by the given predicate
    • Method Detail

      • exists

        public boolean exists​(Supplier<NodeBuilder> index,
                              String key)
        Description copied from interface: IndexStoreStrategy
        Check whether an entry for the given key exists.
        Specified by:
        exists in interface IndexStoreStrategy
        Parameters:
        index - the index node supplier
        key - the key
        Returns:
        true if at least one entry exists
      • query

        public Iterable<String> query​(Filter filter,
                                      String indexName,
                                      NodeState indexMeta,
                                      Iterable<String> values)
        Description copied from interface: IndexStoreStrategy
        Search for a given set of values.
        Specified by:
        query in interface IndexStoreStrategy
        Parameters:
        filter - the filter (can optionally be used for optimized query execution)
        indexName - the name of the index (for logging)
        indexMeta - the index metadata node (may not be null)
        values - values to look for (null to check for property existence)
        Returns:
        an iterator of paths
      • count

        public long count​(NodeState root,
                          NodeState indexMeta,
                          Set<String> values,
                          int max)
        Description copied from interface: IndexStoreStrategy
        Count the occurrence of a given set of values. Used in calculating the cost of an index.
        Specified by:
        count in interface IndexStoreStrategy
        Parameters:
        root - the root node (may not be null)
        indexMeta - the index metadata node (may not be null)
        values - values to look for (null to check for property existence)
        max - the maximum value to return
        Returns:
        the aggregated count of occurrences for each provided value
      • count

        public long count​(Filter filter,
                          NodeState root,
                          NodeState indexMeta,
                          Set<String> values,
                          int max)
        Description copied from interface: IndexStoreStrategy
        Count the occurrence of a given set of values. Used in calculating the cost of an index.
        Specified by:
        count in interface IndexStoreStrategy
        Parameters:
        filter - the filter which can be used to estimate better cost
        root - the root node (may not be null)
        indexMeta - the index metadata node (may not be null)
        values - values to look for (null to check for property existence)
        max - the maximum value to return
        Returns:
        the aggregated count of occurrences for each provided value