Skip to content

Commit

Permalink
Scribe cleanup
Browse files Browse the repository at this point in the history
* Move scribe reference from ZipkinCollectorConfig to zipkin-scribe
* Move scribe categories config to ScribeZipkinCollectorConfig

Author: @franklinhu
Fixes #55
URL: #55
  • Loading branch information
Franklin Hu committed Jul 2, 2012
1 parent fad482d commit d01971f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit d01971f

Please sign in to comment.