com.opendatagroup.hadrian

memory

package memory

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

Type Members

  1. case class CellReport(name: String, shared: Boolean, usage: Usage) extends Product with Serializable

    Represents the memory usage of a cell.

  2. case class EngineReport(engine: PFAEngine[_ <: AnyRef, _ <: AnyRef]) extends Product with Serializable

    Represents the memory usage of a scoring engine's cells and pools (ignoring any double-counting from sharing with other scoring engine instances).

  3. case class EnginesReport(engines: Seq[PFAEngine[_ <: AnyRef, _ <: AnyRef]]) extends Product with Serializable

    Represents the memory usage of a collection of scoring engines, properly accounting for cells and pools that are shared among the instances.

  4. trait MemoryUnit extends AnyRef

    Abstract trait for all memory units.

  5. case class PoolReport(name: String, shared: Boolean, usage: Usage, items: Int) extends Product with Serializable

    Represents the memory usage of a pool.

  6. case class Usage(bytes: Long, exact: Boolean = true) extends Product with Serializable

    Represents memory usage of an item as a quantity with units and exactness flag.

Value Members

  1. object B extends MemoryUnit

    MemoryUnit for bytes.

  2. object GB extends MemoryUnit

    MemoryUnit for gigabytes.

  3. object KB extends MemoryUnit

    MemoryUnit for kilobytes.

  4. object MB extends MemoryUnit

    MemoryUnit for megabytes.

  5. object TB extends MemoryUnit

    MemoryUnit for terabytes.

  6. def bestUnit(bytes: Long): MemoryUnit

    Finds the best unit of measure: the largest unit for which the amount is greater than 1.

    Finds the best unit of measure: the largest unit for which the amount is greater than 1.0, if bytes is positive.

  7. def compute(avroType: AvroType, instance: Any): Usage

    Compute the memory usage for an instance of a given avroType.

    Compute the memory usage for an instance of a given avroType.

    This method can be much slower than compute(avroType).

    This function will first attempt to compute(avroType) (without instance) and only revert to a general computation if needed.

    Memory usage for the following types are computed exactly:

    • any that can be computed from avroType alone
    • "bytes"
    • "string"
    • "record" if all fields can be computed exactly
    • "union" if this instance can be computed exactly

    Memory usage for the following types are estimated with polynomials:

    • "array" (which is a Scala Vector, ultimately a tree structure whose balancing depends on a complex algorithm)
    • "map" (which is a Scala Map, ultimately a tree structure whose balancing depends on a complex algorithm)
    • "record" if any field is approximate
    • "union" if this instance is approximate

    Primitives are assumed to be boxed unless they are found in records, in which case they are unboxed.

    avroType

    the type of the instance to estimate

    instance

    the particular instance to estimate

    returns

    a Usage object (no Option)

  8. def compute(avroType: AvroType): Option[Usage]

    Compute the memory usage for a given avroType if that usage can be determined without reference to a particular instance.

    Compute the memory usage for a given avroType if that usage can be determined without reference to a particular instance.

    This method can be much faster than compute(avroType, instance).

    The following types can be computed from an avroType alone:

    • "null"
    • "boolean"
    • "int"
    • "long"
    • "float"
    • "double"
    • "fixed"
    • "enum"
    • "record" if all fields can be computed from an avroType alone.

    The following cannot:

    • "bytes" (requires length of byte array)
    • "string" (requires length of string)
    • "array" (requires length of array)
    • "map" (requires length of map)
    • "record" if some fields cannot be computed from an avroType alone
    • "union" (if the union consists of alternatives that are all the same size, it could be computed from the avroType alone, but this case is not handled)

    Primitives are assumed to be boxed unless they are found in records, in which case they are unboxed.

    avroType

    the type to estimate

    returns

    Some(usage) if the usage can be calculated without reference to a particular instance; None otherwise.

Inherited from AnyRef

Inherited from Any

Ungrouped