Permalink
Browse files

tests pass

  • Loading branch information...
1 parent d9d6661 commit 36e5c37461fdd39d617859f9fe13dc4458d142b3 @freels freels committed Apr 12, 2011
View
@@ -1,157 +0,0 @@
-admin_port = 9991
-admin_http_port = 9990
-
-host {
- id = 1
-}
-
-db_default {
- username = "$(DB_USERNAME)"
- password = "$(DB_PASSWORD)"
-}
-
-w3c_header_period = 60000
-
-errors {
- deadlock_retries = 3
-}
-
-log {
- filename = "test.log"
- level = "info"
- roll = "hourly"
- truncate_stack_traces = 100
-
- w3c {
- node = "w3c"
- use_parents = false
- filename = "w3c.log"
- level = "info"
- roll = "hourly"
- }
-
- bad_jobs {
- node = "bad_jobs"
- use_parents = false
- filename = "bad_jobs.log"
- level = "info"
- roll = "never"
- }
-}
-
-throttled_log {
- period_msec = 60000
- rate = 10
-}
-
-rowz {
- timeout_msec = 100
- idle_timeout_sec = 60
- server_port = 7919
- shard_server_port = 7920
- job_server_port = 7921
- min_threads = 200
-
- w3c = [
- "action-timing",
- "db-timing",
- "connection-pool-release-timing",
- "connection-pool-reserve-timing",
- "kestrel-put-timing",
- "db-select-count",
- "db-execute-count",
- "job-success-count",
- "operation",
- "arguments"
- ]
-
- aggregate_jobs_page_size = 500
-
- db (inherit="db_default") {
- name = "rowz_data"
-
- connection_pool {
- max_wait = 20
- min_evictable_idle_msec = -1
- size_max = 10
- size_min = 5
- test_idle_msec = 1000
- test_on_borrow = false
-
- timeout {
- initialize = 1000
- open = 100
- pool_size = 10
- queue_size = 10000
- }
- }
-
- disable {
- error_count = 3
- seconds = 60
- }
-
- query_timeout_default = 2000
- queries {
- }
- }
-
- nameserver (inherit="db_default") {
- hostnames = ["localhost"]
- name = "rowz_nameserver"
-
- connection_pool {
- max_wait = 20
- min_evictable_idle_msec = -1
- size_max = 1
- size_min = 1
- test_idle_msec = 1000
- test_on_borrow = false
-
- timeout {
- initialize = 1000
- open = 100
- pool_size = 10
- queue_size = 10000
- }
- }
- query_timeout_default = 15000
- queries { }
- }
-
- replication {
- future {
- pool_size = 100
- max_pool_size = 100
- keep_alive_time_seconds = 5
- timeout_seconds = 6
- }
- }
-
- queue {
- path = "/tmp"
- journal off
- high {
- job_queue = "high"
- error_queue = "high_errors"
- threads = 1
- error_limit = 25
- replay_interval = 900
- }
- medium {
- job_queue = "medium"
- error_queue = "medium_errors"
- threads = 1
- error_limit = 25
- replay_interval = 900
- }
- low {
- job_queue = "low"
- error_queue = "low_errors"
- threads = 1
- error_limit = 25
- replay_interval = 900
- }
- max_memory_size = 36000000
- }
-}
View
@@ -0,0 +1,92 @@
+import com.twitter.rowz.config._
+import com.twitter.gizzard.config._
+import com.twitter.querulous.config._
+import com.twitter.querulous.query.QueryClass
+import com.twitter.conversions.time._
+import com.twitter.conversions.storage._
+import com.twitter.rowz.Priority
+
+
+trait Credentials extends Connection {
+ val username = "root"
+ val password = ""
+}
+
+class TestQueryEvaluator(label: String) extends QueryEvaluator {
+ query.debug = DebugLog
+
+ database.pool = new ApachePoolingDatabase {
+ sizeMin = 5
+ sizeMax = 5
+ maxWait = 1.second
+ minEvictableIdle = 60.seconds
+ testIdle = 1.second
+ testOnBorrow = false
+ }
+
+ database.timeout = new TimingOutDatabase {
+ poolSize = 10
+ queueSize = 10000
+ open = 1.second
+ }
+}
+
+new Rowz {
+ val nodeId = 0 // must be unique per app server
+
+ val server = new RowzThriftServer with THsHaServer {
+ timeout = 100.millis
+ idleTimeout = 10.seconds
+ threadPool.minThreads = 10
+ threadPool.maxThreads = 10
+ }
+
+ val nameServer = new NameServer {
+ //mappingFunction = Fnv1a64 // uncomment to hash ids, rather than using identity
+
+ val replicas = Seq(new Mysql {
+ queryEvaluator = new TestQueryEvaluator("nameserver")
+
+ val connection = new Connection with Credentials {
+ val hostnames = Seq("localhost")
+ val database = "rowz_nameserver_test"
+ }
+ })
+ }
+
+ val databaseConnection = new Connection with Credentials {
+ val hostnames = Seq("localhost")
+ val database = "rowz_test"
+ }
+
+ val rowzQueryEvaluator = new TestQueryEvaluator("rowz") {
+ query.timeouts = Map(
+ QueryClass.Select -> QueryTimeout(1.seconds),
+ QueryClass.Execute -> QueryTimeout(1.seconds)
+ )
+ }
+
+ class TestScheduler(val name: String) extends Scheduler {
+ val schedulerType = new KestrelScheduler {
+ path = "/tmp"
+ keepJournal = false
+ }
+
+ threads = 1
+ errorLimit = 25
+ errorRetryDelay = 900.seconds
+ errorStrobeInterval = 30.seconds
+ perFlushItemLimit = 1000
+ jitterRate = 0.0f
+ badJobQueue = new JsonJobLogger { name = "bad_jobs" }
+ }
+
+ val jobQueues = Map(
+ Priority.High.id -> new TestScheduler("high"),
+ Priority.Medium.id -> new TestScheduler("medium"),
+ Priority.Low.id -> new TestScheduler("low")
+ )
+
+ logging = new LogConfigString("level = \"debug\"\nfilename = \"test.log\"")
+}
+
Oops, something went wrong.

0 comments on commit 36e5c37

Please sign in to comment.