-
Notifications
You must be signed in to change notification settings - Fork 8
JCLOUDS-624 - Fixed bug in ListNodes #47
JCLOUDS-624 - Fixed bug in ListNodes #47
Conversation
jclouds » jclouds-chef #1171 SUCCESS |
jclouds-chef-pull-requests #109 SUCCESS |
Thanks @luciano-sabenca-movile! A couple comments:
|
Hi, @nacx ! So, just to explain my thoughts:
Regards |
What I see is that the logic in the base class is very tied to the logic of the concrete strategy itself. It has the The concrete strategy class only performs the "list" operation, and I can't think about a different strategy that could take benefit from using only the base class, therefore my feeling that this is kind of a premature optimization that is just adding unnecessary complexity given the existing implementations of the strategies. Anyway, there's no need to change it now :) Let's change the unnecessary methods from the interface and let's see if someone else has something to say. |
jclouds » jclouds-chef #1174 SUCCESS |
jclouds-chef-pull-requests #110 SUCCESS |
Ok, @nacx! No problem :-) ! I really enjoy this this kind of debate, they are is very insightful! I've committed the changes in the interface! If we merge it in the main repository, I think that is a good idea squash these commits in a single one, but this is a point for the future. |
I meant to remove all methods that accept a It does not make sense to have an interface with a generic executor and a concrete one. It is like having an interface that has two methods, one accepting a List and one accepting an ArrayList. |
Yes, you are right, @nacx ! It was my fault!, I'm sorry about it! It makes no sense keep those methods in the interface. Thanks! |
jclouds-chef-pull-requests #111 SUCCESS |
jclouds » jclouds-chef #1185 SUCCESS |
Thanks for the cleanup @luciano-sabenca-movile! I've checked out the code and now I understand those base classes. They are reused in the strategies that list all entities, and in strategies that list only the entities in one environment. My concerns were because I thought there were only used by one class, thus my comments about the premature optimization. Other strategies don't have the logic in an abstract base class, so it is OK. There are a couple things left before merging the PR:
The PR looks good, and once these small bits are fixed I'll merge it. Thanks! |
jclouds » jclouds-chef #1187 SUCCESS |
Oh, the remaining methods in In fact, the reason to create these abstracts base class is to apply the same operations but in distinct sets. |
jclouds-chef-pull-requests #112 SUCCESS |
Thanks @luciano-sabenca-movile! Changes lgtm. |
Of course! I will do this right now! |
Ok. Done! |
*/ | ||
Iterable<? extends Node> listNodesConcurrently(ExecutorService executorService); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] Remove blank line?
jclouds-chef-pull-requests #113 SUCCESS |
@SinceApiVersion("0.10.0") | ||
Iterable<? extends Node> listNodesInEnvironmentConcurrently( | ||
ExecutorService executorService, String environmentName | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above.
jclouds » jclouds-chef #1188 SUCCESS |
*/ | ||
Iterable<? extends Client> listClientsConcurrently(ExecutorService executorService); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] Remove blank line
@luciano-sabenca-movile Thanks for submitting this! I don't want to disrupt this PR at this late stage, since we can always follow up with another one. Just three main comments:
I like the fact we're allowing the user to provide the executor, by the way! @nacx Thoughts..? |
PS: I'm guessing this is the new version of #46, by the way..? |
Note that the methods in the strategy interfaces that accepted an executor were already there. it's not an addition but a generalization.
It's not urgent :) I'd like to have this in before moving Chef to the main site, but I prefer to have an agreement first on how we want things to look like. |
After the recent discussion, I think we could add some final changes to leave things consistent and easier to use for end users:
So given that client changes will be required for those users that still want to get benefit of concurrency, I think it is OK to apply the options change in the interfaces, at least to remove the "async" stuff from them. I'd suggesto to:
Existing methods will still work, but without concurrency, but getting things done concurrently would require client changes anyway, so I think it is worth the change and it will leave the interfaces in a cleaner status (and allow us to easily improve them when needed). @demobox @luciano-sabenca-movile WDYT? |
The suggestion looks good to me (unsurprisingly ;-)), but if we feel it's too much work at this late stage for something that won't be around for that long anyway, I'd also be OK with dropping the Options object and simply having an ExecutorService argument at the end of the overloaded method. At the very least, we could decouple the two steps and do the simple method renaming (i.e. dropping "xxxConcurrently") first, then considering the Options refactoring in a separate PR. |
I've thought about this a bit more this weekend, and I think it should be better to just address the renaming of the *Concurrently methods now. We're about to release 1.8.0, and it would be ideal if jclouds-chef could be merged into the main repo for the release. With the renaming change, the feature will be completed and without backwards incompatible changes, so it looks like a good plan just to complete the PR with the renaming, then move jclouds-chef to the main repo, and consider the ListOptions thing after the release. Are you OK with this @demobox @luciano-sabenca-movile? |
@demobox, @nacx, very nice discussion :-)!
I agree with the solution! It seems very good to me! About the simpler solution to release 1.8.0, I think that is a good way to address it. It is important release version 1.8.0 with this bug fixed, because this one invalidates important methods( |
Let's do this then. Rename the methods to remove the "Concurrently" prefix and address the options thing after 1.8.0 in the main jclouds repo. |
jclouds » jclouds-chef #1198 FAILURE |
jclouds-chef-pull-requests #114 FAILURE |
To fix this bug, I used the approach debated in the above issue: create new methods to do the operation using an ExecutorService provided by the user.The the old methods are still working, but now the operations in those methods are not concurrent anymore.
jclouds » jclouds-chef #1199 SUCCESS |
jclouds-chef-pull-requests #115 SUCCESS |
Thanks @luciano-sabenca-movile! Changes lgtm. @demobox goot to merge? |
Commited to master. Thanks! |
@@ -168,20 +175,44 @@ | |||
Iterable<? extends Node> listNodesInEnvironment(String environmentName); | |||
|
|||
/** | |||
* Lists the details of all existing nodes in the given environment, using the ExecutorService to paralleling the execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] "to parallelize"
Thanks, @luciano-sabenca-movile and @nacx! Just some minor follow-up comments. Thanks for waiting for me - it's taken a bit longer to get back to this than I had hoped... ;-) |
In fact it is already merged :) But will address the comments post 1.8, as all are minors. |
I know...I meant: "Thank you for giving me so much time before merging" ;-) |
Details can be found at: https://issues.apache.org/jira/browse/JCLOUDS-624
Any suggestions are very welcome!
To fix this bug, I used the approach debated in the above link: create
new methods to do the operation using an ExecutorService provided by the
user.The the old methods are still working, but now the operations in
these methods are not concurrent anymore!