com.eharmony.aloha.semantics.compiled.compiler

TwitterEvalCompiler

case class TwitterEvalCompiler(threadingModel: EvalThreadingModel = SingleThreadedEval, classCacheDir: Option[File] = scala.None, imports: Seq[String] = immutable.this.Nil) extends ContainerReadableByString[Try] with Logging with Product with Serializable

Compiles code using Twitter's Eval class from util-eval, wrapping the attempt in a Try.

NOTE: while thread local is a good idea for multi-threading purposes (creates one compiler per thread), one needs to be careful about the number of threads interacting with the compiler. This is true for two reasons: 1 Creation time for compiler instance takes a while. 1 compiler instances are big (translation, many threads + thread local == java.lang.OutOfMemoryError).

Because the critical sections of the compile function of the StringCompiler.apply(*,*,*) function called by Eval.applyProcessed(*,*,*) are synchronized, we shouldn't need to worry about thread-safety. For more information, see Eval on github.

threadingModel

a threading model used for compilation.

classCacheDir

Directory where generated class files should be stored.

imports

import statements.

Annotations
@throws( ... )
Linear Supertypes
Serializable, Serializable, Product, Equals, Logging, ContainerReadableByString[Try], ContainerReadableCommon[Try], ContainerReadable[Try], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TwitterEvalCompiler
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Logging
  7. ContainerReadableByString
  8. ContainerReadableCommon
  9. ContainerReadable
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TwitterEvalCompiler(classCacheDir: File)

    Java 1-param constructor specifying a class file caching directory.

    Java 1-param constructor specifying a class file caching directory.

    classCacheDir

    Location to cache generated class files.

    returns

  2. new TwitterEvalCompiler()

    Java 0-param constructor.

    Java 0-param constructor.

    returns

  3. new TwitterEvalCompiler(threadingModel: EvalThreadingModel = SingleThreadedEval, classCacheDir: Option[File] = scala.None, imports: Seq[String] = immutable.this.Nil)

    threadingModel

    a threading model used for compilation.

    classCacheDir

    Directory where generated class files should be stored.

    imports

    import statements.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. val classCacheDir: Option[File]

    Directory where generated class files should be stored.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def debug(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a debug logging message, with an exception.

    Issue a debug logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  10. final def debug(msg: ⇒ Any): Unit

    Issue a debug logging message.

    Issue a debug logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. final def error(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a error logging message, with an exception.

    Issue a error logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  13. final def error(msg: ⇒ Any): Unit

    Issue a error logging message.

    Issue a error logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def fromClasspathResource[A](r: String): Try[A]

    Read from a classpath resource.

    Read from a classpath resource. This uses fromFileObject under the hood.

    r

    a resource path

    returns

    Definition Classes
    ContainerReadableCommonContainerReadable
  16. def fromFile[A](f: File): Try[A]

    Read from a File.

    Read from a File.

    f

    a File to read. The File's InputStream is automatically closed.

    returns

    the result

    Definition Classes
    ContainerReadableCommonContainerReadable
  17. def fromInputStream[A](is: InputStream): Try[A]

    Read from an InputStream.

    Read from an InputStream.

    is

    an InputStream to read. The InputStream is automatically closed.

    returns

    the result

    Definition Classes
    ContainerReadableByStringContainerReadable
  18. def fromReader[A](r: Reader): Try[A]

    Read from a Reader.

    Read from a Reader. Whoever extends this trait is responsible for closing the Reader.

    r

    a Reader containing data to be read.

    returns

    the result

    Definition Classes
    ContainerReadableByStringContainerReadable
  19. def fromResource[A](r: String): Try[A]

    Read from a resource.

    Read from a resource. This uses fromFileObject under the hood.

    r

    a resource path

    returns

    Definition Classes
    ContainerReadableCommonContainerReadable
  20. def fromString[A](code: String): Try[A]

    Compile s into an instance of A.

    Compile s into an instance of A. If classCacheDir

    A

    the type of object to be generated

    code

    a string representing the to compile.

    returns

    Definition Classes
    TwitterEvalCompilerContainerReadable
  21. def fromUrl[A](u: URL): Try[A]

    Read from a URL.

    Read from a URL.

    u

    a URL to read. The URL's InputStream is automatically closed.

    returns

    the result

    Definition Classes
    ContainerReadableCommonContainerReadable
  22. def fromVfs1[A](foVfs1: FileObject): Try[A]

    Read from an Apache VFS v1 FileObject.

    Read from an Apache VFS v1 FileObject.

    foVfs1

    an Apache VFS v1 FileObject to read. The FileObject's InputStream is automatically closed.

    returns

    the result

    Definition Classes
    ContainerReadableCommonContainerReadable
  23. def fromVfs2[A](foVfs2: FileObject): Try[A]

    Read from an Apache VFS v1 FileObject.

    Read from an Apache VFS v1 FileObject.

    foVfs2

    an Apache VFS v1 FileObject to read. The FileObject's InputStream is automatically closed.

    returns

    the result

    Definition Classes
    ContainerReadableCommonContainerReadable
  24. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  25. val imports: Seq[String]

    import statements.

  26. final def info(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a info logging message, with an exception.

    Issue a info logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  27. final def info(msg: ⇒ Any): Unit

    Issue a info logging message.

    Issue a info logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging
  28. val inputCharset: String

    The character set that is used to decode the input streams in fromInputStream in the derived classes.

    The character set that is used to decode the input streams in fromInputStream in the derived classes.

    Attributes
    protected
    Definition Classes
    ContainerReadableCommon
  29. final def isDebugEnabled: Boolean

    Determine whether debug logging is enabled.

    Determine whether debug logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  30. final def isErrorEnabled: Boolean

    Determine whether error logging is enabled.

    Determine whether error logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  31. final def isInfoEnabled: Boolean

    Determine whether info logging is enabled.

    Determine whether info logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  32. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  33. final def isTraceEnabled: Boolean

    Determine whether trace logging is enabled.

    Determine whether trace logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  34. final def isWarnEnabled: Boolean

    Determine whether warn logging is enabled.

    Determine whether warn logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  35. final lazy val logger: Logger

    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.

    Attributes
    protected[this]
    Definition Classes
    Logging
  36. def loggerInitName(): String

    The name with which the logger is initialized.

    The name with which the logger is initialized. This can be overridden in a derived class.

    returns

    Attributes
    protected
    Definition Classes
    Logging
  37. final def loggerName: String

    Get the name associated with this logger.

    Get the name associated with this logger.

    returns

    the name.

    Attributes
    protected[this]
    Definition Classes
    Logging
  38. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  42. val threadingModel: EvalThreadingModel

    a threading model used for compilation.

  43. final def trace(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a trace logging message, with an exception.

    Issue a trace logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  44. final def trace(msg: ⇒ Any): Unit

    Issue a trace logging message.

    Issue a trace logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging
  45. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def warn(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a warn logging message, with an exception.

    Issue a warn logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  49. final def warn(msg: ⇒ Any): Unit

    Issue a warn logging message.

    Issue a warn logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Logging

Inherited from ContainerReadableByString[Try]

Inherited from ContainerReadableCommon[Try]

Inherited from ContainerReadable[Try]

Inherited from AnyRef

Inherited from Any

Ungrouped