Package com.apple.foundationdb.record
Interface QueryHashable
- All Known Subinterfaces:
AtomKeyExpression
,BooleanComponent
,Comparisons.Comparison
,Comparisons.ComparisonWithParameter
,ComponentWithChildren
,ComponentWithComparison
,ComponentWithNoChildren
,ComponentWithSingleChild
,IndexQueryabilityFilter
,KeyExpression
,KeyExpressionWithChild
,KeyExpressionWithChildren
,KeyExpressionWithoutChildren
,KeyExpressionWithValue
,QueryableKeyExpression
,QueryComponent
- All Known Implementing Classes:
AndComponent
,AndOrComponent
,BaseField
,BaseKeyExpression
,BaseNestedField
,CollateFunctionKeyExpression
,CollateFunctionKeyExpressionFactoryJRE.CollateFunctionKeyExpressionJRE
,Comparisons.InvertedFunctionComparison
,Comparisons.ListComparison
,Comparisons.MultiColumnComparison
,Comparisons.NullComparison
,Comparisons.OpaqueEqualityComparison
,Comparisons.ParameterComparison
,Comparisons.ParameterComparisonBase
,Comparisons.SimpleComparison
,Comparisons.SimpleComparisonBase
,Comparisons.TextComparison
,Comparisons.TextContainsAllPrefixesComparison
,Comparisons.TextWithMaxDistanceComparison
,Comparisons.ValueComparison
,DimensionsKeyExpression
,EmptyComparison
,EmptyKeyExpression
,FieldKeyExpression
,FieldWithComparison
,FunctionKeyExpression
,GroupingKeyExpression
,IndexRecordFunction
,InvertibleFunctionKeyExpression
,KeyWithValueExpression
,ListKeyExpression
,LiteralKeyExpression
,LongArithmethicFunctionKeyExpression
,NestedField
,NestingKeyExpression
,NotComponent
,ObjectPlanHash
,OneOfThemWithComparison
,OneOfThemWithComponent
,OrComponent
,OrderFunctionKeyExpression
,QueryKeyExpressionWithComparison
,QueryKeyExpressionWithOneOfComparison
,QueryRecordFunctionWithComparison
,RecordFunction
,RecordQuery
,RecordTypeKeyComparison
,RecordTypeKeyComparison.RecordTypeComparison
,RecordTypeKeyExpression
,SplitKeyExpression
,StoreRecordFunction
,ThenKeyExpression
,TimeWindowRecordFunction
,VersionKeyExpression
public interface QueryHashable
Query hash - calculate and return identifying hash values for queries.
The queryHash semantics are different than
Object.hashCode()
in a few ways:
queryHash(com.apple.foundationdb.record.QueryHashable.QueryHashKind)
values should be stable across runtime instance changes. The reason is that these values are going to be used to correlate queries with plans across multiple instances, and so need to be repeatable and stable.queryHash(com.apple.foundationdb.record.QueryHashable.QueryHashKind)
supports multiple flavors of hash calculations (SeeQueryHashable.QueryHashKind
). The various kinds of hash values are used for different purposes and include/exclude different parts of the target queryqueryHash(com.apple.foundationdb.record.QueryHashable.QueryHashKind)
is meant to imply a certain identity of a query, and reflects on the entire structure of the query. The intent is to be able to correlate various queries for "identity" (using different definitions for this identity as specified byQueryHashable.QueryHashKind
). This requirement drives a desire to reduce collisions as much as possible since not in all cases can we actually use "equals" to verify identity (e.g. log messages)
PlanHashable
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The "kinds" of queryHash calculations. -
Method Summary
Modifier and TypeMethodDescriptionint
queryHash
(QueryHashable.QueryHashKind hashKind) Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.
-
Method Details
-
queryHash
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.- 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
-