From d01971fbaceca2854ba75f0c3784b7fca082d93a Mon Sep 17 00:00:00 2001 From: Franklin Hu Date: Mon, 2 Jul 2012 10:13:11 -0700 Subject: [PATCH] Scribe cleanup * Move scribe reference from ZipkinCollectorConfig to zipkin-scribe * Move scribe categories config to ScribeZipkinCollectorConfig Author: @franklinhu Fixes #55 URL: https://github.com/twitter/zipkin/pull/55 --- .../twitter/zipkin/collector/ScribeCollectorService.scala | 4 ++-- .../twitter/zipkin/config/ScribeCollectorServerConfig.scala | 5 +---- .../twitter/zipkin/config/ScribeZipkinCollectorConfig.scala | 6 +++++- .../com/twitter/zipkin/config/ZipkinCollectorConfig.scala | 2 -- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/zipkin-scribe/src/main/scala/com/twitter/zipkin/collector/ScribeCollectorService.scala b/zipkin-scribe/src/main/scala/com/twitter/zipkin/collector/ScribeCollectorService.scala index 93f43ca3511..294c69fd0e3 100644 --- a/zipkin-scribe/src/main/scala/com/twitter/zipkin/collector/ScribeCollectorService.scala +++ b/zipkin-scribe/src/main/scala/com/twitter/zipkin/collector/ScribeCollectorService.scala @@ -20,14 +20,14 @@ import com.twitter.finagle.zookeeper.ZookeeperServerSetCluster import com.twitter.logging.Logger import com.twitter.ostrich.stats.Stats import com.twitter.util.{FuturePool, Future} -import com.twitter.zipkin.config.ZipkinCollectorConfig +import com.twitter.zipkin.config.ScribeZipkinCollectorConfig import com.twitter.zipkin.gen import org.apache.zookeeper.KeeperException /** * This class implements the log method from the Scribe Thrift interface. */ -class ScribeCollectorService(config: ZipkinCollectorConfig, val writeQueue: WriteQueue[Seq[_ <: String]], categories: Set[String]) +class ScribeCollectorService(config: ScribeZipkinCollectorConfig, val writeQueue: WriteQueue[Seq[_ <: String]], categories: Set[String]) extends gen.ZipkinCollector.FutureIface with CollectorService { private val log = Logger.get diff --git a/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeCollectorServerConfig.scala b/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeCollectorServerConfig.scala index 8b7d7358c90..9a467a33534 100644 --- a/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeCollectorServerConfig.scala +++ b/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeCollectorServerConfig.scala @@ -28,14 +28,11 @@ class ScribeCollectorServerConfig(config: ScribeZipkinCollectorConfig) extends C val log = Logger.get(Logger.getClass) - /* Categories of incoming scribe messages. Let these through, drop any others */ - var categories: Set[String] = Set("zipkin") - def apply(): Server = { log.info("Starting collector service on addr " + config.serverAddr) /* Start the service */ - val service = new ScribeCollectorService(config, config.writeQueue, categories) + val service = new ScribeCollectorService(config, config.writeQueue, config.categories) service.start() ServiceTracker.register(service) diff --git a/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeZipkinCollectorConfig.scala b/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeZipkinCollectorConfig.scala index c9d16dcbcdf..391bc53a42c 100644 --- a/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeZipkinCollectorConfig.scala +++ b/zipkin-scribe/src/main/scala/com/twitter/zipkin/config/ScribeZipkinCollectorConfig.scala @@ -18,11 +18,15 @@ package com.twitter.zipkin.config import com.twitter.zipkin.collector.processor.ScribeProcessorFilter import com.twitter.zipkin.config.collector.CollectorServerConfig -import com.twitter.zipkin.gen trait ScribeZipkinCollectorConfig extends ZipkinCollectorConfig { type T = Seq[String] val serverConfig: CollectorServerConfig = new ScribeCollectorServerConfig(this) + var zkScribePaths: Set[String] = Set("/twitter/scribe/zipkin") + + /* Categories of incoming scribe messages. Let these through, drop any others */ + var categories: Set[String] = Set("zipkin") + def rawDataFilter = new ScribeProcessorFilter } diff --git a/zipkin-server/src/main/scala/com/twitter/zipkin/config/ZipkinCollectorConfig.scala b/zipkin-server/src/main/scala/com/twitter/zipkin/config/ZipkinCollectorConfig.scala index 7d7070f0321..7928592f0c4 100644 --- a/zipkin-server/src/main/scala/com/twitter/zipkin/config/ZipkinCollectorConfig.scala +++ b/zipkin-server/src/main/scala/com/twitter/zipkin/config/ZipkinCollectorConfig.scala @@ -30,7 +30,6 @@ import com.twitter.zk._ import java.net.{InetAddress, InetSocketAddress} import org.apache.zookeeper.ZooDefs.Ids import scala.collection.JavaConverters._ -import scala.collection.Set import com.twitter.zipkin.collector.processor._ import com.twitter.zipkin.common.Span @@ -42,7 +41,6 @@ trait ZipkinCollectorConfig extends ZipkinConfig[ZipkinCollector] { /* ZooKeeper paths */ var zkConfigPath : String = "/twitter/service/zipkin/config" var zkServerSetPath : String = "/twitter/service/zipkin/collector" - var zkScribePaths : Set[String] = Set("/twitter/scribe/zipkin") /* ZooKeeper key for `AdjustableRateConfig`s */ var zkSampleRateKey : String = "samplerate"