spark.timeseries

HourBucketDetector

class HourBucketDetector extends BucketDetector[Array[String]]

Simple class to be used with BucketRDD for detection of buckets from data such as http://www.cs.sandia.gov/~jrstear/logs/ by date and hour.

Usage:

import spark._
import spark.SparkContext._
import spark.timeseries._

val sc = TimeSeriesSpark.init("local[1]", "default")

val file = sc.textFile("fileName")
val mapped = file.map(_.split(" ", 8))

var det = new HourBucketDetector()
val buckets = new BucketRDD(mapped, det)

buckets.cache()

val sizes = buckets.map(_.length).collect()

for(k <- sizes)
  println(k)

See spark.timeseries.BucketLogsByHour for a more real example.

Linear Supertypes
BucketDetector[Array[String]], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. HourBucketDetector
  2. BucketDetector
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HourBucketDetector ()

Value Members

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

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

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  7. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. var date : Int

  9. var debug : Boolean

  10. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  11. def equals (arg0: Any): Boolean

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  14. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  15. var hour : Int

  16. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  17. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  18. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  19. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  20. def reset (): Unit

    Resets the internal variables.

    Resets the internal variables. Called in the beginning of ´compute()´ of the RunRDD.

    Definition Classes
    HourBucketDetectorBucketDetector
  21. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  22. def toString (): String

    Definition Classes
    AnyRef → Any
  23. def update (sample: Array[String]): Boolean

    Updates hour and date and returns true if this sample belongs to a new bucket.

    Updates hour and date and returns true if this sample belongs to a new bucket. For the very first sample, returns false. Returns false in other cases.

    sample

    a single sample of data type T.

    returns

    For the very first sample, returns false. Returns true if this sample belongs to a new bucket. Returns false in other cases.

    Definition Classes
    HourBucketDetectorBucketDetector
  24. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from BucketDetector[Array[String]]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any