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

    https://github.com/apache/spark/pull/17506#discussion_r109310445
  
    --- 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 don't think this is a change you should make then. If you're switching to 
Scala in a Java test to avoid a deprecated API then the test isn't quite 
testing what it is meant to. It also sounds like it could potentially leave the 
existing deprecated method untested.
    
    Are you saying there's not an un-deprecated way to call this in the Java 
API? That sounds like a closely related issue that should be addressed first if 
so.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to