You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Tom Beerbower (JIRA)" <ji...@apache.org> on 2013/02/12 20:09:12 UTC
[jira] [Commented] (AMBARI-1408) Add SPI support for specifying
order of resources and metrics in results
[ 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