Skip to content

Commit

Permalink
move config traits to their own files
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanking committed Jun 30, 2011
1 parent 6a93de1 commit 21e4444
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
@@ -0,0 +1,9 @@
package com.twitter.service.snowflake

trait ReporterConfig {
val scribeCategory: String
val scribeHost: String
val scribePort: Int
val scribeSocketTimeout: Int
val flushQueueLimit: Int
}
23 changes: 23 additions & 0 deletions src/main/scala/com/twitter/service/snowflake/SnowflakeConfig.scala
@@ -0,0 +1,23 @@
package com.twitter.service.snowflake

import com.twitter.ostrich.admin.RuntimeEnvironment
import com.twitter.ostrich.admin.config.ServerConfig

trait SnowflakeConfig extends ServerConfig[SnowflakeServer] {
val serverPort: Int
val datacenterId: Int
val workerId: Int
val adminPort: Int
val adminBacklog: Int
val workerIdZkPath: String
val zkHostlist: String
val skipSanityChecks: Boolean
val startupSleepMs: Int
val thriftServerThreads: Int

val reporterConfig: ReporterConfig

def apply(runtime: RuntimeEnvironment) = {
new SnowflakeServer(this)
}
}
26 changes: 0 additions & 26 deletions src/main/scala/com/twitter/service/snowflake/SnowflakeServer.scala
Expand Up @@ -22,32 +22,6 @@ import com.twitter.ostrich.admin.Service
import com.twitter.logging.Logger
import com.twitter.logging.config.LoggerConfig

trait ReporterConfig {
val scribeCategory: String
val scribeHost: String
val scribePort: Int
val scribeSocketTimeout: Int
val flushQueueLimit: Int
}

trait SnowflakeConfig extends ServerConfig[SnowflakeServer] {
val serverPort: Int
val datacenterId: Int
val workerId: Int
val adminPort: Int
val adminBacklog: Int
val workerIdZkPath: String
val zkHostlist: String
val skipSanityChecks: Boolean
val startupSleepMs: Int
val thriftServerThreads: Int

val reporterConfig: ReporterConfig

def apply(runtime: RuntimeEnvironment) = {
new SnowflakeServer(this)
}
}

case class Peer(hostname: String, port: Int)

Expand Down

0 comments on commit 21e4444

Please sign in to comment.