Skip to content

Commit e6dfb3b

Browse files
committed
nix refactor of CatchupSupervisor, for now
1 parent 4c436de commit e6dfb3b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/scala/com/comcast/xfinity/sirius/api/impl/bridge/CatchupSupervisor.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import scala.concurrent.duration._
2222
import com.comcast.xfinity.sirius.api.impl.membership.MembershipHelper
2323
import com.comcast.xfinity.sirius.api.SiriusConfiguration
2424
import com.comcast.xfinity.sirius.api.impl.bridge.CatchupSupervisor.CatchupSupervisorInfoMBean
25-
import com.comcast.xfinity.sirius.api.impl.state.SiriusPersistenceActor.{CompleteSubrange, GetLogSubrangeWithLimit, LogSubrange}
25+
import com.comcast.xfinity.sirius.api.impl.state.SiriusPersistenceActor.{CompleteSubrange, GetLogSubrange, GetLogSubrangeWithLimit, LogSubrange}
2626
import com.comcast.xfinity.sirius.admin.MonitoringHooks
2727

2828
import scala.util.Success
@@ -122,7 +122,7 @@ private[bridge] class CatchupSupervisor(membershipHelper: MembershipHelper,
122122
}
123123

124124
def requestSubrange(fromSeq: Long, window: Int, source: ActorRef): Unit = {
125-
source.ask(GetLogSubrangeWithLimit(fromSeq, Long.MaxValue, window))(timeout()).onComplete {
125+
source.ask(GetLogSubrange(fromSeq, fromSeq + window))(timeout()).onComplete {
126126
case Success(logSubrange: LogSubrange) => self ! CatchupRequestSucceeded(logSubrange)
127127
case _ => self ! CatchupRequestFailed
128128
}

src/test/scala/com/comcast/xfinity/sirius/api/impl/bridge/CatchupSupervisorTest.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CatchupSupervisorTest extends NiceTest {
5353

5454
underTest ! InitiateCatchup(1L)
5555

56-
remote.expectMsgClass(classOf[GetLogSubrangeWithLimit])
56+
remote.expectMsgClass(classOf[GetLogSubrange])
5757
}
5858
describe("for successful requests with a complete subrange") {
5959
it("should forward the message on to the parent") {
@@ -176,7 +176,7 @@ class CatchupSupervisorTest extends NiceTest {
176176

177177
underTest ! ContinueCatchup(1L)
178178

179-
remote.expectMsg(GetLogSubrangeWithLimit(1L, Long.MaxValue, 1L))
179+
remote.expectMsg(GetLogSubrange(1L, 2L))
180180
}
181181
it("should ignore InitiateCatchup requests if it's currently in catchup mode") {
182182
val remote = TestProbe()
@@ -197,7 +197,7 @@ class CatchupSupervisorTest extends NiceTest {
197197
underTest ! StopCatchup
198198
underTest ! InitiateCatchup(1L)
199199

200-
remote.expectMsg(GetLogSubrangeWithLimit(1L, Long.MaxValue, 1L))
200+
remote.expectMsg(GetLogSubrange(1L, 2L))
201201
}
202202
}
203203
}

0 commit comments

Comments
 (0)