Class NotComponent
- java.lang.Object
-
- com.apple.foundationdb.record.query.expressions.NotComponent
-
- All Implemented Interfaces:
PlanHashable
,ComponentWithSingleChild
,QueryComponent
,QueryHashable
@API(MAINTAINED) public class NotComponent extends Object implements ComponentWithSingleChild
AQueryComponent
that is satisfied when its child component is not satisfied. For tri-valued logic, if the child evaluates to unknown /null
,NOT
is still unknown.
-
-
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
-
-
Constructor Summary
Constructors Constructor Description NotComponent(QueryComponent child)
-
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.<M extends Message>
CompletableFuture<Boolean>evalMessageAsync(FDBRecordStoreBase<M> store, EvaluationContext context, FDBRecord<M> record, Message message)
Asynchronous version ofevalMessage
.GraphExpansion
expand(CorrelationIdentifier base, List<String> fieldNamePrefix)
Expand this query component into a data flow graph.QueryComponent
getChild()
Child for this component.int
hashCode()
boolean
isAsync()
Get whether this component is asynchronous.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 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, expand
-
-
-
-
Constructor Detail
-
NotComponent
public NotComponent(@Nonnull QueryComponent child)
-
-
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.- Specified by:
evalMessage
in interfaceQueryComponent
- 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>)
-
evalMessageAsync
@Nonnull public <M extends Message> CompletableFuture<Boolean> evalMessageAsync(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable FDBRecord<M> record, @Nullable Message message)
Description copied from interface:QueryComponent
Asynchronous version ofevalMessage
.- Specified by:
evalMessageAsync
in interfaceQueryComponent
- 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:
- a future that completes with whether the record should be included in the query result
- 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>)
-
isAsync
public boolean isAsync()
Description copied from interface:QueryComponent
Get whether this component is asynchronous.- Specified by:
isAsync
in interfaceQueryComponent
- Returns:
true
if this component is better executed asynchronously
-
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.- Specified by:
validate
in interfaceQueryComponent
- Parameters:
descriptor
- a record type descriptor, or a submessage descriptor
-
getChild
@Nonnull public QueryComponent getChild()
Child for this component.- Specified by:
getChild
in interfaceComponentWithSingleChild
-
withOtherChild
public QueryComponent withOtherChild(QueryComponent newChild)
- Specified by:
withOtherChild
in interfaceComponentWithSingleChild
-
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
- 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.- Specified by:
queryHash
in interfaceQueryHashable
- 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
-
expand
@Nonnull public GraphExpansion expand(@Nonnull CorrelationIdentifier base, @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.- Specified by:
expand
in interfaceQueryComponent
- Parameters:
base
- 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
-
-