public class KafkaTridentSpoutEmitter<K,V> extends Object implements Serializable
Constructor and Description |
---|
KafkaTridentSpoutEmitter(KafkaTridentSpoutConfig<K,V> kafkaSpoutConfig,
TopologyContext topologyContext)
Create a new Kafka spout emitter.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Map<String,Object> |
emitPartitionBatchNew(TransactionAttempt tx,
TridentCollector collector,
KafkaTridentSpoutTopicPartition currBatchPartition,
Map<String,Object> lastBatch)
Emit a new batch.
|
List<KafkaTridentSpoutTopicPartition> |
getOrderedPartitions(List<Map<String,Object>> allPartitionInfo)
Get the input partitions in sorted order.
|
List<KafkaTridentSpoutTopicPartition> |
getPartitionsForTask(int taskId,
int numTasks,
List<KafkaTridentSpoutTopicPartition> allPartitionInfoSorted)
Get the partitions that should be handled by this task.
|
void |
reEmitPartitionBatch(TransactionAttempt tx,
TridentCollector collector,
KafkaTridentSpoutTopicPartition currBatchPartition,
Map<String,Object> currBatch)
Emit a batch that has already been emitted.
|
void |
refreshPartitions(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities)
Prepare the emitter to handle the input partitions.
|
String |
toString() |
public KafkaTridentSpoutEmitter(KafkaTridentSpoutConfig<K,V> kafkaSpoutConfig, TopologyContext topologyContext)
kafkaSpoutConfig
- The kafka spout configtopologyContext
- The topology contextpublic void reEmitPartitionBatch(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition currBatchPartition, Map<String,Object> currBatch)
public Map<String,Object> emitPartitionBatchNew(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition currBatchPartition, Map<String,Object> lastBatch)
public List<KafkaTridentSpoutTopicPartition> getOrderedPartitions(List<Map<String,Object>> allPartitionInfo)
public List<KafkaTridentSpoutTopicPartition> getPartitionsForTask(int taskId, int numTasks, List<KafkaTridentSpoutTopicPartition> allPartitionInfoSorted)
public void refreshPartitions(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities)
public void close()
Copyright © 2023 The Apache Software Foundation. All rights reserved.