mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 08:48:46 +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.
46 lines
1.5 KiB
Scala
46 lines
1.5 KiB
Scala
package com.twitter.simclusters_v2.hdfs_sources.injections
|
|
|
|
import com.twitter.hermit.candidate.thriftscala.Candidates
|
|
import com.twitter.scalding_internal.multiformat.format.keyval.KeyValInjection
|
|
import com.twitter.scalding_internal.multiformat.format.keyval.KeyValInjection.{
|
|
Long2BigEndian,
|
|
ScalaBinaryThrift,
|
|
ScalaCompactThrift
|
|
}
|
|
import com.twitter.simclusters_v2.thriftscala.{
|
|
PersistedFullClusterId,
|
|
SimClustersEmbedding,
|
|
SimClustersEmbeddingId,
|
|
TopProducersWithScore,
|
|
TopSimClustersWithScore
|
|
}
|
|
|
|
object ProducerEmbeddingsInjections {
|
|
final val ProducerTopKSimClusterEmbeddingsInjection: KeyValInjection[
|
|
Long,
|
|
TopSimClustersWithScore
|
|
] =
|
|
KeyValInjection(
|
|
keyCodec = Long2BigEndian,
|
|
valueCodec = ScalaCompactThrift(TopSimClustersWithScore))
|
|
|
|
final val SimClusterEmbeddingTopKProducersInjection: KeyValInjection[
|
|
PersistedFullClusterId,
|
|
TopProducersWithScore
|
|
] =
|
|
KeyValInjection(
|
|
keyCodec = ScalaCompactThrift(PersistedFullClusterId),
|
|
valueCodec = ScalaCompactThrift(TopProducersWithScore))
|
|
|
|
final val SimilarUsersInjection: KeyValInjection[Long, Candidates] =
|
|
KeyValInjection(keyCodec = Long2BigEndian, valueCodec = ScalaCompactThrift(Candidates))
|
|
|
|
final val ProducerSimClustersEmbeddingInjection: KeyValInjection[
|
|
SimClustersEmbeddingId,
|
|
SimClustersEmbedding
|
|
] =
|
|
KeyValInjection(
|
|
keyCodec = ScalaBinaryThrift(SimClustersEmbeddingId),
|
|
valueCodec = ScalaBinaryThrift(SimClustersEmbedding))
|
|
}
|