mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-27 13:36:03 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
21 lines
777 B
Scala
21 lines
777 B
Scala
package com.twitter.home_mixer.functional_component.side_effect
|
|
|
|
import com.twitter.finagle.mtls.authentication.ServiceIdentifier
|
|
import com.twitter.product_mixer.core.model.common.identifier.CandidatePipelineIdentifier
|
|
import javax.inject.Inject
|
|
import javax.inject.Singleton
|
|
|
|
@Singleton
|
|
case class ServedCandidateKeysKafkaSideEffectBuilder @Inject() (
|
|
injectedServiceIdentifier: ServiceIdentifier) {
|
|
def build(
|
|
sourceIdentifiers: Set[CandidatePipelineIdentifier]
|
|
): ServedCandidateKeysKafkaSideEffect = {
|
|
val topic = injectedServiceIdentifier.environment.toLowerCase match {
|
|
case "prod" => "tq_ct_served_candidate_keys"
|
|
case _ => "tq_ct_served_candidate_keys_staging"
|
|
}
|
|
new ServedCandidateKeysKafkaSideEffect(topic, sourceIdentifiers)
|
|
}
|
|
}
|