Class NestedField
- java.lang.Object
-
- com.apple.foundationdb.record.query.expressions.BaseField
-
- com.apple.foundationdb.record.query.expressions.BaseNestedField
-
- com.apple.foundationdb.record.query.expressions.NestedField
-
- All Implemented Interfaces:
PlanHashable
,ComponentWithSingleChild
,QueryComponent
,QueryHashable
@API(MAINTAINED) public class NestedField extends BaseNestedField
AQueryComponent
that evaluates a nested component against aMessage
-valued field.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.PlanHashable
PlanHashable.PlanHashKind
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.QueryHashable
QueryHashable.QueryHashKind
-
-
Field Summary
-
Fields inherited from class com.apple.foundationdb.record.query.expressions.BaseNestedField
childComponent
-
-
Constructor Summary
Constructors Constructor Description NestedField(String fieldName, QueryComponent childComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
<M extends Message>
BooleanevalMessage(FDBRecordStoreBase<M> store, EvaluationContext context, FDBRecord<M> record, Message message)
Return whether or not the given record matches this component.GraphExpansion
expand(CorrelationIdentifier baseAlias, List<String> fieldNamePrefix)
Expand this query component into a data flow graph.int
hashCode()
int
planHash(PlanHashable.PlanHashKind hashKind)
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.int
queryHash(QueryHashable.QueryHashKind hashKind)
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.String
toString()
void
validate(Descriptors.Descriptor descriptor)
Validate that the given descriptor is consistent with this component.QueryComponent
withOtherChild(QueryComponent newChild)
-
Methods inherited from class com.apple.foundationdb.record.query.expressions.BaseNestedField
getChild, isAsync
-
Methods inherited from class com.apple.foundationdb.record.query.expressions.BaseField
basePlanHash, baseQueryHash, findFieldDescriptor, getFieldName, getFieldValue, getName, requireMessageField, requirePrimitiveField, requireScalarField, validateFieldExistence
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.PlanHashable
planHash
-
Methods inherited from interface com.apple.foundationdb.record.query.expressions.QueryComponent
eval, evalAsync, evalMessageAsync, expand
-
-
-
-
Constructor Detail
-
NestedField
public NestedField(@Nonnull String fieldName, @Nonnull QueryComponent childComponent)
-
-
Method Detail
-
evalMessage
@Nullable public <M extends Message> Boolean evalMessage(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable FDBRecord<M> record, @Nullable Message message)
Description copied from interface:QueryComponent
Return whether or not the given record matches this component. The message might be the Protobuf form of a record or a piece of that record. If the key expression is meaningful against a subrecord, it should evaluate against the message. Otherwise, it should evaluate against the record and ignore what part of that record is being considered. There should not be any reason to call this method outside of the implementation of anotherevalMessage
. Under ordinary circumstances, ifrecord
isnull
, thenmessage
will benull
. Otherwise,message
will berecord.getRecord()
or some submessage of that, possiblynull
if the corresponding field is missing.- Type Parameters:
M
- the type of record- Parameters:
store
- the record store from which the record camecontext
- context for bound expressionsrecord
- the recordmessage
- the Protobuf message to evaluate against- Returns:
- true/false/null, true if the given record should be included in results, false if it should not, and null if this component cannot determine whether it should be included or not
- See Also:
QueryComponent.eval(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, com.apple.foundationdb.record.provider.foundationdb.FDBRecord<M>)
-
validate
public void validate(@Nonnull Descriptors.Descriptor descriptor)
Description copied from interface:QueryComponent
Validate that the given descriptor is consistent with this component. e.g. it has all the fields defined that this component wants to inspect.- Parameters:
descriptor
- a record type descriptor, or a submessage descriptor
-
withOtherChild
public QueryComponent withOtherChild(QueryComponent newChild)
- Specified by:
withOtherChild
in interfaceComponentWithSingleChild
- Specified by:
withOtherChild
in classBaseNestedField
-
expand
public GraphExpansion expand(@Nonnull CorrelationIdentifier baseAlias, @Nonnull List<String> fieldNamePrefix)
Description copied from interface:QueryComponent
Expand this query component into a data flow graph. The returned graph represents an adequate representation of the component as composition of relational expressions and operators.- Parameters:
baseAlias
- a an alias that refers to the data flow equivalent of an input to this componentfieldNamePrefix
- a list of field names that accumulate a field nesting chain for non-repeated fields- Returns:
- a new
GraphExpansion
representing the query graph equivalent of this query component - See Also:
TODO make this method private in Java 11
-
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.- 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
-
queryHash
public int queryHash(@Nonnull QueryHashable.QueryHashKind hashKind)
Description copied from interface:QueryHashable
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
-
-