Support recursive option and limits when getting activities#756
Merged
asfgit merged 9 commits intoapache:masterfrom Jul 22, 2017
Merged
Support recursive option and limits when getting activities#756asfgit merged 9 commits intoapache:masterfrom
asfgit merged 9 commits intoapache:masterfrom
Conversation
Contributor
Author
|
retest this please |
Contributor
Author
|
weird unrelated build failure at https://builds.apache.org/job/brooklyn-server-pull-requests/2396/console, new retest this please |
Contributor
Author
|
another unrelated failure retest this please |
aledsage
reviewed
Jul 14, 2017
| } | ||
|
|
||
|
|
||
| public static void dumpInfo(Task<?> t) { |
Contributor
There was a problem hiding this comment.
Minor (and not for this PR): we should probably move this stuff into a separate Dumper utility class, rather than Entities and Tasks being a dumping ground for lots of stuff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See
ActivityApiandEntityApiwhere this adds better support for recursive task fetching, and an optionallimitquery parameter with default of 200 tasks; long lists of tasks are painful in the UI and on the server. Recursive task call also has optionalmaxDepth(default unlimited).This affects backwards compatibility if clients expect all tasks to be returned from these expensive calls, but they shouldn't.
Pagination
This does not go so far as to support pagination but that would not be hard and we should start thining about it. One strategy I like is to have two optional parameters,
itemToContinueAfterandcountToContinueAfter, as follows, assuming the data isA,B,C.Obvious things:
limit=1anditemToContinueAfter=B: gives[C]limit=1andcountToContinueAfter=2: gives[C]If
Ais deleted:limit=1anditemToContinueAfter=B: gives[C]limit=1andcountToContinueAfter=2: gives[]If
Ais present butBis deleted:limit=1anditemToContinueAfter=B: gives[A](restarts if item is missing)limit=1andcountToContinueAfter=2: gives[]If both
itemandcountare supplied we useitemif it is present, otherwise we usecount. This lets clients do well when working with a changing list, paging forwards will continue from the previous item, never skipping anything unless that previous item was deleted in which rare case it skips some some but it doesn't completely restart.(Are there better strategies? The benefit here is that it is simple for both client and server.)