This repository has been archived by the owner on May 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 212
/
test.scala
69 lines (58 loc) · 1.59 KB
/
test.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import com.twitter.gizzard.config._
import com.twitter.querulous.config._
import com.twitter.querulous.evaluator.QueryEvaluatorFactory
import com.twitter.conversions.time._
import com.twitter.logging.config._
object Priority extends Enumeration {
val High, Medium, Low = Value
}
trait Credentials extends Connection {
val username = "root"
val password = ""
}
object GizzardMemoization {
var nsQueryEvaluator: QueryEvaluatorFactory = null
}
object TestQueryEvaluator extends QueryEvaluator {
override def apply() = {
if (GizzardMemoization.nsQueryEvaluator == null) {
GizzardMemoization.nsQueryEvaluator = super.apply()
}
GizzardMemoization.nsQueryEvaluator
}
}
class TestScheduler(val name: String) extends Scheduler {
val schedulerType = new KestrelScheduler {
path = "/tmp"
keepJournal = false
}
errorLimit = 25
badJobQueue = new JsonJobLogger { name = "bad_jobs" }
}
new GizzardServer {
val jobQueues = Map(
Priority.High.id -> new TestScheduler("high"),
Priority.Medium.id -> new TestScheduler("medium"),
Priority.Low.id -> new TestScheduler("low")
)
jobRelay.priority = Priority.High.id
nameServerReplicas = Seq(new Mysql {
val connection = new Connection with Credentials {
val hostnames = Seq("localhost")
val database = "gizzard_test"
}
})
loggers = List(
new LoggerConfig {
level = Level.ERROR
}, new LoggerConfig {
node = "w3c"
useParents = false
level = Level.DEBUG
}, new LoggerConfig {
node = "bad_jobs"
useParents = false
level = Level.INFO
}
)
}