Interface Supervisor
-
public interface Supervisor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcheckpoint(int taskGroupId, DataSourceMetadata checkpointMetadata)The definition of checkpoint is not very strict as currently it does not affect data or control path.LagStatscomputeLagStats()Computes maxLag, totalLag and avgLagSet<String>getActiveRealtimeSequencePrefixes()intgetActiveTaskGroupsCount()default List<org.apache.druid.segment.incremental.ParseExceptionReport>getParseErrors()SupervisorStateManager.StategetState()default Map<String,Map<String,Object>>getStats()SupervisorReportgetStatus()default BooleanisHealthy()voidreset(DataSourceMetadata dataSourceMetadata)Resets all offsets for a dataSource.voidresetOffsets(DataSourceMetadata resetDataSourceMetadata)Reset offsets with provided dataSource metadata.voidstart()voidstop(boolean stopGracefully)
-
-
-
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.
-
getStatus
SupervisorReport getStatus()
-
getState
SupervisorStateManager.State getState()
-
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 checkpointingcheckpointMetadata- metadata for the sequence to currently checkpoint
-
computeLagStats
LagStats computeLagStats()
Computes maxLag, totalLag and avgLag
-
getActiveTaskGroupsCount
int getActiveTaskGroupsCount()
-
-