public class KafkaRDD<K,V,U extends kafka.serializer.Decoder<?>,T extends kafka.serializer.Decoder<?>,R> extends RDD<R> implements Logging, HasOffsetRanges
Constructor and Description |
---|
KafkaRDD(SparkContext sc,
scala.collection.immutable.Map<String,String> kafkaParams,
OffsetRange[] offsetRanges,
scala.collection.immutable.Map<kafka.common.TopicAndPartition,scala.Tuple2<String,Object>> leaders,
scala.Function1<kafka.message.MessageAndMetadata<K,V>,R> messageHandler,
scala.reflect.ClassTag<K> evidence$1,
scala.reflect.ClassTag<V> evidence$2,
scala.reflect.ClassTag<U> evidence$3,
scala.reflect.ClassTag<T> evidence$4,
scala.reflect.ClassTag<R> evidence$5) |
Modifier and Type | Method and Description |
---|---|
static <K,V,U extends kafka.serializer.Decoder<?>,T extends kafka.serializer.Decoder<?>,R> |
apply(SparkContext sc,
scala.collection.immutable.Map<String,String> kafkaParams,
scala.collection.immutable.Map<kafka.common.TopicAndPartition,Object> fromOffsets,
scala.collection.immutable.Map<kafka.common.TopicAndPartition,KafkaCluster.LeaderOffset> untilOffsets,
scala.Function1<kafka.message.MessageAndMetadata<K,V>,R> messageHandler,
scala.reflect.ClassTag<K> evidence$6,
scala.reflect.ClassTag<V> evidence$7,
scala.reflect.ClassTag<U> evidence$8,
scala.reflect.ClassTag<T> evidence$9,
scala.reflect.ClassTag<R> evidence$10) |
scala.collection.Iterator<R> |
compute(Partition thePart,
TaskContext context)
:: DeveloperApi ::
Implemented by subclasses to compute a given partition.
|
Partition[] |
getPartitions()
Implemented by subclasses to return the set of partitions in this RDD.
|
scala.collection.Seq<String> |
getPreferredLocations(Partition thePart)
Optionally overridden by subclasses to specify placement preferences.
|
OffsetRange[] |
offsetRanges() |
aggregate, cache, cartesian, checkpoint, checkpointData, coalesce, collect, collect, collectPartitions, computeOrReadCheckpoint, conf, context, count, countApprox, countApproxDistinct, countApproxDistinct, countByValue, countByValueApprox, creationSite, dependencies, distinct, distinct, doCheckpoint, doubleRDDToDoubleRDDFunctions, elementClassTag, filter, filterWith, first, flatMap, flatMapWith, fold, foreach, foreachPartition, foreachWith, getCheckpointFile, getCreationSite, getNarrowAncestors, getStorageLevel, glom, groupBy, groupBy, groupBy, id, intersection, intersection, intersection, isCheckpointed, isEmpty, iterator, keyBy, map, mapPartitions, mapPartitionsWithContext, mapPartitionsWithIndex, mapPartitionsWithSplit, mapWith, markCheckpointed, max, min, name, numericRDDToDoubleRDDFunctions, partitioner, partitions, persist, persist, pipe, pipe, pipe, preferredLocations, randomSplit, rddToAsyncRDDActions, rddToOrderedRDDFunctions, rddToPairRDDFunctions, rddToSequenceFileRDDFunctions, reduce, repartition, retag, retag, sample, saveAsObjectFile, saveAsTextFile, saveAsTextFile, setName, sortBy, sparkContext, subtract, subtract, subtract, take, takeOrdered, takeSample, toArray, toDebugString, toJavaRDD, toLocalIterator, top, toString, treeAggregate, treeReduce, union, unpersist, zip, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipWithIndex, zipWithUniqueId
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public KafkaRDD(SparkContext sc, scala.collection.immutable.Map<String,String> kafkaParams, OffsetRange[] offsetRanges, scala.collection.immutable.Map<kafka.common.TopicAndPartition,scala.Tuple2<String,Object>> leaders, scala.Function1<kafka.message.MessageAndMetadata<K,V>,R> messageHandler, scala.reflect.ClassTag<K> evidence$1, scala.reflect.ClassTag<V> evidence$2, scala.reflect.ClassTag<U> evidence$3, scala.reflect.ClassTag<T> evidence$4, scala.reflect.ClassTag<R> evidence$5)
public static <K,V,U extends kafka.serializer.Decoder<?>,T extends kafka.serializer.Decoder<?>,R> KafkaRDD<K,V,U,T,R> apply(SparkContext sc, scala.collection.immutable.Map<String,String> kafkaParams, scala.collection.immutable.Map<kafka.common.TopicAndPartition,Object> fromOffsets, scala.collection.immutable.Map<kafka.common.TopicAndPartition,KafkaCluster.LeaderOffset> untilOffsets, scala.Function1<kafka.message.MessageAndMetadata<K,V>,R> messageHandler, scala.reflect.ClassTag<K> evidence$6, scala.reflect.ClassTag<V> evidence$7, scala.reflect.ClassTag<U> evidence$8, scala.reflect.ClassTag<T> evidence$9, scala.reflect.ClassTag<R> evidence$10)
kafkaParams
- Kafka
configuration parameters.
Requires "metadata.broker.list" or "bootstrap.servers" to be set with Kafka broker(s),
NOT zookeeper servers, specified in host1:port1,host2:port2 form.fromOffsets
- per-topic/partition Kafka offsets defining the (inclusive)
starting point of the batchuntilOffsets
- per-topic/partition Kafka offsets defining the (exclusive)
ending point of the batchmessageHandler
- function for translating each message into the desired typepublic OffsetRange[] offsetRanges()
offsetRanges
in interface HasOffsetRanges
public Partition[] getPartitions()
RDD
public scala.collection.Seq<String> getPreferredLocations(Partition thePart)
RDD