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/05/29 16:36:15 UTC

Review Request 34811: Alert Provider Does Not Return Results Paginated From An Offset

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

Review request for Ambari, Nate Cole and Tom Beerbower.


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


Repository: ambari


Description
-------

When requesting the current alerts for a cluster, the following URL returns no results even if there are alerts which would match the pagination criteria:

{{api/v1/clusters/c1/alerts?fields=*&Alert/state.in(CRITICAL,WARNING)&Alert/maintenance_state.in(OFF)&from=10&page_size=10}}

However, the following URL does return alerts:

{{api/v1/clusters/c1/alerts?fields=*&Alert/state.in(CRITICAL,WARNING)&Alert/maintenance_state.in(OFF)&page_size=10}}

The backend DAO is correctly processing the predicate into a JPA predicate, however the result set is being trimmed in memory before being returned from the query.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProvider.java f21c4ab 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java a25cba0 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java 0c4942e 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProviderTest.java 0367dd3 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertResourceProviderTest.java 5459a8c 

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


Testing
-------

mvn clean test


Thanks,

Jonathan Hurley


Re: Review Request 34811: Alert Provider Does Not Return Results Paginated From An Offset

Posted by Tom Beerbower <tb...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34811/#review85730
-----------------------------------------------------------

Ship it!


Looks good.

- Tom Beerbower


On May 29, 2015, 2:36 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34811/
> -----------------------------------------------------------
> 
> (Updated May 29, 2015, 2:36 p.m.)
> 
> 
> Review request for Ambari, Nate Cole and Tom Beerbower.
> 
> 
> Bugs: AMBARI-11520
>     https://issues.apache.org/jira/browse/AMBARI-11520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> When requesting the current alerts for a cluster, the following URL returns no results even if there are alerts which would match the pagination criteria:
> 
> {{api/v1/clusters/c1/alerts?fields=*&Alert/state.in(CRITICAL,WARNING)&Alert/maintenance_state.in(OFF)&from=10&page_size=10}}
> 
> However, the following URL does return alerts:
> 
> {{api/v1/clusters/c1/alerts?fields=*&Alert/state.in(CRITICAL,WARNING)&Alert/maintenance_state.in(OFF)&page_size=10}}
> 
> The backend DAO is correctly processing the predicate into a JPA predicate, however the result set is being trimmed in memory before being returned from the query.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProvider.java f21c4ab 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java a25cba0 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java 0c4942e 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProviderTest.java 0367dd3 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertResourceProviderTest.java 5459a8c 
> 
> Diff: https://reviews.apache.org/r/34811/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>


Re: Review Request 34811: Alert Provider Does Not Return Results Paginated From An Offset

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

Ship it!


Ship It!

- Nate Cole


On May 29, 2015, 10:36 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34811/
> -----------------------------------------------------------
> 
> (Updated May 29, 2015, 10:36 a.m.)
> 
> 
> Review request for Ambari, Nate Cole and Tom Beerbower.
> 
> 
> Bugs: AMBARI-11520
>     https://issues.apache.org/jira/browse/AMBARI-11520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> When requesting the current alerts for a cluster, the following URL returns no results even if there are alerts which would match the pagination criteria:
> 
> {{api/v1/clusters/c1/alerts?fields=*&Alert/state.in(CRITICAL,WARNING)&Alert/maintenance_state.in(OFF)&from=10&page_size=10}}
> 
> However, the following URL does return alerts:
> 
> {{api/v1/clusters/c1/alerts?fields=*&Alert/state.in(CRITICAL,WARNING)&Alert/maintenance_state.in(OFF)&page_size=10}}
> 
> The backend DAO is correctly processing the predicate into a JPA predicate, however the result set is being trimmed in memory before being returned from the query.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProvider.java f21c4ab 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java a25cba0 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java 0c4942e 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProviderTest.java 0367dd3 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertResourceProviderTest.java 5459a8c 
> 
> Diff: https://reviews.apache.org/r/34811/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>