Class ProtobufMatcher

java.lang.Object
org.infinispan.query.objectfilter.impl.BaseMatcher<org.infinispan.protostream.descriptors.Descriptor, org.infinispan.protostream.descriptors.FieldDescriptor, Integer>
org.infinispan.query.objectfilter.impl.ProtobufMatcher
All Implemented Interfaces:
Matcher

public class ProtobufMatcher extends BaseMatcher<org.infinispan.protostream.descriptors.Descriptor, org.infinispan.protostream.descriptors.FieldDescriptor, Integer>
Since:
7.0
Author:
anistor@redhat.com
  • Constructor Details

    • ProtobufMatcher

      public ProtobufMatcher(org.infinispan.protostream.SerializationContext serializationContext, org.infinispan.query.objectfilter.impl.syntax.parser.ProtobufPropertyHelper propertyHelper)
  • Method Details

    • startMultiTypeContext

      protected org.infinispan.query.objectfilter.impl.predicateindex.ProtobufMatcherEvalContext startMultiTypeContext(boolean isDeltaFilter, Object userContext, Object eventType, Object instance)
      Description copied from class: BaseMatcher
      Creates a new MatcherEvalContext capable of dealing with multiple filters. The context is created only if the given instance is recognized to be of a type that has some filters registered. If there are no filters, null is returned to signal this condition and make the evaluation faster. This method must be called while holding the internal write lock.
      Specified by:
      startMultiTypeContext in class BaseMatcher<org.infinispan.protostream.descriptors.Descriptor, org.infinispan.protostream.descriptors.FieldDescriptor, Integer>
      Parameters:
      isDeltaFilter - indicates if this is a delta match of not
      userContext - an opaque value, possibly null, the is received from the caller and is to be handed to the FilterCallback in case a match is detected
      eventType - on optional event type discriminator
      instance - the instance to filter; never null
      Returns:
      the MatcherEvalContext or null if no filter was registered for the instance
    • startSingleTypeContext

      protected org.infinispan.query.objectfilter.impl.predicateindex.ProtobufMatcherEvalContext startSingleTypeContext(Object userContext, Object eventType, Object key, Object instance, Object metadata, MetadataAdapter<org.infinispan.protostream.descriptors.Descriptor, org.infinispan.protostream.descriptors.FieldDescriptor, Integer> metadataAdapter)
      Description copied from class: BaseMatcher
      Creates a new MatcherEvalContext capable of dealing with a single filter for a single type. The context is created only if the given instance is recognized to be of a type that has some filters registered. If there are no filters, null is returned to signal this condition and make the evaluation faster. This method must be called while holding the internal write lock.
      Specified by:
      startSingleTypeContext in class BaseMatcher<org.infinispan.protostream.descriptors.Descriptor, org.infinispan.protostream.descriptors.FieldDescriptor, Integer>
      Parameters:
      userContext - an opaque value, possibly null, the is received from the caller and is to be handed to the FilterCallback in case a match is detected
      instance - the instance to filter; never null
      metadataAdapter - the metadata adapter of expected instance type
      Returns:
      the MatcherEvalContext or null if no filter was registered for the instance
    • createMetadataAdapter

      protected MetadataAdapter<org.infinispan.protostream.descriptors.Descriptor, org.infinispan.protostream.descriptors.FieldDescriptor, Integer> createMetadataAdapter(org.infinispan.protostream.descriptors.Descriptor messageDescriptor)
      Specified by:
      createMetadataAdapter in class BaseMatcher<org.infinispan.protostream.descriptors.Descriptor, org.infinispan.protostream.descriptors.FieldDescriptor, Integer>