Class KafkaTridentSpoutCoordinator<K,V>
- java.lang.Object
-
- org.apache.storm.kafka.spout.trident.KafkaTridentSpoutCoordinator<K,V>
-
- All Implemented Interfaces:
Serializable,IOpaquePartitionedTridentSpout.Coordinator<List<Map<String,Object>>>,IPartitionedTridentSpout.Coordinator<List<Map<String,Object>>>
public class KafkaTridentSpoutCoordinator<K,V> extends Object implements IOpaquePartitionedTridentSpout.Coordinator<List<Map<String,Object>>>, IPartitionedTridentSpout.Coordinator<List<Map<String,Object>>>, Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static longTIMER_DELAY_MS
-
Constructor Summary
Constructors Constructor Description KafkaTridentSpoutCoordinator(KafkaTridentSpoutConfig<K,V> kafkaSpoutConfig)Creates a new coordinator based on the given spout config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()List<Map<String,Object>>getPartitionsForBatch()Gets the partitions for the following batches.booleanisReady(long txid)Indicates whether this coordinator is ready to commit the given transaction.StringtoString()
-
-
-
Field Detail
-
TIMER_DELAY_MS
public static final long TIMER_DELAY_MS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KafkaTridentSpoutCoordinator
public KafkaTridentSpoutCoordinator(KafkaTridentSpoutConfig<K,V> kafkaSpoutConfig)
Creates a new coordinator based on the given spout config.- Parameters:
kafkaSpoutConfig- The spout config to use
-
-
Method Detail
-
isReady
public boolean isReady(long txid)
Description copied from interface:IOpaquePartitionedTridentSpout.CoordinatorIndicates whether this coordinator is ready to commit the given transaction. The master batch coordinator will only begin committing if at least one coordinator indicates it is ready to commit.- Specified by:
isReadyin interfaceIOpaquePartitionedTridentSpout.Coordinator<K>- Specified by:
isReadyin interfaceIPartitionedTridentSpout.Coordinator<K>- Parameters:
txid- The transaction id- Returns:
- true if this coordinator is ready to commit, false otherwise.
-
getPartitionsForBatch
public List<Map<String,Object>> getPartitionsForBatch()
Description copied from interface:IOpaquePartitionedTridentSpout.CoordinatorGets the partitions for the following batches. The emitter will be asked to refresh partitions when this value changes.- Specified by:
getPartitionsForBatchin interfaceIOpaquePartitionedTridentSpout.Coordinator<K>- Specified by:
getPartitionsForBatchin interfaceIPartitionedTridentSpout.Coordinator<K>- Returns:
- The partitions for the following batches.
-
close
public void close()
- Specified by:
closein interfaceIOpaquePartitionedTridentSpout.Coordinator<K>- Specified by:
closein interfaceIPartitionedTridentSpout.Coordinator<K>
-
-