Add minimum cap for ReadMajority/WriteMajority #21618
This commit is contained in:
parent
91d6a3f125
commit
e043a9fffe
4 changed files with 56 additions and 7 deletions
|
|
@ -162,6 +162,23 @@ class WriteAggregatorSpec extends AkkaSpec(s"""
|
|||
watch(aggr)
|
||||
expectTerminated(aggr)
|
||||
}
|
||||
|
||||
"calculate majority with minCap" in {
|
||||
val minCap = 5
|
||||
|
||||
import ReadWriteAggregator._
|
||||
|
||||
calculateMajorityWithMinCap(minCap, 3) should be (3)
|
||||
calculateMajorityWithMinCap(minCap, 4) should be (4)
|
||||
calculateMajorityWithMinCap(minCap, 5) should be (5)
|
||||
calculateMajorityWithMinCap(minCap, 6) should be (5)
|
||||
calculateMajorityWithMinCap(minCap, 7) should be (5)
|
||||
calculateMajorityWithMinCap(minCap, 8) should be (5)
|
||||
calculateMajorityWithMinCap(minCap, 9) should be (5)
|
||||
calculateMajorityWithMinCap(minCap, 10) should be (6)
|
||||
calculateMajorityWithMinCap(minCap, 11) should be (6)
|
||||
calculateMajorityWithMinCap(minCap, 12) should be (7)
|
||||
}
|
||||
}
|
||||
|
||||
"Durable WriteAggregator" must {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue