Created
December 4, 2014 16:23
-
-
Save jamescway/f7c8a9e7cb1ce4c8458b to your computer and use it in GitHub Desktop.
kafkaReceiver put into main.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.twitter.zipkin.gen.{Span => ThriftSpan} | |
import com.twitter.finagle.stats.StatsReceiver | |
import com.twitter.server.TwitterServer | |
import com.twitter.util.{Await, Future} | |
import com.twitter.zipkin.cassandra.CassieSpanStoreFactory | |
import com.twitter.zipkin.collector.{SpanReceiver, ZipkinQueuedCollectorFactory} | |
import com.twitter.zipkin.common._ | |
import com.twitter.zipkin.receiver.kafka.KafkaSpanReceiverFactory | |
import com.twitter.zipkin.storage.WriteSpanStore | |
import com.twitter.zipkin.zookeeper.ZooKeeperClientFactory | |
import kafka.serializer.Decoder | |
// JW: added this | |
import com.twitter.zipkin.receiver.kafka.MyDecoder | |
object ZipkinKafkaCollectorServer extends TwitterServer | |
with ZipkinQueuedCollectorFactory | |
with CassieSpanStoreFactory | |
with ZooKeeperClientFactory | |
with KafkaSpanReceiverFactory | |
{ | |
def newReceiver(receive: Seq[ThriftSpan] => Future[Unit], stats: StatsReceiver): SpanReceiver = | |
newKafkaSpanReceiver(receive, stats.scope("kafkaSpanReceiver"), new MyDecoder()) | |
def newSpanStore(stats: StatsReceiver): WriteSpanStore = | |
newCassandraStore(stats.scope("cassie")) | |
def main() { | |
val collector = newCollector(statsReceiver) | |
onExit { collector.close() } | |
Await.ready(collector) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment