public class KafkaSupervisor extends SeekableStreamSupervisor<Integer,Long>
KafkaSupervisorSpec which includes the Kafka topic and configuration as well as an ingestion spec which will
be used to generate the indexing tasks. The run loop periodically refreshes its view of the Kafka topic's partitions
and the list of running indexing tasks and ensures that all partitions are being read from and that there are enough
tasks to satisfy the desired number of replicas. As tasks complete, new tasks are queued to process the next range of
Kafka offsets.SeekableStreamSupervisor.CheckpointNotice| Modifier and Type | Field and Description |
|---|---|
static com.fasterxml.jackson.core.type.TypeReference<TreeMap<Integer,Map<Integer,Long>>> |
CHECKPOINTS_TYPE_REF |
CHECKPOINTS_CTX_KEY, IS_INCREMENTAL_HANDOFF_SUPPORTED, partitionIds, sequenceLastUpdated, sortingMapper| Constructor and Description |
|---|
KafkaSupervisor(TaskStorage taskStorage,
TaskMaster taskMaster,
IndexerMetadataStorageCoordinator indexerMetadataStorageCoordinator,
KafkaIndexTaskClientFactory taskClientFactory,
com.fasterxml.jackson.databind.ObjectMapper mapper,
KafkaSupervisorSpec spec,
RowIngestionMetersFactory rowIngestionMetersFactory) |
addTaskGroupToActivelyReadingTaskGroup, addTaskGroupToPendingCompletionTaskGroup, checkpoint, createBaseTaskContexts, generateSequenceName, getHighestCurrentOffsets, getInitRetryCounter, getNoticesQueueSize, getStats, getStatus, gracefulShutdownInternal, isLifecycleStarted, isStarted, moveTaskGroupToPendingCompletion, reset, resetInternal, runInternal, start, stop, tryInit, updateCurrentAndLatestOffsetspublic KafkaSupervisor(TaskStorage taskStorage, TaskMaster taskMaster, IndexerMetadataStorageCoordinator indexerMetadataStorageCoordinator, KafkaIndexTaskClientFactory taskClientFactory, com.fasterxml.jackson.databind.ObjectMapper mapper, KafkaSupervisorSpec spec, RowIngestionMetersFactory rowIngestionMetersFactory)
protected RecordSupplier<Integer,Long> setupRecordSupplier()
setupRecordSupplier in class SeekableStreamSupervisor<Integer,Long>protected void scheduleReporting(ScheduledExecutorService reportingExec)
scheduleReporting in class SeekableStreamSupervisor<Integer,Long>protected int getTaskGroupIdForPartition(Integer partition)
getTaskGroupIdForPartition in class SeekableStreamSupervisor<Integer,Long>protected boolean checkSourceMetadataMatch(DataSourceMetadata metadata)
checkSourceMetadataMatch in class SeekableStreamSupervisor<Integer,Long>protected boolean doesTaskTypeMatchSupervisor(Task task)
doesTaskTypeMatchSupervisor in class SeekableStreamSupervisor<Integer,Long>protected SeekableStreamSupervisorReportPayload<Integer,Long> createReportPayload(int numPartitions, boolean includeOffsets)
createReportPayload in class SeekableStreamSupervisor<Integer,Long>protected SeekableStreamIndexTaskIOConfig createTaskIoConfig(int groupId, Map<Integer,Long> startPartitions, Map<Integer,Long> endPartitions, String baseSequenceName, org.joda.time.DateTime minimumMessageTime, org.joda.time.DateTime maximumMessageTime, Set<Integer> exclusiveStartSequenceNumberPartitions, SeekableStreamSupervisorIOConfig ioConfig)
createTaskIoConfig in class SeekableStreamSupervisor<Integer,Long>protected List<SeekableStreamIndexTask<Integer,Long>> createIndexTasks(int replicas, String baseSequenceName, com.fasterxml.jackson.databind.ObjectMapper sortingMapper, TreeMap<Integer,Map<Integer,Long>> sequenceOffsets, SeekableStreamIndexTaskIOConfig taskIoConfig, SeekableStreamIndexTaskTuningConfig taskTuningConfig, RowIngestionMetersFactory rowIngestionMetersFactory) throws com.fasterxml.jackson.core.JsonProcessingException
createIndexTasks in class SeekableStreamSupervisor<Integer,Long>com.fasterxml.jackson.core.JsonProcessingExceptionprotected Map<Integer,Long> getLagPerPartition(Map<Integer,Long> currentOffsets)
getLagPerPartition in class SeekableStreamSupervisor<Integer,Long>protected KafkaDataSourceMetadata createDataSourceMetaDataForReset(String topic, Map<Integer,Long> map)
createDataSourceMetaDataForReset in class SeekableStreamSupervisor<Integer,Long>protected OrderedSequenceNumber<Long> makeSequenceNumber(Long seq, boolean isExclusive)
makeSequenceNumber in class SeekableStreamSupervisor<Integer,Long>protected Long getNotSetMarker()
getNotSetMarker in class SeekableStreamSupervisor<Integer,Long>protected Long getEndOfPartitionMarker()
getEndOfPartitionMarker in class SeekableStreamSupervisor<Integer,Long>protected boolean isEndOfShard(Long seqNum)
isEndOfShard in class SeekableStreamSupervisor<Integer,Long>protected boolean useExclusiveStartSequenceNumberForNonFirstSequence()
useExclusiveStartSequenceNumberForNonFirstSequence in class SeekableStreamSupervisor<Integer,Long>protected void updateLatestSequenceFromStream(RecordSupplier<Integer,Long> recordSupplier, Set<StreamPartition<Integer>> partitions)
updateLatestSequenceFromStream in class SeekableStreamSupervisor<Integer,Long>protected String baseTaskName()
baseTaskName in class SeekableStreamSupervisor<Integer,Long>public KafkaSupervisorIOConfig getIoConfig()
getIoConfig in class SeekableStreamSupervisor<Integer,Long>Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.