public class KafkaTridentSpoutEmitter<K,V> extends Object implements IOpaquePartitionedTridentSpout.Emitter<List<Map<String,Object>>,KafkaTridentSpoutTopicPartition,Map<String,Object>>, Serializable
| Constructor and Description |
|---|
KafkaTridentSpoutEmitter(KafkaTridentSpoutManager<K,V> kafkaManager,
TopologyContext topologyContext)
Creates instance of this class with default 500 millisecond refresh subscription timer
|
KafkaTridentSpoutEmitter(KafkaTridentSpoutManager<K,V> kafkaManager,
TopologyContext topologyContext,
Timer refreshSubscriptionTimer)
Create a new Kafka spout emitter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Map<String,Object> |
emitPartitionBatch(TransactionAttempt tx,
TridentCollector collector,
KafkaTridentSpoutTopicPartition currBatchPartition,
Map<String,Object> lastBatch) |
List<KafkaTridentSpoutTopicPartition> |
getOrderedPartitions(List<Map<String,Object>> allPartitionInfo)
Computes ordered list of topic-partitions for this task taking into consideration that topic-partitions for this task must be assigned to the Kafka consumer running on this task.
|
List<KafkaTridentSpoutTopicPartition> |
getPartitionsForTask(int taskId,
int numTasks,
List<Map<String,Object>> allPartitionInfo) |
void |
refreshPartitions(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities) |
String |
toString() |
public KafkaTridentSpoutEmitter(KafkaTridentSpoutManager<K,V> kafkaManager, TopologyContext topologyContext, Timer refreshSubscriptionTimer)
Create a new Kafka spout emitter.
kafkaManager - The Kafka consumer manager to usetopologyContext - The topology contextrefreshSubscriptionTimer - The timer for deciding when to recheck the subscriptionpublic KafkaTridentSpoutEmitter(KafkaTridentSpoutManager<K,V> kafkaManager, TopologyContext topologyContext)
Creates instance of this class with default 500 millisecond refresh subscription timer
public Map<String,Object> emitPartitionBatch(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition currBatchPartition, Map<String,Object> lastBatch)
emitPartitionBatch in interface IOpaquePartitionedTridentSpout.Emitter<List<Map<String,Object>>,KafkaTridentSpoutTopicPartition,Map<String,Object>>public void refreshPartitions(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities)
refreshPartitions in interface IOpaquePartitionedTridentSpout.Emitter<List<Map<String,Object>>,KafkaTridentSpoutTopicPartition,Map<String,Object>>public List<KafkaTridentSpoutTopicPartition> getOrderedPartitions(List<Map<String,Object>> allPartitionInfo)
Computes ordered list of topic-partitions for this task taking into consideration that topic-partitions for this task must be assigned to the Kafka consumer running on this task.
getOrderedPartitions in interface IOpaquePartitionedTridentSpout.Emitter<List<Map<String,Object>>,KafkaTridentSpoutTopicPartition,Map<String,Object>>allPartitionInfo - list of all partitions as returned by KafkaTridentSpoutOpaqueCoordinatorpublic List<KafkaTridentSpoutTopicPartition> getPartitionsForTask(int taskId, int numTasks, List<Map<String,Object>> allPartitionInfo)
getPartitionsForTask in interface IOpaquePartitionedTridentSpout.Emitter<List<Map<String,Object>>,KafkaTridentSpoutTopicPartition,Map<String,Object>>public void close()
close in interface IOpaquePartitionedTridentSpout.Emitter<List<Map<String,Object>>,KafkaTridentSpoutTopicPartition,Map<String,Object>>Copyright © 2018 The Apache Software Foundation. All Rights Reserved.