mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 08:48:46 +02:00
617c8c787d
Unified User Action (UUA) is a centralized, real-time stream of user actions on Twitter, consumed by various product, ML, and marketing teams. UUA makes sure all internal teams consume the uniformed user actions data in an accurate and fast way.
20 lines
754 B
Scala
20 lines
754 B
Scala
package com.twitter.unified_user_actions.adapter
|
|
|
|
import com.twitter.finagle.stats.NullStatsReceiver
|
|
import com.twitter.finagle.stats.StatsReceiver
|
|
|
|
trait AbstractAdapter[INPUT, OUTK, OUTV] extends Serializable {
|
|
|
|
/**
|
|
* The basic input -> seq[output] adapter which concrete adapters should extend from
|
|
* @param input a single INPUT
|
|
* @return A list of (OUTK, OUTV) tuple. The OUTK is the output key mainly for publishing to Kafka (or Pubsub).
|
|
* If other processing, e.g. offline batch processing, doesn't require the output key then it can drop it
|
|
* like source.adaptOneToKeyedMany.map(_._2)
|
|
*/
|
|
def adaptOneToKeyedMany(
|
|
input: INPUT,
|
|
statsReceiver: StatsReceiver = NullStatsReceiver
|
|
): Seq[(OUTK, OUTV)]
|
|
}
|