Class VeniceKafkaInputReducer
- java.lang.Object
-
- com.linkedin.venice.hadoop.task.datawriter.AbstractDataWriterTask
-
- com.linkedin.venice.hadoop.task.datawriter.AbstractPartitionWriter
-
- com.linkedin.venice.hadoop.mapreduce.datawriter.reduce.VeniceReducer
-
- com.linkedin.venice.hadoop.input.kafka.VeniceKafkaInputReducer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.apache.hadoop.io.Closeable
,org.apache.hadoop.mapred.JobConfigurable
,org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
public class VeniceKafkaInputReducer extends VeniceReducer
This class is designed specifically forKafkaInputFormat
, and right now, it will pick up the latest entry according to the associated offset, and produce it to Kafka.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.linkedin.venice.hadoop.task.datawriter.AbstractPartitionWriter
AbstractPartitionWriter.DuplicateKeyPrinter, AbstractPartitionWriter.PartitionWriterProducerCallback, AbstractPartitionWriter.VeniceWriterMessage
-
-
Field Summary
Fields Modifier and Type Field Description protected FilterChain<ChunkAssembler.ValueBytesAndSchemaId>
veniceFilterChain
-
Fields inherited from class com.linkedin.venice.hadoop.mapreduce.datawriter.reduce.VeniceReducer
MAP_REDUCE_JOB_ID_PROP
-
Fields inherited from class com.linkedin.venice.hadoop.task.datawriter.AbstractDataWriterTask
TASK_ID_NOT_SET
-
-
Constructor Summary
Constructors Constructor Description VeniceKafkaInputReducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected byte[]
compress(byte[] valueBytesFromSourceVersion)
protected void
configureTask(VeniceProperties props)
Allow implementations of this class to configure task-specific stuff.protected AbstractPartitionWriter.VeniceWriterMessage
extract(byte[] key, java.util.Iterator<byte[]> valueIterator, DataWriterTaskTracker dataWriterTaskTracker)
protected AbstractPartitionWriter.DuplicateKeyPrinter
initDuplicateKeyPrinter(VeniceProperties properties)
No need to print out duplicate keys since duplicate keys are expected in Kafka topics.protected void
setChunkingEnabled(boolean isChunkingEnabled)
protected void
setDestVersionCompressor(VeniceCompressor compressor)
protected void
setSourceVersionCompressor(VeniceCompressor compressor)
-
Methods inherited from class com.linkedin.venice.hadoop.mapreduce.datawriter.reduce.VeniceReducer
configure, getCallback, getDataWriterTaskTracker, getExceedQuotaFlag, getJobConf, getTotalIncomingDataSizeInBytes, hasReportedFailure, reduce, setExceedQuota, setHadoopJobClientProvider, setVeniceWriter
-
Methods inherited from class com.linkedin.venice.hadoop.task.datawriter.AbstractPartitionWriter
getDerivedValueSchemaId, isEnableWriteCompute, logMessageProgress, processValuesForKey, recordMessageErrored
-
Methods inherited from class com.linkedin.venice.hadoop.task.datawriter.AbstractDataWriterTask
configure, getEngineTaskConfigProvider, getPartitionCount, getTaskId, isChunkingEnabled, isRmdChunkingEnabled
-
-
-
-
Field Detail
-
veniceFilterChain
protected FilterChain<ChunkAssembler.ValueBytesAndSchemaId> veniceFilterChain
-
-
Method Detail
-
configureTask
protected void configureTask(VeniceProperties props)
Description copied from class:AbstractDataWriterTask
Allow implementations of this class to configure task-specific stuff.- Overrides:
configureTask
in classVeniceReducer
- Parameters:
props
- the job props that the task was configured with.
-
setSourceVersionCompressor
protected void setSourceVersionCompressor(VeniceCompressor compressor)
-
setDestVersionCompressor
protected void setDestVersionCompressor(VeniceCompressor compressor)
-
compress
protected byte[] compress(byte[] valueBytesFromSourceVersion)
-
initDuplicateKeyPrinter
protected AbstractPartitionWriter.DuplicateKeyPrinter initDuplicateKeyPrinter(VeniceProperties properties)
No need to print out duplicate keys since duplicate keys are expected in Kafka topics.- Overrides:
initDuplicateKeyPrinter
in classAbstractPartitionWriter
-
extract
protected AbstractPartitionWriter.VeniceWriterMessage extract(byte[] key, java.util.Iterator<byte[]> valueIterator, DataWriterTaskTracker dataWriterTaskTracker)
- Overrides:
extract
in classAbstractPartitionWriter
-
setChunkingEnabled
protected void setChunkingEnabled(boolean isChunkingEnabled)
- Overrides:
setChunkingEnabled
in classAbstractDataWriterTask
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classAbstractPartitionWriter
- Throws:
java.io.IOException
-
-