You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Ladislav Thon <no...@github.com> on 2016/07/01 14:15:21 UTC
[jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
The implementation is now O(1) in the number of existing cloud services
instead of O(N). This is achieved by assuming that deployment name
is the same as cloud service name, which is true for all nodes created
by JClouds Azure provider.
You can view, comment on, or merge this pull request online at:
https://github.com/jclouds/jclouds-labs/pull/294
-- Commit Summary --
* [JCLOUDS-1135] improve performance of AzureComputeServiceAdapter.getNode
-- File Changes --
M azurecompute/src/main/java/org/jclouds/azurecompute/compute/AzureComputeServiceAdapter.java (33)
-- Patch Links --
https://github.com/jclouds/jclouds-labs/pull/294.patch
https://github.com/jclouds/jclouds-labs/pull/294.diff
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ignasi Barrera <no...@github.com>.
Pushed to master as [7dd02a01](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/7dd02a01). Thanks @Ladicek! :)
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-232002371
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ignasi Barrera <no...@github.com>.
Closed #294.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#event-719942346
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ladislav Thon <no...@github.com>.
I originally kept that small duplicity in place to make the diff smaller, but I factored the common bit out as you wish :-)
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-231995223
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ignasi Barrera <no...@github.com>.
> @@ -267,6 +267,19 @@ public boolean apply(final OSImage input) {
>
> @Override
> public Deployment getNode(final String id) {
> + final Deployment deployment = api.getDeploymentApiForService(id).get(id);
> + if (deployment != null && !deployment.roleInstanceList().isEmpty()) {
This conditional is the same one than the used below. Refactor this a bit to reuse the code.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294/files/07059cfa9d833aa959771e98a17406d23953d27c#r70401724
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ignasi Barrera <no...@github.com>.
The new approach lgtm. Thanks! @andreaturli do you want to have a look?
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-231981127
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ladislav Thon <no...@github.com>.
OK, I pushed another change.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-231979911
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ladislav Thon <no...@github.com>.
Oh, OK, I'll take a stab at this.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-231969657
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ignasi Barrera <no...@github.com>.
Not exactly, instead of introducing a new configuration property I was thinking about something like:
```java
final Deployment deployment = api.getDeploymentApiForService(id).get(id);
if (deployment == null || deployment.roleInstanceList().isEmpty()) {
// Instead of returning null, call the old logic that lists all cloud services
}
```
Does this make sense?
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-231968496
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ladislav Thon <no...@github.com>.
@nacx I pushed a change where the new behavior has to be enabled explicitly. Is that what you had in mind?
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-231964897
Re: [jclouds/jclouds-labs] [JCLOUDS-1135] improve performance of
AzureComputeServiceAdapter.getNode (#294)
Posted by Ignasi Barrera <no...@github.com>.
Thanks @Ladicek!
To make this backwards compatible and not lose the ability to manage nodes not created by jclouds (this is something we should be able to do), could you default to the old behaviour if the deployment name is not the expected one? This way we would have good performance for nodes created by jclouds, and keep the old behaviour for the rest. WDYT?
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/294#issuecomment-231856484