Skip to content

Commit

Permalink
[SPARK-17147][STREAMING][KAFKA] change another assert to NoSuchElement
Browse files Browse the repository at this point in the history
  • Loading branch information
koeninger committed Feb 21, 2018
1 parent 2246750 commit 08f3570
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -306,7 +306,9 @@ private class CompactedKafkaRDDIterator[K, V](
override def hasNext(): Boolean = okNext

override def next(): ConsumerRecord[K, V] = {
assert(hasNext, "Can't call getNext() once untilOffset has been reached")
if (!hasNext) {
throw new ju.NoSuchElementException("Can't call getNext() once untilOffset has been reached")
}
val r = nextRecord
if (r.offset + 1 >= part.untilOffset) {
okNext = false
Expand Down

0 comments on commit 08f3570

Please sign in to comment.