You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jonathan Hurley <jh...@hortonworks.com> on 2015/01/03 21:44:54 UTC

Review Request 29563: Include Maintenance Mode Counts in Summary Alert Renderers

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29563/
-----------------------------------------------------------

Review request for Ambari and Nate Cole.


Bugs: AMBARI-8982
    https://issues.apache.org/jira/browse/AMBARI-8982


Repository: ambari


Description
-------

Add support for summary renderers like ?format=groupedSummary to handle status when instances are in maintenance mode.

{code}
{
  "href" : "http://localhost:8080/api/v1/clusters/c1/alerts?format=groupedSummary&Alert/definition_id=6",
  "alerts_summary_grouped" : [
    {
      "definition_id" : 6,
      "definition_name" : "falcon_server_webui",
      "summary" : {
        "OK" : {
          "count" : 0,
          "original_timestamp" : 1420061195766,
          "maintenance_count" : 1
        },
        "WARNING" : {
          "count" : 0,
          "original_timestamp" : 0,
          "maintenance_count" : 0
        },
        "CRITICAL" : {
          "count" : 0,
          "original_timestamp" : 0,
          "maintenance_count" : 0
        },
        "UNKNOWN" : {
          "count" : 0,
          "original_timestamp" : 0,
          "maintenance_count" : 0
        }
      }
    }
  ]
}
{code}

The status for an instance is still the status for that instance: crit, ok or warn. It's just whether that instance is in MM. 


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryGroupedRenderer.java 52608b2 
  ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryRenderer.java 48098e1 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java b339130 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertResourceProviderTest.java c1e7576 

Diff: https://reviews.apache.org/r/29563/diff/


Testing
-------

mvn clean test


Thanks,

Jonathan Hurley


Re: Review Request 29563: Include Maintenance Mode Counts in Summary Alert Renderers

Posted by Jonathan Hurley <jh...@hortonworks.com>.

> On Jan. 5, 2015, 8:52 a.m., Nate Cole wrote:
> > Only one minor comment, discretion to address now or later or never.

Thanks for the review!


> On Jan. 5, 2015, 8:52 a.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryGroupedRenderer.java, line 166
> > <https://reviews.apache.org/r/29563/diff/1/?file=806108#file806108line166>
> >
> >     Seems strange to name this a plural when it's a singular value?

Naming methods & variables properly is big step to having others understand your code and normally I'd agree and change this. However, for this case, I think the name is correct; it's the values (count, time, mm_count) associated with a given alert state.


- Jonathan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29563/#review66640
-----------------------------------------------------------


On Jan. 3, 2015, 3:44 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29563/
> -----------------------------------------------------------
> 
> (Updated Jan. 3, 2015, 3:44 p.m.)
> 
> 
> Review request for Ambari and Nate Cole.
> 
> 
> Bugs: AMBARI-8982
>     https://issues.apache.org/jira/browse/AMBARI-8982
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Add support for summary renderers like ?format=groupedSummary to handle status when instances are in maintenance mode.
> 
> {code}
> {
>   "href" : "http://localhost:8080/api/v1/clusters/c1/alerts?format=groupedSummary&Alert/definition_id=6",
>   "alerts_summary_grouped" : [
>     {
>       "definition_id" : 6,
>       "definition_name" : "falcon_server_webui",
>       "summary" : {
>         "OK" : {
>           "count" : 0,
>           "original_timestamp" : 1420061195766,
>           "maintenance_count" : 1
>         },
>         "WARNING" : {
>           "count" : 0,
>           "original_timestamp" : 0,
>           "maintenance_count" : 0
>         },
>         "CRITICAL" : {
>           "count" : 0,
>           "original_timestamp" : 0,
>           "maintenance_count" : 0
>         },
>         "UNKNOWN" : {
>           "count" : 0,
>           "original_timestamp" : 0,
>           "maintenance_count" : 0
>         }
>       }
>     }
>   ]
> }
> {code}
> 
> The status for an instance is still the status for that instance: crit, ok or warn. It's just whether that instance is in MM. 
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryGroupedRenderer.java 52608b2 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryRenderer.java 48098e1 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java b339130 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertResourceProviderTest.java c1e7576 
> 
> Diff: https://reviews.apache.org/r/29563/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>


Re: Review Request 29563: Include Maintenance Mode Counts in Summary Alert Renderers

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29563/#review66640
-----------------------------------------------------------

Ship it!


Only one minor comment, discretion to address now or later or never.


ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryGroupedRenderer.java
<https://reviews.apache.org/r/29563/#comment110206>

    Seems strange to name this a plural when it's a singular value?


- Nate Cole


On Jan. 3, 2015, 3:44 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29563/
> -----------------------------------------------------------
> 
> (Updated Jan. 3, 2015, 3:44 p.m.)
> 
> 
> Review request for Ambari and Nate Cole.
> 
> 
> Bugs: AMBARI-8982
>     https://issues.apache.org/jira/browse/AMBARI-8982
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Add support for summary renderers like ?format=groupedSummary to handle status when instances are in maintenance mode.
> 
> {code}
> {
>   "href" : "http://localhost:8080/api/v1/clusters/c1/alerts?format=groupedSummary&Alert/definition_id=6",
>   "alerts_summary_grouped" : [
>     {
>       "definition_id" : 6,
>       "definition_name" : "falcon_server_webui",
>       "summary" : {
>         "OK" : {
>           "count" : 0,
>           "original_timestamp" : 1420061195766,
>           "maintenance_count" : 1
>         },
>         "WARNING" : {
>           "count" : 0,
>           "original_timestamp" : 0,
>           "maintenance_count" : 0
>         },
>         "CRITICAL" : {
>           "count" : 0,
>           "original_timestamp" : 0,
>           "maintenance_count" : 0
>         },
>         "UNKNOWN" : {
>           "count" : 0,
>           "original_timestamp" : 0,
>           "maintenance_count" : 0
>         }
>       }
>     }
>   ]
> }
> {code}
> 
> The status for an instance is still the status for that instance: crit, ok or warn. It's just whether that instance is in MM. 
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryGroupedRenderer.java 52608b2 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/AlertSummaryRenderer.java 48098e1 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java b339130 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertResourceProviderTest.java c1e7576 
> 
> Diff: https://reviews.apache.org/r/29563/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>