Interface Supervisor


  • public interface Supervisor
    • Method Detail

      • start

        void start()
      • stop

        void stop​(boolean stopGracefully)
        Parameters:
        stopGracefully - If true, supervisor will cleanly shutdown managed tasks if possible (for example signalling them to publish their segments and exit). The implementation may block until the tasks have either acknowledged or completed. If false, supervisor will stop immediately and leave any running tasks as they are.
      • getParseErrors

        default List<org.apache.druid.segment.incremental.ParseExceptionReport> getParseErrors()
      • reset

        void reset​(DataSourceMetadata dataSourceMetadata)
        Resets all offsets for a dataSource.
        Parameters:
        dataSourceMetadata - optional dataSource metadata.
      • resetOffsets

        void resetOffsets​(DataSourceMetadata resetDataSourceMetadata)
        Reset offsets with provided dataSource metadata. The resulting stored offsets should be a union of existing checkpointed offsets with provided offsets.
        Parameters:
        resetDataSourceMetadata - required datasource metadata with offsets to reset.
        Throws:
        org.apache.druid.error.DruidException - if any metadata attribute doesn't match the supervisor's state.
      • checkpoint

        void checkpoint​(int taskGroupId,
                        DataSourceMetadata checkpointMetadata)
        The definition of checkpoint is not very strict as currently it does not affect data or control path. On this call Supervisor can potentially checkpoint data processed so far to some durable storage for example - Kafka/Kinesis Supervisor uses this to merge and handoff segments containing at least the data represented by {@param currentCheckpoint} DataSourceMetadata
        Parameters:
        taskGroupId - unique Identifier to figure out for which sequence to do checkpointing
        checkpointMetadata - metadata for the sequence to currently checkpoint
      • computeLagStats

        LagStats computeLagStats()
        Computes maxLag, totalLag and avgLag
      • getActiveTaskGroupsCount

        int getActiveTaskGroupsCount()
      • getActiveRealtimeSequencePrefixes

        Set<String> getActiveRealtimeSequencePrefixes()
        Returns:
        active sequence prefixes for reading and pending completion task groups of a seekable stream supervisor