Skip to content

DRILL-4258: Add threads, fragments, and queries system tables#479

Open
StevenMPhillips wants to merge 1 commit intoapache:masterfrom
StevenMPhillips:drill-4258
Open

DRILL-4258: Add threads, fragments, and queries system tables#479
StevenMPhillips wants to merge 1 commit intoapache:masterfrom
StevenMPhillips:drill-4258

Conversation

@StevenMPhillips
Copy link
Copy Markdown
Contributor

Here are the pojos that represent the data for the new system tables:

  public static class FragmentInfo {
    public String hostname;
    public String queryId;
    public int majorFragmentId;
    public int minorFragmentId;
    public Long memoryUsage;
    /**
     * The maximum number of input records across all Operators in fragment
     */
    public Long rowsProcessed;
    public Timestamp startTime;
  }
  public static class ThreadSummary {
    /**
     * The Drillbit hostname
     */
    public String hostname;

    /**
     * The Drillbit user port
     */
    public long user_port;
    public String threadName;
    public long threadId;
    public boolean inNative;
    public boolean suspended;
    public String threadState;
    /**
     * Thread cpu time during last second. Between 0 and 100
     */
    public Integer cpuTime;
    /**
     * Thread user cpu time during last second. Between 0 and 100
     */
    public Integer userTime;
    public String stackTrace;
  }
  public static class QueryInfo {
    /**
     * The host where foreman is running
     */
    public String foreman;
    /**
     * User who submitted query
     */
    public String user;
    public String queryId;
    /**
     * Query sql string
     */
    public String query;
    public Timestamp startTime;
  }

I did not include data in the query table which can be obtained from the fragments table and doing a join on the queryId.

import java.util.Map.Entry;
import java.util.concurrent.ConcurrentLinkedDeque;

public class ThreadStatCollector implements Runnable {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a thread (WorkManager.StatusThread) that does periodic tasks (currently updates fragment statuses), how about we add this as another task?

@cgivre cgivre added the revisit label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants