Class HistoricalCsnRangeMatchingRuleImpl

  • All Implemented Interfaces:
    MatchingRuleImpl

    public final class HistoricalCsnRangeMatchingRuleImpl
    extends Object
    implements MatchingRuleImpl
    Extensible matching rule to allow a range search on CSNs for a given replica.

    It uses the same index as HistoricalCsnOrderingMatchingRuleImpl, but emulates a range search on a multivalued attribute. We can do that because the index is ordered by replica id and we're interested on a range search for a single replica only.

    • Constructor Detail

      • HistoricalCsnRangeMatchingRuleImpl

        public HistoricalCsnRangeMatchingRuleImpl()
    • Method Detail

      • getAssertion

        public Assertion getAssertion​(Schema schema,
                                      ByteString assertionValue)
                               throws DecodeException
        Represents a filter for a CSN range on a replica id.

        Expected syntax is: "OP1 CSN1[, OP2 CSN2]"; where OP1 is one of ">", ">=", OP2 is one of "<", "<=" or the other way around.

        Example of valid filters:

        • <= 0000018b6fc1f1861f3003d3e3c1, > 0000018b6fc1f1861f3003d3e3a0
        • > 0000018b6fc1f1861f3003d3e3a0, <= 0000018b6fc1f1861f3003d3e3c1 (same as before)
        • >= 0000018b6fc1f1861f3003d3e3c1
        • < 0000018b6fc1f1861f3003d3e3a0
        When the specified range is an open interval, the other endpoint is automatically computed to be the maximum or minimum possible CSN for the replica id in the specified CSN.
        Specified by:
        getAssertion in interface MatchingRuleImpl
        Parameters:
        schema - The schema in which this matching rule is defined.
        assertionValue - The assertion value.
        Returns:
        The compiled assertion.
        Throws:
        DecodeException - If the assertion value does not conform to the matching rule's assertion syntax.
      • normalizeAttributeValue

        public ByteString normalizeAttributeValue​(Schema schema,
                                                  ByteString value)
                                           throws DecodeException
        Description copied from interface: MatchingRuleImpl
        Retrieves the normalized form of the provided attribute value, which is best suited for efficiently performing matching operations on that value. Equality and ordering matching rules should return a normalized representation which can be compared with other normalized values using ByteString.equals(Object) and ByteString.compareTo(ByteString).
        Specified by:
        normalizeAttributeValue in interface MatchingRuleImpl
        Parameters:
        schema - The schema in which this matching rule is defined.
        value - The attribute value to be normalized.
        Returns:
        The normalized version of the provided attribute value.
        Throws:
        DecodeException - If an syntax error occurred while parsing the value.
      • createIndexers

        public Collection<? extends Indexer> createIndexers​(Schema schema,
                                                            IndexingOptions options)
        Description copied from interface: MatchingRuleImpl
        Returns the indexers for this matching rule.
        Specified by:
        createIndexers in interface MatchingRuleImpl
        Parameters:
        schema - The schema in which this matching rule is defined.
        options - The indexing options.
        Returns:
        a non null collection of indexers for this matching rule.