incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Beerbower (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-1408) Add SPI support for specifying order of resources and metrics in results
Date Tue, 12 Feb 2013 19:09:12 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13576899#comment-13576899
] 

Tom Beerbower commented on AMBARI-1408:
---------------------------------------

One possible way would be to support an alternate signature to the ResourceProvider get()
method that takes Comparator(s) to order the set of returned resources and the properties/metrics
within each resource ...

{code}
/**
   * Get a set of {@link Resource resources} based on the given request and predicate
   * information.
   * ...
   *
   *
   * @param request             the request object which defines the desired set of 
   *                            properties
   * @param predicate           the predicate object which can be used to filter which
   *                            resources are returned
   * @param resourceComparator  a comparator used to order the returned resource set
   * @param propertyComparator  a comparator used to order the properties within each 
   *                            returned resource
   *
   * @return a set of resources based on the given request and predicate information
   *
   * @throws SystemException an internal system exception occurred
   * @throws UnsupportedPropertyException the request contains unsupported property ids
   * @throws NoSuchResourceException the requested resource instance doesn't exist
   * @throws NoSuchParentResourceException a parent resource of the requested resource doesn't
exist
   */
  public Set<Resource> getResources(Request request, Predicate predicate, 
                                    Comparator<Resource> resourceComparator, 
                                    Comparator<Map.Entry<String, Object>> propertyComparator)
      throws SystemException,
      UnsupportedPropertyException,
      NoSuchResourceException,
      NoSuchParentResourceException;
{code} 
                
> Add SPI support for specifying order of resources and metrics in results
> ------------------------------------------------------------------------
>
>                 Key: AMBARI-1408
>                 URL: https://issues.apache.org/jira/browse/AMBARI-1408
>             Project: Ambari
>          Issue Type: Sub-task
>    Affects Versions: 1.3.0
>            Reporter: Tom Beerbower
>            Assignee: Tom Beerbower
>             Fix For: 1.3.0
>
>
> Currently a get() call through a resource provider returns a set of resources, each containing
a map of properties/metrics. There is no way currently to specify order.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message