Skip to content

Commit 0df3ebe

Browse files
committed
[SPARK-4964] add comments per pwendell / dibbhatt
1 parent 8991017 commit 0df3ebe

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

external/kafka/src/main/scala/org/apache/spark/streaming/kafka/KafkaCluster.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class KafkaCluster(val kafkaParams: Map[String, String]) extends Serializable {
221221
// https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-OffsetCommit/FetchAPI
222222
// scalastyle:on
223223

224+
/** Requires Kafka >= 0.8.1.1 */
224225
def getConsumerOffsets(
225226
groupId: String,
226227
topicAndPartitions: Set[TopicAndPartition]
@@ -232,6 +233,7 @@ class KafkaCluster(val kafkaParams: Map[String, String]) extends Serializable {
232233
}
233234
}
234235

236+
/** Requires Kafka >= 0.8.1.1 */
235237
def getConsumerOffsetMetadata(
236238
groupId: String,
237239
topicAndPartitions: Set[TopicAndPartition]
@@ -261,6 +263,7 @@ class KafkaCluster(val kafkaParams: Map[String, String]) extends Serializable {
261263
Left(errs)
262264
}
263265

266+
/** Requires Kafka >= 0.8.1.1 */
264267
def setConsumerOffsets(
265268
groupId: String,
266269
offsets: Map[TopicAndPartition, Long]
@@ -270,6 +273,7 @@ class KafkaCluster(val kafkaParams: Map[String, String]) extends Serializable {
270273
})
271274
}
272275

276+
/** Requires Kafka >= 0.8.1.1 */
273277
def setConsumerOffsetMetadata(
274278
groupId: String,
275279
metadata: Map[TopicAndPartition, OffsetMetadataAndError]

external/kafka/src/main/scala/org/apache/spark/streaming/kafka/OffsetRange.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ final class OffsetRange private(
4242
}
4343

4444
object OffsetRange {
45-
private[spark]
46-
type OffsetRangeTuple = (String, Int, Long, Long)
47-
4845
def create(topic: String, partition: Int, fromOffset: Long, untilOffset: Long): OffsetRange =
4946
new OffsetRange(topic, partition, fromOffset, untilOffset)
5047

@@ -63,6 +60,10 @@ object OffsetRange {
6360
untilOffset: Long): OffsetRange =
6461
new OffsetRange(topicAndPartition.topic, topicAndPartition.partition, fromOffset, untilOffset)
6562

63+
/** this is to avoid ClassNotFoundException during checkpoint restore */
64+
private[spark]
65+
type OffsetRangeTuple = (String, Int, Long, Long)
66+
6667
private[streaming]
6768
def apply(t: OffsetRangeTuple) =
6869
new OffsetRange(t._1, t._2, t._3, t._4)

0 commit comments

Comments
 (0)