ComputationResources Method Implementations for REST API#4
Conversation
MikeNeilson
left a comment
There was a problem hiding this comment.
Definitely a solid idea with the CompRefFilter, but it should derive (in the general and literal sense) from the standard mechanisms of Java.
| * @param filter the computation filter containing app and algorithm IDs | ||
| * @return List of computations | ||
| */ | ||
| List<DbComputation> listCompRefsForREST(CompRefFilter filter) |
There was a problem hiding this comment.
Seems like this should really just take a Predicate, you're implementation above should then derive from Predicate
There was a problem hiding this comment.
Also we can just name this listCompRefsMatching. This is also useful outside the REST API.
There was a problem hiding this comment.
Renamed and added predicates to the filter class
| List<DbComputation> ret = new ArrayList<>(); | ||
| for (DbObjectCache<DbComputation>.CacheIterator it = compCache.iterator(); it.hasNext(); ) | ||
| { | ||
| DbComputation comp = it.next(); |
There was a problem hiding this comment.
Yeah, it seems like this loop should just take the predicate and use it.
There was a problem hiding this comment.
Simplified to use predicate from filter class
…tor-integration-fixtures_computation_resources
500efb2 to
d9cdd7f
Compare
Problem Description
Fixes #221.
Solution
Implemented new methods to support reference retrieval filtering.
how you tested the change
Tested with REST API against OpenTSDB.
Where the following done:
(Formerly called regression tests.)
If you aren't sure leave unchecked and we will help guide you to want needs changing where.