com.eharmony.aloha.semantics.compiled
A java (Spring) friendly constructor.
A java (Spring) friendly constructor.
a compiler capable of compiling real scala code and generating real instances that work at full speed.
a plugin that can make sense of the variable specifications and generate code to extract data from them.
an array of imports. Will be cloned before being stored to avoid caller changing array values.
an execution context in which to run the Futures that are used in the cache.
A java (Spring) friendly constructor.
A java (Spring) friendly constructor.
a compiler capable of compiling real scala code and generating real instances that work at full speed.
a plugin that can make sense of the variable specifications and generate code to extract data from them.
an array of imports. Will be cloned before being stored to avoid caller changing array values.
whether we should provide com.eharmony.aloha.semantics.SemanticsUdfException instead of raw exceptions in the case that a feature produces an exception. The perceived benefit of this seems to drastically outweigh the performance hit, so this defaults to true (as this is suggested).
an execution context in which to run the Futures that are used in the cache.
a compiler capable of compiling real scala code and generating real instances that work at full speed.
a plugin that can make sense of the variable specifications and generate code to extract data from them.
a list of imports.
whether we should provide com.eharmony.aloha.semantics.SemanticsUdfException instead of raw exceptions in the case that a feature produces an exception. The perceived benefit of this seems to drastically outweigh the performance hit, so this defaults to true (as this is suggested).
an execution context in which to run the Futures that are used in the cache.
Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)
Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)
Returns the string representations of all of the data "variables" used by functions created from this Semantics object.
Returns the string representations of all of the data "variables" used by functions created from this Semantics object.
a compiler capable of compiling real scala code and generating real instances that work at full speed.
a compiler capable of compiling real scala code and generating real instances that work at full speed.
Create a function from A to B.
Create a function from A to B. If provideSemanticsUdfException is false or the generated function is is com.eharmony.aloha.semantics.func.EnrichedErrorGenAggFunc return the function; otherwise, return the function wrapped in an com.eharmony.aloha.semantics.func.EnrichedErrorGenAggFunc. com.eharmony.aloha.semantics.func.GenAggFunc produced by the underlying semantics.
The return type of the function.
specification for a function to be produced by this semantics.
a default value in the case that the function would produce an optional type.
Issue a debug logging message, with an exception.
Issue a debug logging message, with an exception.
the message object. toString()
is called to convert it
to a loggable string.
the exception to include with the logged message.
Issue a debug logging message.
Issue a debug logging message.
the message object. toString()
is called to convert it
to a loggable string.
an execution context in which to run the Futures that are used in the cache.
an execution context in which to run the Futures that are used in the cache.
Issue a error logging message, with an exception.
Issue a error logging message, with an exception.
the message object. toString()
is called to convert it
to a loggable string.
the exception to include with the logged message.
Issue a error logging message.
Issue a error logging message.
the message object. toString()
is called to convert it
to a loggable string.
a list of imports.
a list of imports.
Issue a info logging message, with an exception.
Issue a info logging message, with an exception.
the message object. toString()
is called to convert it
to a loggable string.
the exception to include with the logged message.
Issue a info logging message.
Issue a info logging message.
the message object. toString()
is called to convert it
to a loggable string.
Determine whether debug logging is enabled.
Determine whether debug logging is enabled.
Determine whether error logging is enabled.
Determine whether error logging is enabled.
Determine whether info logging is enabled.
Determine whether info logging is enabled.
Determine whether trace logging is enabled.
Determine whether trace logging is enabled.
Determine whether warn logging is enabled.
Determine whether warn logging is enabled.
The logger is a @transient lazy val
to enable proper working with Spark.
The logger is a @transient lazy val
to enable proper working with Spark.
The logger will not be serialized with the rest of the class with which this
trait is mixed-in.
The name with which the logger is initialized.
The name with which the logger is initialized. This can be overridden in a derived class.
Get the name associated with this logger.
Get the name associated with this logger.
the name.
Like l.map(f).sequence[({type L[+A] = Either[Seq[String], A]})#L, C ] in scalaz except that it short circuits if it finds an error.
Like l.map(f).sequence[({type L[+A] = Either[Seq[String], A]})#L, C ] in scalaz except that it short circuits if it finds an error. (There must be some better way to do this w/ scalaz).
If we put a println("folding") at the top of the inner function h, we would get the following:
scala> mapSeq(Left(Seq("1")) +: (2 to 3).map(Right(_)))(identity) // Only 1 "folding" instead of 3. folding res0: ENS[Seq[Int]] = Left(List(0)) scala> mapSeq((1 to 3).map(Right(_)))(identity) folding folding folding res1: ENS[Seq[Int]] = Right(List(1, 2, 3))
type of values in the input sequence in the first parameter list.
type of values in the output sequence if successful.
list of values to which f should be applied.
function to map over l
Attempt to create a new CompiledSemantics with a different type parameter.
Attempt to create a new CompiledSemantics with a different type parameter.
input type for the new MorphableSemantics instance that might be created.
A MorphableSemantics instance may choose not allow morphing to all B
.
In that case, a None
will be returned.
reflection information that may be necessary to determine whether to create the MorphableSemantics that was requested.
a plugin that can make sense of the variable specifications and generate code to extract data from them.
a plugin that can make sense of the variable specifications and generate code to extract data from them.
whether we should provide com.eharmony.aloha.semantics.SemanticsUdfException instead of raw exceptions in the case that a feature produces an exception.
whether we should provide com.eharmony.aloha.semantics.SemanticsUdfException instead of raw exceptions in the case that a feature produces an exception. The perceived benefit of this seems to drastically outweigh the performance hit, so this defaults to true (as this is suggested).
a com.eharmony.aloha.reflect.RefInfo for input type A.
Generated code will only be retained in the Generated code when debug logging is enabled.
Generated code will only be retained in the Generated code when debug logging is enabled.
Issue a trace logging message, with an exception.
Issue a trace logging message, with an exception.
the message object. toString()
is called to convert it
to a loggable string.
the exception to include with the logged message.
Issue a trace logging message.
Issue a trace logging message.
the message object. toString()
is called to convert it
to a loggable string.
Issue a warn logging message, with an exception.
Issue a warn logging message, with an exception.
the message object. toString()
is called to convert it
to a loggable string.
the exception to include with the logged message.
Issue a warn logging message.
Issue a warn logging message.
the message object. toString()
is called to convert it
to a loggable string.
A semantics that can interpret complicated expressions by compiling the expressions. This semantics constructs actual working scala code (see the format below).
Notice from the code that is constructed that it calls a function in com.eharmony.aloha.semantics.func.GenFunc. The function that is called is based on the input arity. Aside from the f0 function, fi has i arguments in the first argument list and two arguments in the second argument list. The first argument list represents the definition of the accessor functions. These are the functions created to extract data from the domain object. com.eharmony.aloha.semantics.compiled.CompiledSemanticsPlugin objects are responsible for constructing the function bodies. For instance,
(_:Map[String, Long]).get("user.match.TaxBrackets")
in the first example. The CompiledSemantics class is responsible for wrapping this code appropriately, constructing the aggregation function and finally putting everything together and compiling it.Examples
E.g. 1: Two variables are both optional (not necessarily in the input type passed to the model): - user.match.TaxBrackets - cand.taxBracket
E.g. 2: Two variables (one required, one optional): - user.inboundComm (required) - user.pageViews (optional)
E.g. 3: Three required variables (one, two, three):
E.g. 4: Invariant function (not dependent on any input variables).
the input type to the functions that are to be generated. Said another way, this is domain type of the models that will be generated by the ModelFactory to which this com.eharmony.aloha.semantics.Semantics will be passed.
a compiler capable of compiling real scala code and generating real instances that work at full speed.
a plugin that can make sense of the variable specifications and generate code to extract data from them.
a list of imports.
whether we should provide com.eharmony.aloha.semantics.SemanticsUdfException instead of raw exceptions in the case that a feature produces an exception. The perceived benefit of this seems to drastically outweigh the performance hit, so this defaults to true (as this is suggested).
an execution context in which to run the Futures that are used in the cache.