-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-attempt partitionedLoad #140
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
I think we also need to simulate 2 instances of an app, by having 2 partitionedLoadAndRun
streams and then killing one of them and making sure the other one starts picking up data from the partition the killed stream had
if that makes sense
publishToKafka(testTopic1, 0, preLoadPart1) | ||
publishToKafka(testTopic1, 1, preLoadPart2) | ||
|
||
val partitionedStream = TopicLoader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this test fail if this was to use just loadAndRun
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean if we publish to one partition and then the other? It still passes with the loadAndRun
:
"execute callback when finished loading and keep streaming per partition" in new TestContext {
val (preLoadPart1, postLoadPart1) = records(1 to 15).splitAt(10)
val (preLoadPart2, postLoadPart2) = records(16 to 30).splitAt(10)
val partitions: Long = 2
withRunningKafka {
createCustomTopic(testTopic1, partitions = partitions.toInt)
publishToKafka(testTopic1, 0, preLoadPart1)
publishToKafka(testTopic1, 1, preLoadPart2)
val ((callback, _), recordsProbe) =
TopicLoader.loadAndRun[String, String](NonEmptyList.one(testTopic1)).toMat(TestSink.probe)(Keep.both).run()
recordsProbe.request(
preLoadPart1.size.toLong + postLoadPart1.size.toLong + preLoadPart2.size.toLong + postLoadPart2.size.toLong
)
recordsProbe
.expectNextN(preLoadPart1.size.toLong + preLoadPart2.size.toLong)
.map(recordToTuple) should contain theSameElementsAs preLoadPart1 ++ preLoadPart2
whenReady(callback) { _ =>
publishToKafka(testTopic1, 0, postLoadPart1)
publishToKafka(testTopic1, 1, postLoadPart2)
recordsProbe
.expectNextN(postLoadPart1.size.toLong + postLoadPart2.size.toLong)
.map(recordToTuple) should contain theSameElementsAs postLoadPart1 ++ postLoadPart2
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah so my point is i don't think we have a test that is proving this partitioned load functionality, considering the test passes even with loadAndRun
No description provided.