Per previous discussions in some design documents for
YARN-2928, the basic scenario is the query for stats can happen on:
- Application level, expect return: an application with aggregated stats
- Flow level, expect return: aggregated stats for a flow_run, flow_version and flow
- User level, expect return: aggregated stats for applications submitted by user
- Queue level, expect return: aggregated stats for applications within the Queue
Application states is the basic building block for all other level aggregations. We can provide Flow/User/Queue level aggregated statistics info based on application states (a dedicated table for application states is needed which is missing from previous design documents like HBase/Phoenix schema design).