Class

com.eharmony.aloha.semantics.compiled.compiler

TwitterEvalCompiler

Related Doc: package compiler

Permalink

case class TwitterEvalCompiler(threadingModel: EvalThreadingModel = SingleThreadedEval, classCacheDir: Option[File] = None, imports: Seq[String] = 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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TwitterEvalCompiler(classCacheDir: File)

    Permalink

    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.

  2. new TwitterEvalCompiler()

    Permalink

    Java 0-param constructor.

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

    Permalink

    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: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val classCacheDir: Option[File]

    Permalink

    Directory where generated class files should be stored.

  6. def clone(): AnyRef

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

    Permalink

    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
  8. final def debug(msg: ⇒ Any): Unit

    Permalink

    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
  9. final def eq(arg0: AnyRef): Boolean

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

    Permalink

    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
  11. final def error(msg: ⇒ Any): Unit

    Permalink

    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
  12. def finalize(): Unit

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

    Permalink

    Read from a classpath resource.

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

    r

    a resource path

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

    Permalink

    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
  15. def fromInputStream[A](is: InputStream): Try[A]

    Permalink

    Read from an InputStream.

    Read from an InputStream.

    is

    an InputStream to read. The InputStream is automatically closed.

    returns

    the result

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

    Permalink

    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
  17. def fromResource[A](r: String): Try[A]

    Permalink

    Read from a resource.

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

    r

    a resource path

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

    Permalink

    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.

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

    Permalink

    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
  20. def fromVfs1[A](foVfs1: FileObject): Try[A]

    Permalink

    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
  21. def fromVfs2[A](foVfs2: FileObject): Try[A]

    Permalink

    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
  22. final def getClass(): Class[_]

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

    Permalink

    import statements.

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

    Permalink

    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
  25. final def info(msg: ⇒ Any): Unit

    Permalink

    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
  26. val inputCharset: String

    Permalink

    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
  27. final def isDebugEnabled: Boolean

    Permalink

    Determine whether debug logging is enabled.

    Determine whether debug logging is enabled.

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

    Permalink

    Determine whether error logging is enabled.

    Determine whether error logging is enabled.

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

    Permalink

    Determine whether info logging is enabled.

    Determine whether info logging is enabled.

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

    Permalink
    Definition Classes
    Any
  31. final def isTraceEnabled: Boolean

    Permalink

    Determine whether trace logging is enabled.

    Determine whether trace logging is enabled.

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

    Permalink

    Determine whether warn logging is enabled.

    Determine whether warn logging is enabled.

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

    Permalink

    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
  34. def loggerInitName(): String

    Permalink

    The name with which the logger is initialized.

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

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

    Permalink

    Get the name associated with this logger.

    Get the name associated with this logger.

    returns

    the name.

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

    Permalink
    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  40. val threadingModel: EvalThreadingModel

    Permalink

    a threading model used for compilation.

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

    Permalink

    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
  42. final def trace(msg: ⇒ Any): Unit

    Permalink

    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
  43. final def wait(): Unit

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

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

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

    Permalink

    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
  47. final def warn(msg: ⇒ Any): Unit

    Permalink

    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