Class OverlordClientImpl

    • Constructor Detail

      • OverlordClientImpl

        public OverlordClientImpl​(ServiceClient client,
                                  com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
    • Method Detail

      • findCurrentLeader

        public com.google.common.util.concurrent.ListenableFuture<URI> findCurrentLeader()
        Description copied from interface: OverlordClient
        Contact the Overlord that we believe to be the leader, and return the result of its /druid/indexer/v1/leader API. This may be a different Overlord server than the one we contacted, if a leader change happened since the last time we updated our sense of who the leader is.
        Specified by:
        findCurrentLeader in interface OverlordClient
      • runTask

        public com.google.common.util.concurrent.ListenableFuture<Void> runTask​(String taskId,
                                                                                Object taskObject)
        Description copied from interface: OverlordClient
        Run a task with the provided ID and payload. The payload must be convertible by an ObjectMapper into a Task object. This method does not take Task objects directly, because Task is in the indexing-service package.
        Specified by:
        runTask in interface OverlordClient
        Parameters:
        taskId - task ID
        taskObject - task payload
      • cancelTask

        public com.google.common.util.concurrent.ListenableFuture<Void> cancelTask​(String taskId)
        Description copied from interface: OverlordClient
        Cancel a task.
        Specified by:
        cancelTask in interface OverlordClient
        Parameters:
        taskId - task ID
      • taskStatuses

        public com.google.common.util.concurrent.ListenableFuture<org.apache.druid.java.util.common.parsers.CloseableIterator<org.apache.druid.indexer.TaskStatusPlus>> taskStatuses​(@Nullable
                                                                                                                                                                                     String state,
                                                                                                                                                                                     @Nullable
                                                                                                                                                                                     String dataSource,
                                                                                                                                                                                     @Nullable
                                                                                                                                                                                     Integer maxCompletedTasks)
        Description copied from interface: OverlordClient
        Return TaskStatusPlus for all tasks matching a set of optional search parameters. Complete tasks are returned in descending order by creation timestamp. Active tasks are returned in no particular order.
        Specified by:
        taskStatuses in interface OverlordClient
        Parameters:
        state - task state: may be "pending", "waiting", "running", or "complete"
        dataSource - datasource
        maxCompletedTasks - maximum number of completed tasks to return. If zero, no complete tasks are returned. If null, all complete tasks within druid.indexer.storage.recentlyFinishedThreshold are returned. This parameter does not affect the number of active tasks returned.
        Returns:
        list of tasks that match the search parameters
      • taskStatuses

        public com.google.common.util.concurrent.ListenableFuture<Map<String,​org.apache.druid.indexer.TaskStatus>> taskStatuses​(Set<String> taskIds)
        Description copied from interface: OverlordClient
        Return TaskStatus for a set of task IDs.
        Specified by:
        taskStatuses in interface OverlordClient
        Parameters:
        taskIds - task IDs
        Returns:
        map of task ID to status for known tasks. Unknown tasks are not included in the returned map.
      • findLockedIntervals

        public com.google.common.util.concurrent.ListenableFuture<Map<String,​List<org.joda.time.Interval>>> findLockedIntervals​(List<LockFilterPolicy> lockFilterPolicies)
        Description copied from interface: OverlordClient
        Returns a list of intervals locked by higher priority conflicting lock types
        Specified by:
        findLockedIntervals in interface OverlordClient
        Parameters:
        lockFilterPolicies - List of all filters for different datasources
        Returns:
        Map from datasource name to list of intervals locked by tasks that have a conflicting lock type with priority greater than or equal to the minTaskPriority for that datasource.
      • taskReportAsMap

        public com.google.common.util.concurrent.ListenableFuture<Map<String,​Object>> taskReportAsMap​(String taskId)
        Description copied from interface: OverlordClient
        Returns the report object for a task as a map. Certain task types offer live reports; for these task types, this method may return a task report while the task is running. Certain task types only write reports upon successful completion. Certain other task types do not write reports at all. Returns a HttpResponseException with code Response.Status.NOT_FOUND if there is no report available for some reason.
        Specified by:
        taskReportAsMap in interface OverlordClient
      • supervisorStatuses

        public com.google.common.util.concurrent.ListenableFuture<org.apache.druid.java.util.common.parsers.CloseableIterator<SupervisorStatus>> supervisorStatuses()
        Description copied from interface: OverlordClient
        Returns all current supervisor statuses.
        Specified by:
        supervisorStatuses in interface OverlordClient
      • killPendingSegments

        public com.google.common.util.concurrent.ListenableFuture<Integer> killPendingSegments​(String dataSource,
                                                                                               org.joda.time.Interval interval)
        Description copied from interface: OverlordClient
        Deletes pending segment records from the metadata store for a particular datasource. Records with created_date within the provided interval are deleted; other records are left alone. Deletion is done synchronously with the API call. When the future resolves, the deletion is complete.
        Specified by:
        killPendingSegments in interface OverlordClient
        Parameters:
        dataSource - datasource name
        interval - created time interval
        Returns:
        number of pending segments deleted