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

    https://github.com/apache/spark/pull/17506#discussion_r109304590
  
    --- Diff: 
external/kinesis-asl/src/test/java/org/apache/spark/streaming/kinesis/JavaKinesisStreamSuite.java
 ---
    @@ -50,48 +56,86 @@ public void testAwsCreds() {
         String dummyRegionName = 
KinesisTestUtils.getRegionNameByEndpoint(dummyEndpointUrl);
     
         // Tests the API, does not actually test data receiving
    -    JavaDStream<byte[]> kinesisStream = KinesisUtils.createStream(ssc, 
"myAppName", "mySparkStream",
    -        dummyEndpointUrl, dummyRegionName, InitialPositionInStream.LATEST, 
new Duration(2000),
    -        StorageLevel.MEMORY_AND_DISK_2(), "fakeAccessKey", 
"fakeSecretKey");
    +    BasicCredentials credentials = new BasicCredentials("fakeAccessKey", 
"fakeSecretKey");
    +
    +    KinesisInputDStream<byte[]> kinesisStream = 
KinesisInputDStream.builder().streamingContext(ssc)
    +            .checkpointAppName("myAppName")
    +            .streamName("mySparkStream")
    +            .endpointUrl(dummyEndpointUrl)
    +            .regionName(dummyRegionName)
    +            .initialPositionInStream(InitialPositionInStream.LATEST)
    +            .checkpointInterval(new Duration(2000))
    +            .storageLevel(StorageLevel.MEMORY_AND_DISK_2())
    +            .kinesisCredentials(credentials)
    +            .build();
    +
         ssc.stop();
       }
     
    -  private static Function<Record, String> handler = new Function<Record, 
String>() {
    +  public static Function1<Record, String> handler = new 
AbstractFunction1<Record, String>() {
    --- End diff --
    
    I agree. I however couldn't pass the 
org.apache.spark.api.java.function.Function to the buildWithHandler. Tried lot 
of other ways but only this seemed to make the api happy.


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