Class Comparisons.TextContainsAllPrefixesComparison
- java.lang.Object
-
- com.apple.foundationdb.record.query.expressions.Comparisons.TextComparison
-
- com.apple.foundationdb.record.query.expressions.Comparisons.TextContainsAllPrefixesComparison
-
- All Implemented Interfaces:
PlanHashable
,Comparisons.Comparison
- Enclosing class:
- Comparisons
@API(EXPERIMENTAL) public static class Comparisons.TextContainsAllPrefixesComparison extends Comparisons.TextComparison
AComparisons.TextComparison
that checks for all prefixes. It carries additional meta-data about whether the comparison is "strict" or not, i.e., whether it is allowed to return false positives.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.PlanHashable
PlanHashable.PlanHashKind
-
-
Constructor Summary
Constructors Constructor Description TextContainsAllPrefixesComparison(String tokenPrefixes, boolean strict, long expectedRecords, double falsePositivePercentage, String tokenizerName, String fallbackTokenizerName)
TextContainsAllPrefixesComparison(String tokenPrefixes, boolean strict, String tokenizerName, String fallbackTokenizerName)
TextContainsAllPrefixesComparison(List<String> tokenPrefixes, boolean strict, long expectedRecords, double falsePositivePercentage, String tokenizerName, String fallbackTokenizerName)
TextContainsAllPrefixesComparison(List<String> tokenPrefixes, boolean strict, String tokenizerName, String fallbackTokenizerName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
long
getExpectedRecords()
Get the expected number of records for each token of this predicate.double
getFalsePositivePercentage()
Get the configured false positive percentage for each token scan of this predicate.int
hashCode()
boolean
isStrict()
Whether this comparison should be strictly evaluated.int
planHash(PlanHashable.PlanHashKind hashKind)
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.String
toString()
-
Methods inherited from class com.apple.foundationdb.record.query.expressions.Comparisons.TextComparison
eval, getComparand, getFallbackTokenizerName, getTokenizerName, getType, typelessString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.query.expressions.Comparisons.Comparison
getComparand, hasMultiColumnComparand
-
Methods inherited from interface com.apple.foundationdb.record.PlanHashable
planHash
-
-
-
-
Constructor Detail
-
TextContainsAllPrefixesComparison
public TextContainsAllPrefixesComparison(@Nonnull String tokenPrefixes, boolean strict, @Nullable String tokenizerName, @Nonnull String fallbackTokenizerName)
-
TextContainsAllPrefixesComparison
public TextContainsAllPrefixesComparison(@Nonnull String tokenPrefixes, boolean strict, long expectedRecords, double falsePositivePercentage, @Nullable String tokenizerName, @Nonnull String fallbackTokenizerName)
-
TextContainsAllPrefixesComparison
public TextContainsAllPrefixesComparison(@Nonnull List<String> tokenPrefixes, boolean strict, @Nullable String tokenizerName, @Nonnull String fallbackTokenizerName)
-
-
Method Detail
-
isStrict
public boolean isStrict()
Whether this comparison should be strictly evaluated. This is used during query planning to determine whether it is acceptable to return false positives.- Returns:
false
if false positives are acceptable andtrue
otherwise
-
getExpectedRecords
public long getExpectedRecords()
Get the expected number of records for each token of this predicate. This tweaks the behavior of this predicate when run against an index scan. In particular, this informs how much memory to use for internal data structures as part of the scan. If the number provided is larger than the number that actually gets read, then the scan is less memory efficient. If the number provided is smaller than the number that actually gets read, then the scan may have more false positives than expected.- Returns:
- the expected number of insertions per child of
-
getFalsePositivePercentage
public double getFalsePositivePercentage()
Get the configured false positive percentage for each token scan of this predicate. This is used, along withgetExpectedRecords()
, determines the size of internal data structures used as part of the scan. In general, the lower this number, the more memory is used. This number refers to the false positive percentage of determining if an individual prefix is in the indexed text field of a record while scanning.- Returns:
- the rate of false positives used by probabilistic data structures
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classComparisons.TextComparison
-
planHash
public int planHash(@Nonnull PlanHashable.PlanHashKind hashKind)
Description copied from interface:PlanHashable
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.- Specified by:
planHash
in interfacePlanHashable
- Overrides:
planHash
in classComparisons.TextComparison
- Parameters:
hashKind
- the "kind" of hash to calculate. Each kind of hash has a particular logic with regards to included and excluded items.- Returns:
- a stable hash code
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classComparisons.TextComparison
-
toString
@Nonnull public String toString()
- Overrides:
toString
in classComparisons.TextComparison
-
-