Class

com.twitter.finatra.kafkastreams.dsl.FinatraDslSampling

FinatraKeyValueStream

Related Doc: package FinatraDslSampling

Permalink

implicit class FinatraKeyValueStream[K, V] extends AnyRef

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FinatraKeyValueStream
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FinatraKeyValueStream(inner: KStream[K, V])(implicit arg0: ClassTag[K])

    Permalink

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. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  15. def sample[SampleKey, SampleValue](toSampleKey: (K, V) ⇒ SampleKey, toSampleValue: (K, V) ⇒ SampleValue, sampleSize: Int, expirationTime: Option[Duration], sampleName: String, sampleKeySerde: Serde[SampleKey], sampleValueSerde: Serde[SampleValue])(implicit arg0: ClassTag[SampleKey], arg1: ClassTag[SampleValue]): KStream[SampleKey, SampleValue]

    Permalink

    Counts and samples an attribute of a stream of records.

    Counts and samples an attribute of a stream of records.

    This transformer uses two state stores:

    numCountsStore is a KeyValueStore[SampleKey, Long] which stores a SampleKey and the total number of times that SampleKey was seen.

    sampleStore is a KeyValueStore[IndexedSampleKey[SampleKey], SampleValue] which stores the samples themselves. The Key is an IndexedSampleKey, which is your sample key wrapped with an index of 0..sampleSize. The value is the SampleValue that you want to sample.

    Example: if you had a stream of Interaction(engagingUserId, engagementType) and you wanted a sample of users who performed each engagement type, then your sampleKey would be engagementType and your sampleValue would be userId.

    Incoming stream: (engagingUserId = 12, engagementType = Displayed) (engagingUserId = 100, engagementType = Favorited) (engagingUserId = 101, engagementType = Favorited) (engagingUserId = 12, engagementType = Favorited)

    This is what the numCountStore table would look like: Sample Key is EngagementType,

    |-----------|-------| | SampleKey | Count | |-----------|-------| | Displayed | 1 | | Favorited | 3 | |-----------|-------|

    This is what the sampleStore table would look like: SampleKey is EngagementType SampleValue is engaging user id

    |-----------------------------|-------------| | IndexedSampleKey[SampleKey] | SampleValue | |-----------------------------|-------------| | (Displayed, index = 0) | 12 | | (Favorited, index = 0) | 100 | | (Favorited, index = 1) | 101 | | (Favorited, index = 2) | 102 | |-----------------------------|-------------|

    If you want to reference the sample store(so that you can query it) the name of the store can be found by calling SamplingUtils.getSampleStoreName(sampleName. You can reference the name of the count store by calling SamplingUtils.getNumCountsStoreName(sampleName)

    *Note* This method will create the state stores for you.

    SampleValue

    the type of the SampleVaule

    toSampleKey

    returns the key of the sample

    toSampleValue

    returns the type that you want to sample

    sampleSize

    the size of the sample

    expirationTime

    the amount of time after creation that a sample should be expired

    sampleName

    the name of the sample

    sampleKeySerde

    the serde for the SampleKey

    sampleValueSerde

    the serde for the SampleValue

    returns

    a stream of SampleKey and SampleValue

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

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped