Github user brkyvz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9403#discussion_r43929148
  
    --- Diff: 
extras/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisTestUtils.scala
 ---
    @@ -90,24 +102,44 @@ private[kinesis] class KinesisTestUtils extends 
Logging {
        * Push data to Kinesis stream and return a map of
        * shardId -> seq of (data, seq number) pushed to corresponding shard
        */
    -  def pushData(testData: Seq[Int]): Map[String, Seq[(Int, String)]] = {
    +  def pushData(testData: Seq[Int], aggregate: Boolean): Map[String, 
Seq[(Int, String)]] = {
         require(streamCreated, "Stream not yet created, call createStream() to 
create one")
         val shardIdToSeqNumbers = new mutable.HashMap[String, 
ArrayBuffer[(Int, String)]]()
     
         testData.foreach { num =>
           val str = num.toString
    -      val putRecordRequest = new 
PutRecordRequest().withStreamName(streamName)
    -        .withData(ByteBuffer.wrap(str.getBytes()))
    -        .withPartitionKey(str)
    -
    -      val putRecordResult = kinesisClient.putRecord(putRecordRequest)
    -      val shardId = putRecordResult.getShardId
    -      val seqNumber = putRecordResult.getSequenceNumber()
    -      val sentSeqNumbers = shardIdToSeqNumbers.getOrElseUpdate(shardId,
    -        new ArrayBuffer[(Int, String)]())
    -      sentSeqNumbers += ((num, seqNumber))
    +      val data = ByteBuffer.wrap(str.getBytes())
    +      if (aggregate) {
    +        val future = kinesisProducer.addUserRecord(streamName, str, data)
    +        val kinesisCallBack = new FutureCallback[UserRecordResult]() {
    +          override def onFailure(t: Throwable): Unit = {} // do nothing
    +
    +          override def onSuccess(result: UserRecordResult): Unit = {
    +            val shardId = result.getShardId
    --- End diff --
    
    Even though they have the same methods, they are of different types. 
UserRecordResult is not a subclass of PutRecordResult


---
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]

Reply via email to