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

    https://github.com/apache/spark/pull/16213#discussion_r91829740
  
    --- Diff: 
external/kinesis-asl/src/main/java/com/amazonaws/services/kinesis/clientlibrary/lib/worker/CheckpointerShim.java
 ---
    @@ -0,0 +1,43 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package com.amazonaws.services.kinesis.clientlibrary.lib.worker;
    +
    +import 
com.amazonaws.services.kinesis.clientlibrary.exceptions.InvalidStateException;
    +import 
com.amazonaws.services.kinesis.clientlibrary.exceptions.ShutdownException;
    +import 
com.amazonaws.services.kinesis.clientlibrary.interfaces.IRecordProcessorCheckpointer;
    +import 
com.amazonaws.services.kinesis.clientlibrary.types.ExtendedSequenceNumber;
    +
    +
    +/**
    + * This is a class to fix an issue in SPARK-18020. When resharding Kinesis 
streams,
    + * the KCL throws an exception because Spark does not checkpoint 
`SHARD_END` to finish reading
    + * closed shards in `KinesisRecordProcessor#shutdown`. This bug finally 
leads to stopping
    + * subscribing new split (or merged) shards. However, trying checkpoints 
with `SHARD_END` throws
    + * `IllegalArgumentException` exceptions with messages like "Sequence 
number must be numeric,
    + * but was SHARD_END". This fix is a workaround and the class will be 
removed in future
    + * if we find other better solutions.
    + */
    +public class CheckpointerShim {
    +
    +  public static void shutdown(IRecordProcessorCheckpointer checkpointer)
    --- End diff --
    
    Yea, I tried by [this 
version](https://github.com/maropu/spark-kinesis-sql-asl/blob/SPARK-18020-tests/spark/spark-2.0/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisCheckpointer.scala#L78),
 but I got the same exception;
    ```
    16/12/10 05:49:00 ERROR ShutdownTask: Application exception.
    java.lang.IllegalArgumentException: Sequence number must be numeric, but 
was SHARD_END
            at 
com.amazonaws.services.kinesis.clientlibrary.lib.worker.SequenceNumberValidator.validateSequenceNumber(SequenceNumberValidator.java:75)
            at 
com.amazonaws.services.kinesis.clientlibrary.lib.worker.RecordProcessorCheckpointer.checkpoint(RecordProcessorCheckpointer.java:120)
            at 
org.apache.spark.streaming.kinesis.KinesisCheckpointer.removeCheckpointer(KinesisCheckpointer.scala:77)
            at 
org.apache.spark.streaming.kinesis.KinesisReceiver.removeCheckpointer(KinesisReceiver.scala:258)
    ```


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