Tasks takes the following to be created:
Main Kafka Consumer¶
Tasks is given a Kafka
Consumer<byte, byte> (using setMainConsumer method) for the following:
The idea is to pass this
Consumer on to StreamTasks.
void setMainConsumer( Consumer<byte, byte> mainConsumer)
setMainConsumer sets the Main Kafka Consumer.
setMainConsumer is used when:
TaskManageris requested to setMainConsumer (when
StreamThreadutility is used to create a StreamThread)
void createTasks( Map<TaskId, Set<TopicPartition>> activeTasksToCreate, Map<TaskId, Set<TopicPartition>> standbyTasksToCreate)
createTasks requests the ActiveTaskCreator to create active tasks (in the given
createTasks registers the tasks in the activeTasksPerId and allTasksPerId registries.
createTasks registers the inputPartitions of the tasks in the activeTasksPerPartition.
createTasks requests the StandbyTaskCreator to create standby tasks (in the given
createTasks registers the tasks in the standbyTasksPerId and allTasksPerId registries.
createTasks is used when:
TaskManageris requested to handleAssignment
void convertStandbyToActive( StandbyTask standbyTask, Set<TopicPartition> partitions)
convertStandbyToActive is used when:
TaskManageris requested to handleCloseAndRecycle
Map<TopicPartition, Task> activeTasksPerPartition
Tasks defines an
activeTasksPerPartition registry of Tasks that handle (records of) a
Task can be looked up using activeTasksForInputPartition.
Task activeTasksForInputPartition( TopicPartition partition)
activeTasksForInputPartition is used when:
TaskManageris requested to add records to active tasks