This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[split] refactoring snowflake configs to make it easier for release t…
…o deploy to smfd Mostly just yak-factoring to make configs easier to manage (and be more validated). - another config refactor - refactor to put the worker ids in the config file - validate configs in snowflake-twitter - validate snowflake configs when testing - comment out this test that requires a server. let us find a better way to test this - take zookeeper out of libs - switch scala-zookeeper-config to a project dependency
- Loading branch information
Ryan King
committed
Nov 14, 2011
1 parent
085fb4d
commit 6d4634a
Showing
11 changed files
with
192 additions
and
128 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import com.twitter.service.snowflake.{SnowflakeConfig, ReporterConfig} | ||
import com.twitter.zookeeper.ZookeeperClientConfig | ||
import java.net.InetAddress | ||
|
||
new SnowflakeConfig { | ||
val serverPort = 7609 | ||
val datacenterId = 0 | ||
val workerId = 0 | ||
val adminPort = 9990 | ||
val adminBacklog = 100 | ||
val workerIdZkPath = "/snowflake-servers" | ||
val zkHostlist = "localhost" | ||
val skipSanityChecks = false | ||
val startupSleepMs = 10000 | ||
val thriftServerThreads = 2 | ||
serverPort = 7609 | ||
datacenterId = 0 | ||
workerIdMap = Map(0 -> InetAddress.getLocalHost.getHostName) | ||
adminPort = 9990 | ||
adminBacklog = 100 | ||
workerIdZkPath = "/snowflake-servers" | ||
skipSanityChecks = false | ||
startupSleepMs = 10000 | ||
thriftServerThreads = 2 | ||
|
||
val reporterConfig = new ReporterConfig { | ||
val scribeCategory = "snowflake" | ||
val scribeHost = "localhost" | ||
val scribePort = 1463 | ||
val scribeSocketTimeout = 5000 | ||
val flushQueueLimit = 100000 | ||
zookeeperClientConfig = new ZookeeperClientConfig { | ||
hostList = "localhost" | ||
} | ||
|
||
reporterConfig = new ReporterConfig { | ||
flushQueueLimit = 100000 | ||
} | ||
} |
Binary file not shown.
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
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
18 changes: 12 additions & 6 deletions
18
src/main/scala/com/twitter/service/snowflake/ReporterConfig.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
package com.twitter.service.snowflake | ||
|
||
trait ReporterConfig { | ||
val scribeCategory: String | ||
val scribeHost: String | ||
val scribePort: Int | ||
val scribeSocketTimeout: Int | ||
val flushQueueLimit: Int | ||
import com.twitter.util.Config | ||
|
||
trait ReporterConfig extends Config[Reporter] { | ||
var scribeCategory = "snowflake" | ||
var scribeHost = "localhost" | ||
var scribePort = 1463 | ||
var scribeSocketTimeout = 5000 | ||
var flushQueueLimit = 100000 | ||
|
||
def apply = { | ||
new Reporter(scribeCategory, scribeHost, scribePort, scribeSocketTimeout, flushQueueLimit) | ||
} | ||
} |
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
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
Oops, something went wrong.