com.opendatagroup.hadrian.jvmcompiler

PFAEngineBase

abstract class PFAEngineBase extends AnyRef

Abstract class for interface PFAEngine; defines some functions in the Hadrian JAR so they don't have to be defined in auto-generated Java.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PFAEngineBase
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PFAEngineBase()

Abstract Value Members

  1. abstract def checkClock(): Unit

    Check the clock and raise a PFATimeoutException if a method has taken too long.

    Check the clock and raise a PFATimeoutException if a method has taken too long.

    Called in loops and user-defined functions.

  2. abstract val classLoader: ClassLoader

    ClassLoader in which this scoring engine and its compiled types are compiled.

  3. abstract def getRunlock: AnyRef

    Access to the scoring engine's global lock.

    Access to the scoring engine's global lock.

    Used by snapshot and other methods that need to block changes in the scoring engine.

Concrete 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. var _actionsFinished: Long

  7. var _actionsStarted: Long

  8. var _inputClass: Class[AnyRef]

  9. var _instance: Int

  10. var _metadata: PFAMap[String]

  11. var _outputClass: Class[AnyRef]

  12. def actionsFinished: Long

    The "actionsFinished" symbol, counting the number of times the "action" method has finished without exceptions, which can be accessed within PFA.

  13. def actionsStarted: Long

    The "actionsStarted" symbol, counting the number of times the "action" method has started, which can be accessed within PFA.

  14. def analyzeCell[X](name: String, analysis: (Any) ⇒ X): X

    Perform an analysis of a cell using a user-defined function.

    Perform an analysis of a cell using a user-defined function.

    name

    the name of the cell

    analysis

    a function to perform some analysis of the cell to which it is applied; note that this function must not change the cell's state

    returns

    whatever analysis returns

    Note that the analysis function is called exactly once.

  15. def analyzePool[X](name: String, analysis: (Any) ⇒ X): Map[String, X]

    Perform an analysis of a pool using a user-defined functions.

    Perform an analysis of a pool using a user-defined functions.

    name

    the name of the pool

    analysis

    a function to perform some analysis of each item in the pool; note that this function must not change the pool's state

    returns

    a map from pool item name to whatever analysis returns for that pool item

    Note that the analysis function is called as many times as there are items in the pool.

  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def avroInputIterator[X <: AnyRef](inputStream: InputStream): DataFileStream[X]

    Create an Avro iterator (subclass of java.util.Iterator) over Avro-serialized input data.

    Create an Avro iterator (subclass of java.util.Iterator) over Avro-serialized input data.

    The objects produced by this iterator are suitable inputs to the action method.

    inputStream

    serialized data

    returns

    unserialized data

  18. def avroOutputDataStream(fileName: String): AvroOutputDataStream

    Create an output stream for Avro-serializing scoring engine output.

    Create an output stream for Avro-serializing scoring engine output.

    Return values from the action method (or outputs captured by an emit callback) are suitable for writing to this stream.

    fileName

    the name of a file that will be overwritten by output.

    returns

    an output stream with an append method for appending output data objects and a close method for flushing the buffer and closing the stream.

  19. def avroOutputDataStream(file: File): AvroOutputDataStream

    Create an output stream for Avro-serializing scoring engine output.

    Create an output stream for Avro-serializing scoring engine output.

    Return values from the action method (or outputs captured by an emit callback) are suitable for writing to this stream.

    file

    a file that will be overwritten by output.

    returns

    an output stream with an append method for appending output data objects and a close method for flushing the buffer and closing the stream.

  20. def avroOutputDataStream(outputStream: OutputStream): AvroOutputDataStream

    Create an output stream for Avro-serializing scoring engine output.

    Create an output stream for Avro-serializing scoring engine output.

    Return values from the action method (or outputs captured by an emit callback) are suitable for writing to this stream.

    outputStream

    the raw output stream onto which Avro bytes will be written.

    returns

    an output stream with an append method for appending output data objects and a close method for flushing the buffer and closing the stream.

  21. def callDepth(fcnName: String, exclude: Set[String] = Set[String](), startingDepth: Double = 0): Double

    Determine call depth of a function by traversing the callGraph.

    Determine call depth of a function by traversing the callGraph.

    fcnName

    name of function to look up

    exclude

    set of functions to exclude

    startingDepth

    used by recursion to count

    returns

    integral number representing call depth as a Double, with positive infinity as a possible result

  22. def callGraph: Map[String, Set[String]]

    Graph of which functions can call which other functions in the engine.

    Graph of which functions can call which other functions in the engine.

    Map from function name (special forms in parentheses) to the set of all functions it calls. This map can be traversed as a graph by repeated application.

  23. def calledBy(fcnName: String, exclude: Set[String] = Set[String]()): Set[String]

    Determine which functions are called by fcnName by traversing the callGraph backward.

    Determine which functions are called by fcnName by traversing the callGraph backward.

    fcnName

    name of function to look up

    exclude

    set of functions to exclude

    returns

    set of functions that can call fcnName

  24. val cellsToRollback: Map[String, Field]

    Map from cell name to reflected Java field for the cells that should be rolled back in case of an exception.

  25. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def config: EngineConfig

    Abstract syntax tree that was used to create this engine.

  27. def csvInputIterator[X <: AnyRef](inputStream: InputStream, csvFormat: CSVFormat = CSVFormat.DEFAULT.withHeader()): Iterator[X]

    Create an iterator over CSV-serialized input data.

    Create an iterator over CSV-serialized input data.

    The objects produced by this iterator are suitable inputs to the action method.

    Note that only records of primitives can be read from CSV because of the nature of the CSV format.

    inputStream

    serialized data

    csvFormat

    format description for Apache commons-csv

    returns

    unserialized data

  28. def csvOutputDataStream(outputStream: OutputStream, csvFormat: CSVFormat = ..., writeHeader: Boolean = true): CsvOutputDataStream

    Create an output stream for CSV-serializing scoring engine output.

    Create an output stream for CSV-serializing scoring engine output.

    Return values from the action method (or outputs captured by an emit callback) are suitable for writing to this stream.

    Note that only records of primitives can be written to CSV because of the nature of the CSV format.

    outputStream

    the raw output stream onto which CSV bytes will be written.

    csvFormat

    format description for Apache commons-csv

    writeHeader

    if true, write field names as the first line of the file.

    returns

    an output stream with an append method for appending output data objects and a close method for flushing the buffer and closing the stream.

  29. def datumReader[INPUT <: AnyRef]: DatumReader[INPUT]

    A org.apache.avro.specific.SpecificDatumReader object specialized for this PFAEngine in its personal java.lang.ClassLoader.

  30. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  32. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  33. def fromAvro(avro: Array[Byte], avroType: AvroType): AnyRef

    Convert data from Avro to a live object using this engine's custom classes.

    Convert data from Avro to a live object using this engine's custom classes.

    avro

    Avro data

    avroType

    data type

    returns

    object that can be used in this engine

  34. def fromAvro(avro: Array[Byte], schema: Schema): AnyRef

    Convert data from Avro to a live object using this engine's custom classes.

    Convert data from Avro to a live object using this engine's custom classes.

    avro

    Avro data

    schema

    Avro schema

    returns

    object that can be used in this engine

  35. def fromGenericAvroData[INPUT <: AnyRef](datum: AnyRef): INPUT

    Translate data that might have been deserialized by Avro into objects suitable for this PFAEngine's action.

    Translate data that might have been deserialized by Avro into objects suitable for this PFAEngine's action.

    datum

    objects that may be Avro generic or Avro specific objects (note that Avro specific objects are subclasses of Avro generic objects)

    returns

    objects that can be input for this PFAEngine's action.

  36. def fromJson(json: Array[Byte], avroType: AvroType): AnyRef

    Convert data from JSON to a live object using this engine's custom classes.

    Convert data from JSON to a live object using this engine's custom classes.

    json

    JSON data

    avroType

    data type

    returns

    object that can be used in this engine

  37. def fromJson(json: Array[Byte], schema: Schema): AnyRef

    Convert data from JSON to a live object using this engine's custom classes.

    Convert data from JSON to a live object using this engine's custom classes.

    json

    JSON data

    schema

    Avro schema

    returns

    object that can be used in this engine

  38. def fromPFAData[INPUT <: AnyRef](datum: AnyRef): INPUT

    Translate data that might have come from any PFAEngine class (not necessarily this one) into objects suitable for this PFAEngine's action.

    Translate data that might have come from any PFAEngine class (not necessarily this one) into objects suitable for this PFAEngine's action.

    datum

    objects that may have been output from another type of PFAEngine's action, snapshotCell, or snapshotPool.

    returns

    objects that can be input for this PFAEngine's action.

  39. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  40. def hasRecursive(fcnName: String): Boolean

    Determine if the call depth of a function is infinite.

    Determine if the call depth of a function is infinite.

    fcnName

    name of function to check

    returns

    true if the function can eventually call itself through a function that it calls, false otherwise

  41. def hasSideEffects(fcnName: String): Boolean

    Determine if a function modifies the scoring engine's persistent state.

    Determine if a function modifies the scoring engine's persistent state.

    fcnName

    name of function to check

    returns

    true if the function can eventually call (cell-to) or (pool-to) on any cell or pool.

  42. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  43. def initialize(config: EngineConfig, options: EngineOptions, sharedState: Option[SharedState], thisClass: Class[_], context: Context, index: Int): Unit

    Internally called by a new PFAEngine when it is first created.

    Internally called by a new PFAEngine when it is first created.

    config

    abstract syntax tree representing the contents of the PFA file

    options

    initialization options that will be used to override any found in the PFA file

    sharedState

    optional shared state object used to link scoring engines (can include objects that maintain state through external databases)

    thisClass

    reference to this instance's class, via Java reflection

    context

    context object from the type-checked abstract syntax tree

    index

    instance number to assign

  44. def inputClass: Class[AnyRef]

    Class object for the input type.

  45. def inputType: AvroType

    Get the AvroType of the input.

  46. def instance: Int

    Instance number, non-zero if this engine is part of a collection of scoring engines make from the same PFA file.

  47. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  48. def isRecursive(fcnName: String): Boolean

    Determine if a function is directly recursive.

    Determine if a function is directly recursive.

    fcnName

    name of function to check

    returns

    true if the function directly calls itself, false otherwise

  49. def jsonInput[INPUT <: AnyRef](json: String): INPUT

    Deserialize one JSON datum as suitable input to the action method.

  50. def jsonInput[INPUT <: AnyRef](json: Array[Byte]): INPUT

    Deserialize one JSON datum as suitable input to the action method.

  51. def jsonInputIterator[X <: AnyRef](inputIterator: Iterator[String]): Iterator[X]

    Create an iterator over JSON-serialized input data.

    Create an iterator over JSON-serialized input data.

    The objects produced by this iterator are suitable inputs to the action method.

    returns

    unserialized data

  52. def jsonInputIterator[X <: AnyRef](inputIterator: Iterator[String]): Iterator[X]

    Create an iterator over JSON-serialized input data.

    Create an iterator over JSON-serialized input data.

    The objects produced by this iterator are suitable inputs to the action method.

    returns

    unserialized data

  53. def jsonInputIterator[X <: AnyRef](inputStream: InputStream): Iterator[X]

    Create an iterator over JSON-serialized input data.

    Create an iterator over JSON-serialized input data.

    The objects produced by this iterator are suitable inputs to the action method.

    inputStream

    serialized data

    returns

    unserialized data

  54. def jsonOutput[OUTPUT <: AnyRef](obj: OUTPUT): String

    Serialize one datum from the action method as JSON.

  55. def jsonOutputDataStream(fileName: String, writeSchema: Boolean): JsonOutputDataStream

    Create an output stream for JSON-serializing scoring engine output.

    Create an output stream for JSON-serializing scoring engine output.

    Writes one JSON object per line.

    Return values from the action method (or outputs captured by an emit callback) are suitable for writing to this stream.

    fileName

    the name of a file that will be overwritten by output.

    returns

    an output stream with an append method for appending output data objects and a close method for flushing the buffer and closing the stream.

  56. def jsonOutputDataStream(file: File, writeSchema: Boolean): JsonOutputDataStream

    Create an output stream for JSON-serializing scoring engine output.

    Create an output stream for JSON-serializing scoring engine output.

    Writes one JSON object per line.

    Return values from the action method (or outputs captured by an emit callback) are suitable for writing to this stream.

    file

    a file that will be overwritten by output.

    returns

    an output stream with an append method for appending output data objects and a close method for flushing the buffer and closing the stream.

  57. def jsonOutputDataStream(outputStream: OutputStream, writeSchema: Boolean): JsonOutputDataStream

    Create an output stream for JSON-serializing scoring engine output.

    Create an output stream for JSON-serializing scoring engine output.

    Writes one JSON object per line.

    Return values from the action method (or outputs captured by an emit callback) are suitable for writing to this stream.

    outputStream

    the raw output stream onto which Avro bytes will be written.

    returns

    an output stream with an append method for appending output data objects and a close method for flushing the buffer and closing the stream.

  58. var log: (String, Option[String]) ⇒ Unit

    Externally supplied function for handling log output from PFA.

    Externally supplied function for handling log output from PFA.

    By default, prints to standard out.

    Arguments:

    • String to write to log
    • Some(namespace) for filtering log messages or None
  59. def metadata: PFAMap[String]

    The "metadata" field of the original PFA file as a PFAMap that can be accessed within PFA.

  60. def method: Method

    Report whether this is a PFAMapEngine, PFAEmitEngine, or a PFAFoldEngine

  61. def namedTypes: Map[String, AvroType]

    Get the AvroType of each compiled type.

  62. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  65. def options: EngineOptions

    Implementation-specific configuration options.

  66. def outputClass: Class[AnyRef]

    Class object for the output type.

  67. def outputType: AvroType

    Get the AvroType of the output.

  68. val poolsToRollback: Map[String, Field]

    Map from pool name to reflected Java field for the pools that should be rolled back in case of an exception.

  69. def randomGenerator: Random

    The random number generator used by this particular scoring engine instance.

    The random number generator used by this particular scoring engine instance.

    Note that if a randseed is given in the PFA file but a collection of scoring engines are generated from it, each scoring engine instance will have a different random generator seeded by a different seed.

  70. def revert(sharedState: Option[SharedState]): Unit

    Revert a scoring engine to the state it had when it was first initialized.

    Revert a scoring engine to the state it had when it was first initialized.

    sharedState

    shared state object to use in re-initialization

  71. def revert(): Unit

    Revert a scoring engine to the state it had when it was first initialized.

  72. def rollback(): Unit

    Internally called to actually roll back the state of the scoring engine.

  73. def rollbackSave(): Unit

    Internally called to save the state of some cells and pools so that they can be rolled back in case of an exception.

  74. val savedCells: Map[String, Any]

    Temporary copies of initial cell state for cells to be rolled back.

  75. val savedPools: Map[String, HashMap[String, AnyRef]]

    Temporary copies of initial pool state for cells to be rolled back.

  76. def snapshot(): EngineConfig

    Take a snapshot of the entire scoring engine (all cells and pools) and represent it as an abstract syntax tree that can be used to make new scoring engines.

    Take a snapshot of the entire scoring engine (all cells and pools) and represent it as an abstract syntax tree that can be used to make new scoring engines.

    Note that you can call toJson on the EngineConfig to get a string that can be written to a PFA file.

  77. def snapshotCell(name: String): AnyRef

    Take a snapshot of one cell and represent it using objects specialized to this class (see above).

    Take a snapshot of one cell and represent it using objects specialized to this class (see above).

    name

    the name of the cell

    returns

    an object that may contain internal PFA data, such as instances of classes that are only found in this engine's custom classLoader.

  78. def snapshotPool(name: String): Map[String, AnyRef]

    Take a snapshot of one pool and represent it using objects specialized to this class (see above).

    Take a snapshot of one pool and represent it using objects specialized to this class (see above).

    name

    the name of the pool

    returns

    a Map from pool item name to objects that may contain internal PFA data, such as instances of classes that are only found in this engine's custom classLoader.

  79. val specificData: PFASpecificData

    An org.apache.avro.specific.SpecificData object specialized for this PFAEngine in its personal java.lang.ClassLoader.

  80. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  81. def toAvro(obj: AnyRef, avroType: AvroType): Array[Byte]

    Convert data to Avro.

    Convert data to Avro.

    obj

    object reference

    avroType

    data type

    returns

    Avro bytes

  82. def toAvro(obj: AnyRef, schema: Schema): Array[Byte]

    Convert data to Avro.

    Convert data to Avro.

    obj

    object reference

    schema

    Avro schema

    returns

    Avro bytes

  83. def toJson(obj: AnyRef, avroType: AvroType): String

    Convert data to JSON.

    Convert data to JSON.

    obj

    object reference

    avroType

    data type

    returns

    JSON string

  84. def toJson(obj: AnyRef, schema: Schema): String

    Convert data to JSON.

    Convert data to JSON.

    obj

    object reference

    schema

    Avro schema

    returns

    JSON string

  85. def toString(): String

    Definition Classes
    AnyRef → Any
  86. def typeParser: ForwardDeclarationParser

    The parser used to interpret Avro types in the PFA document, which may be used to find compiled types used by this engine.

  87. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped