kafka.etl
Class KafkaETLContext
java.lang.Object
kafka.etl.KafkaETLContext
public class KafkaETLContext
- extends java.lang.Object
Constructor Summary |
KafkaETLContext(org.apache.hadoop.mapred.JobConf job,
Props props,
org.apache.hadoop.mapred.Reporter reporter,
org.apache.hadoop.mapred.lib.MultipleOutputs mos,
int index,
java.lang.String input)
construct using input string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_RETRY_TIME
protected static int MAX_RETRY_TIME
_index
protected int _index
_input
protected java.lang.String _input
_request
protected KafkaETLRequest _request
_consumer
protected kafka.javaapi.consumer.SimpleConsumer _consumer
_offsetRange
protected long[] _offsetRange
_offset
protected long _offset
_count
protected long _count
_response
protected kafka.javaapi.FetchResponse _response
_messageIt
protected java.util.Iterator<kafka.message.MessageAndOffset> _messageIt
_respIterator
protected java.util.Iterator<kafka.javaapi.message.ByteBufferMessageSet> _respIterator
_retry
protected int _retry
_requestTime
protected long _requestTime
_startTime
protected long _startTime
_bufferSize
protected int _bufferSize
_timeout
protected int _timeout
_reporter
protected org.apache.hadoop.mapred.Reporter _reporter
_mos
protected org.apache.hadoop.mapred.lib.MultipleOutputs _mos
_offsetOut
protected org.apache.hadoop.mapred.OutputCollector<KafkaETLKey,org.apache.hadoop.io.BytesWritable> _offsetOut
builder
protected kafka.api.FetchRequestBuilder builder
KafkaETLContext
public KafkaETLContext(org.apache.hadoop.mapred.JobConf job,
Props props,
org.apache.hadoop.mapred.Reporter reporter,
org.apache.hadoop.mapred.lib.MultipleOutputs mos,
int index,
java.lang.String input)
throws java.lang.Exception
- construct using input string
- Throws:
java.lang.Exception
getTotalBytes
public long getTotalBytes()
getReadBytes
public long getReadBytes()
getCount
public long getCount()
hasMore
public boolean hasMore()
getNext
public boolean getNext(KafkaETLKey key,
org.apache.hadoop.io.BytesWritable value)
throws java.io.IOException
- Throws:
java.io.IOException
fetchMore
public boolean fetchMore()
throws java.io.IOException
- Throws:
java.io.IOException
output
public void output(java.lang.String fileprefix)
throws java.io.IOException
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException
get
protected boolean get(KafkaETLKey key,
org.apache.hadoop.io.BytesWritable value)
throws java.io.IOException
- Throws:
java.io.IOException
getOffsetRange
protected long[] getOffsetRange()
throws java.io.IOException
- Get offset ranges
- Throws:
java.io.IOException
getClientBufferSize
public static int getClientBufferSize(Props props)
throws java.lang.Exception
- Throws:
java.lang.Exception
getClientTimeout
public static int getClientTimeout(Props props)
throws java.lang.Exception
- Throws:
java.lang.Exception