Package org.apache.druid.metadata
Class SQLMetadataSupervisorManager
java.lang.Object
org.apache.druid.metadata.SQLMetadataSupervisorManager
- All Implemented Interfaces:
MetadataSupervisorManager
-
Constructor Summary
ConstructorsConstructorDescriptionSQLMetadataSupervisorManager(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, SQLMetadataConnector connector, com.google.common.base.Supplier<MetadataStorageTablesConfig> dbTables) -
Method Summary
Modifier and TypeMethodDescriptiongetAll()getAllForId(String id, Integer limit) Get supervisor history for a given supervisor ID with an optional limitReturn latest supervisors (both active and terminated)Only return the latest active supervisorsOnly return the latest terminated supervisorsvoidinsert(String id, SupervisorSpec spec) intremoveTerminatedSupervisorsOlderThan(long timestamp) Remove terminated supervisors created before the given timestamp.voidstart()
-
Constructor Details
-
SQLMetadataSupervisorManager
@Inject public SQLMetadataSupervisorManager(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, SQLMetadataConnector connector, com.google.common.base.Supplier<MetadataStorageTablesConfig> dbTables)
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceMetadataSupervisorManager
-
insert
- Specified by:
insertin interfaceMetadataSupervisorManager
-
getAll
- Specified by:
getAllin interfaceMetadataSupervisorManager
-
getAllForId
public List<VersionedSupervisorSpec> getAllForId(String id, @Nullable Integer limit) throws IllegalArgumentException Description copied from interface:MetadataSupervisorManagerGet supervisor history for a given supervisor ID with an optional limit- Specified by:
getAllForIdin interfaceMetadataSupervisorManager- Parameters:
id- the supervisor IDlimit- maximum number of history entries to return (null for all entries)- Returns:
- list of versioned supervisor specs for the given ID
- Throws:
IllegalArgumentException
-
getLatest
Description copied from interface:MetadataSupervisorManagerReturn latest supervisors (both active and terminated)- Specified by:
getLatestin interfaceMetadataSupervisorManager- Returns:
- latest terminated supervisors
-
getLatestActiveOnly
Description copied from interface:MetadataSupervisorManagerOnly return the latest active supervisors- Specified by:
getLatestActiveOnlyin interfaceMetadataSupervisorManager- Returns:
- latest active supervisors
-
getLatestTerminatedOnly
Description copied from interface:MetadataSupervisorManagerOnly return the latest terminated supervisors- Specified by:
getLatestTerminatedOnlyin interfaceMetadataSupervisorManager- Returns:
- latest terminated supervisors
-
removeTerminatedSupervisorsOlderThan
public int removeTerminatedSupervisorsOlderThan(long timestamp) Description copied from interface:MetadataSupervisorManagerRemove terminated supervisors created before the given timestamp.- Specified by:
removeTerminatedSupervisorsOlderThanin interfaceMetadataSupervisorManager- Parameters:
timestamp- timestamp in milliseconds- Returns:
- number of supervisor removed
-