Github user brkyvz commented on a diff in the pull request:
https://github.com/apache/spark/pull/16213#discussion_r96550071
--- Diff:
external/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisStreamSuite.scala
---
@@ -225,6 +225,74 @@ abstract class KinesisStreamTests(aggregateTestData:
Boolean) extends KinesisFun
ssc.stop(stopSparkContext = false)
}
+ testIfEnabled("split and merge shards in a stream") {
+ // Since this test tries to split and merge shards in a stream, we
create another
+ // temporary stream and then remove it when finished.
+ val localAppName = s"KinesisStreamSuite-${math.abs(Random.nextLong())}"
+ val localTestUtils = new KPLBasedKinesisTestUtils(1)
+ localTestUtils.createStream()
+ try {
+ val awsCredentials = KinesisTestUtils.getAWSCredentials()
+ val stream = KinesisUtils.createStream(ssc, localAppName,
localTestUtils.streamName,
+ localTestUtils.endpointUrl, localTestUtils.regionName,
InitialPositionInStream.LATEST,
+ Seconds(10), StorageLevel.MEMORY_ONLY,
+ awsCredentials.getAWSAccessKeyId, awsCredentials.getAWSSecretKey)
+
+ val collected = new mutable.HashSet[Int]
+ stream.map { bytes => new String(bytes).toInt }.foreachRDD { rdd =>
+ collected.synchronized {
+ collected ++= rdd.collect()
+ logInfo("Collected = " + collected.mkString(", "))
+ }
+ }
+ ssc.start()
+
+ val (testData1, testData2, testData3) = (1 to 10, 11 to 20, 21 to 30)
--- End diff --
nit: instead of doing a tuple expansion, mind making these new lines
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]