Interface ThreadResourceUsageAccountant

    • Method Detail

      • clear

        void clear()
        clear thread accounting info when a task finishes execution on a thread
      • isAnchorThreadInterrupted

        boolean isAnchorThreadInterrupted()
        check if the corresponding anchor thread of current thread is interrupted so that when we preempt a task we only call interrupt on the anchor thread
      • createExecutionContext

        void createExecutionContext​(String queryId,
                                    int taskId,
                                    @Nullable
                                    ThreadExecutionContext parentContext)
        Task tracking info
        Parameters:
        queryId - query id string
        taskId - a unique task id
        parentContext - the parent execution context, null for root(runner) thread
      • getThreadExecutionContext

        ThreadExecutionContext getThreadExecutionContext()
        get the executon context of current thread
      • setThreadResourceUsageProvider

        void setThreadResourceUsageProvider​(ThreadResourceUsageProvider threadResourceUsageProvider)
        set resource usage provider
      • sampleUsage

        void sampleUsage()
        call to sample usage
      • startWatcherTask

        void startWatcherTask()
        start the periodical task
      • getErrorStatus

        Exception getErrorStatus()
        get error status if the query is preempted
        Returns:
        empty string if N/A