Class CollateFunctionKeyExpression

    • Method Detail

      • getMinArguments

        public int getMinArguments()
        Description copied from class: FunctionKeyExpression
        Get the the minimum number of arguments supported by this function.
        Specified by:
        getMinArguments in class FunctionKeyExpression
        Returns:
        the minimum number of arguments supported by this function
      • getMaxArguments

        public int getMaxArguments()
        Description copied from class: FunctionKeyExpression
        Get the maximum number of arguments supported by this function.
        Specified by:
        getMaxArguments in class FunctionKeyExpression
        Returns:
        the maximum number of arguments supported by this function
      • evaluateFunction

        @Nonnull
        public <M extends MessageList<Key.Evaluated> evaluateFunction​(@Nullable
                                                                        FDBRecord<M> record,
                                                                        @Nullable
                                                                        Message message,
                                                                        @Nonnull
                                                                        Key.Evaluated arguments)
        Description copied from class: FunctionKeyExpression
        The evaluateFunction method implements the function execution. This method is invoked once per Key.Evaluated that was produced by the evaluation of the function's argument. Put another way, the function's argument expression is evaluated and is expected to produce a set of arguments. This method is invoked once for each of these and, itself, may produce a set of Key.Evaluated values that produce the final set of keys.

        Note that the record parameter might be null. Function implementors should treat this case the same way that they would treat a non-null record that has all of its non-repeated fields unset and all of its repeated fields empty. If the function result depends only on the value of arguments and not record directly, then the implementor can ignore the nullity of record.

        Specified by:
        evaluateFunction in class FunctionKeyExpression
        Type Parameters:
        M - the type of the records
        Parameters:
        record - the record against which this function will produce a key
        message - the Protobuf message against which this function will produce a key
        arguments - the set of arguments to be applied by the function against the record
        Returns:
        the list of keys for the given record
      • createsDuplicates

        public boolean createsDuplicates()
        Description copied from interface: KeyExpression
        This states whether the given expression type is capable of evaluating more to more than one value when applied to a single record. In practice, this can happen if this expression is evaluated on a repeated field with FanType.FanOut set (either directly or indirectly).
        Specified by:
        createsDuplicates in interface KeyExpression
        Returns:
        true if this expression can evaluate to multiple values and false otherwise
      • getColumnSize

        public int getColumnSize()
        Description copied from interface: KeyExpression
        Returns the number of items in each KeyValue that will be returned. For key expressions that support KeyExpression.FanType.Concatenate, this will the count of non-nested lists, i.e. this will be value of evaluate(r).get(i).toList().size() for any i or r.
        Specified by:
        getColumnSize in interface KeyExpression
        Returns:
        the number of elements that will be produced for every key
      • planHash

        public int planHash​(@Nonnull
                            PlanHashable.PlanHashKind hashKind)
        Description copied from interface: PlanHashable
        Return a hash similar to hashCode, but with the additional guarantee that is is stable across JVMs.
        Specified by:
        planHash in interface PlanHashable
        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 to hashCode, but with the additional guarantee that is is stable across JVMs.
        Specified by:
        queryHash in interface QueryHashable
        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