File tree Expand file tree Collapse file tree 5 files changed +25
-5
lines changed
publication/src/test/scala/hmda/publication/reports Expand file tree Collapse file tree 5 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 1
1
package hmda .publication .reports
2
2
3
3
import hmda .model .census .Census
4
- import hmda .model .publication .reports .MinorityStatusEnum .WhiteNonHispanic
5
4
import hmda .model .publication .reports ._
6
5
import org .scalacheck .Gen
7
6
Original file line number Diff line number Diff line change @@ -75,3 +75,20 @@ cassandra {
75
75
retries = 60
76
76
retry-interval = 1000
77
77
}
78
+
79
+ query-dispatcher {
80
+ type = Dispatcher
81
+ executor = "fork-join-executor"
82
+ fork-join-executor {
83
+ # Min number of threads to cap factor-based parallelism number to
84
+ parallelism-min = 2
85
+ # Parallelism (threads) ... ceil(available processors * factor)
86
+ parallelism-factor = 2.0
87
+ # Max number of threads to cap factor-based parallelism number to
88
+ parallelism-max = 10
89
+ }
90
+ # Throughput defines the maximum number of messages to be
91
+ # processed per actor before the thread jumps to the next actor.
92
+ # Set to 1 for as fair as possible.
93
+ throughput = 100
94
+ }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class HmdaQuerySupervisor extends HmdaSupervisorActor {
39
39
40
40
override protected def createActor (name : String ): ActorRef = name match {
41
41
case id @ InstitutionView .name =>
42
- val actor = context.actorOf(InstitutionView .props(), id)
42
+ val actor = context.actorOf(InstitutionView .props().withDispatcher( " query-dispatcher " ) , id)
43
43
supervise(actor, id)
44
44
}
45
45
@@ -49,7 +49,7 @@ class HmdaQuerySupervisor extends HmdaSupervisorActor {
49
49
50
50
private def createHmdaFilingView (period : String )(implicit ec : ExecutionContext ): ActorRef = {
51
51
val id = s " ${HmdaFilingView .name}- $period"
52
- val actor = context.actorOf(HmdaFilingView .props(period), id)
52
+ val actor = context.actorOf(HmdaFilingView .props(period).withDispatcher( " query-dispatcher " ) , id)
53
53
for {
54
54
p <- (actor ? GetProjectionActorRef ).mapTo[ActorRef ]
55
55
} yield {
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ class HmdaFilingView(period: String) extends HmdaPersistentActor {
41
41
42
42
var counter = 0
43
43
44
- val queryProjector = context.actorOf(HmdaFilingDBProjection .props(period), " queryProjector" )
44
+ val queryProjector = context
45
+ .actorOf(HmdaFilingDBProjection .props(period)
46
+ .withDispatcher(" query-dispatcher" ), " queryProjector" )
45
47
46
48
val conf = ConfigFactory .load()
47
49
val snapshotCounter = conf.getInt(" hmda.journal.snapshot.counter" )
Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ class InstitutionView extends HmdaPersistentActor {
50
50
51
51
var counter = 0
52
52
53
- val queryProjector = context.actorOf(InstitutionDBProjection .props(), " institution-projection" )
53
+ val queryProjector = context
54
+ .actorOf(InstitutionDBProjection .props()
55
+ .withDispatcher(" query-dispatcher" ), " institution-projection" )
54
56
55
57
val snapshotCounter = configuration.getInt(" hmda.journal.snapshot.counter" )
56
58
You can’t perform that action at this time.
0 commit comments