public class KafkaInputSplit
extends org.apache.hadoop.mapreduce.InputSplit
implements org.apache.hadoop.io.Writable
TopicPartition between the specified start
and end offsets.| Constructor and Description |
|---|
KafkaInputSplit()
Nullary Constructor for creating the instance inside the Mapper instance.
|
KafkaInputSplit(String topic,
int partition,
long startingOffset,
long endingOffset)
Constructs an input split for the provided
topic and partition restricting data to be between
the startingOffset and endingOffset |
| Modifier and Type | Method and Description |
|---|---|
long |
getEndingOffset()
Returns the ending offset for the split
|
long |
getLength() |
String[] |
getLocations() |
long |
getStartingOffset()
Returns the starting offset for the split
|
org.apache.kafka.common.TopicPartition |
getTopicPartition()
Returns the topic and partition for the split
|
void |
readFields(DataInput dataInput) |
String |
toString() |
void |
write(DataOutput dataOutput) |
public KafkaInputSplit()
public KafkaInputSplit(String topic, int partition, long startingOffset, long endingOffset)
topic and partition restricting data to be between
the startingOffset and endingOffsettopic - the topic for the splitpartition - the partition for the topicstartingOffset - the start of the splitendingOffset - the end of the splitpublic long getLength()
throws IOException,
InterruptedException
getLength in class org.apache.hadoop.mapreduce.InputSplitIOExceptionInterruptedExceptionpublic String[] getLocations() throws IOException, InterruptedException
getLocations in class org.apache.hadoop.mapreduce.InputSplitIOExceptionInterruptedExceptionpublic org.apache.kafka.common.TopicPartition getTopicPartition()
public long getStartingOffset()
public long getEndingOffset()
public void write(DataOutput dataOutput) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput dataInput) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.