You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ge...@apache.org on 2017/02/24 15:18:16 UTC

[5/5] brooklyn-server git commit: Closes #529

Closes #529

ConnectivityResolver

`ConnectivityResolver` is a special customiser used by `JcloudsLocation` to determine the address and credentials with which a location should be contacted. By default it should behave as the previous logic in `JcloudsLocation`, but it exposes options to have Brooklyn prefer to contact VMs on private addresses and can be injected on a per-entity basis. For example:

```yaml
services:
- type: server
  location: the-same-private-network-as-brooklyn
  brooklyn.initializers:
  - type: org.apache.brooklyn.location.jclouds.DefaultConnectivityResolver
    brooklyn.config:
      mode: ONLY_PRIVATE
- type: server
  location: another-cloud
  # implicit use of the default network info customizer.
```

Would result in the first entity being managed on the instance's private address (and deployment failing if this was not possible) and the second being managed on its public address. Graceful fallback is possible by replacing `ONLY_PRIVATE` with `PREFER_PRIVATE`. There are `PUBLIC` variants of each of these.

These changes were prompted by a thread on the Brooklyn mailing list last December: http://markmail.org/thread/xpr6nsyimv7goewy. Some of the items discussed in that thread have been left for future work. It depends on PRs #497 and #524.

~~I'd like opinions on:~~
* ~~naming: "BasicLocationNetworkInfoCustomizer" is cumbersome.~~
* ~~whether the class should extend `BasicJcloudsLocationCustomizer`. I can see it being useful to anyone that wants to subclass BLNIC but at the moment it's totally unused.~~
* ~~whether we should include the `publishNetworks` option right now. It controls the publication of `host.address.{public,private}.n` sensors. The idea is good but the feature feels a bit half-baked right now.~~
* ~~whether `ManagementAddressResolveOptions` is the right way to convey information between the location and the customiser. Again, it's a bit ungainly.~~


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/cddaf4a0
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/cddaf4a0
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/cddaf4a0

Branch: refs/heads/master
Commit: cddaf4a09aec87b863f4a67461a6d2cb96b0b145
Parents: d0755db 3fd64c8
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Fri Feb 24 15:17:52 2017 +0000
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Fri Feb 24 15:17:52 2017 +0000

----------------------------------------------------------------------
 .../location/cloud/CloudLocationConfig.java     |  23 +-
 .../brooklyn/util/core/task/BasicTask.java      |   4 +-
 .../location/jclouds/ConnectivityResolver.java  |  55 +++
 .../jclouds/ConnectivityResolverOptions.java    | 245 ++++++++++
 .../jclouds/DefaultConnectivityResolver.java    | 490 +++++++++++++++++++
 .../location/jclouds/JcloudsLocation.java       | 389 ++++++---------
 .../location/jclouds/JcloudsLocationConfig.java |   4 +
 .../brooklyn/location/jclouds/JcloudsUtil.java  |   1 -
 .../jclouds/ManagementAddressResolveResult.java |  54 ++
 .../jclouds/AbstractJcloudsStubbedLiveTest.java |   3 +-
 ...BasicLocationNetworkInfoInitializerTest.java |  44 ++
 .../DefaultConnectivityResolverTest.java        | 262 ++++++++++
 ...dsByonLocationResolverStubbedRebindTest.java |   2 +
 .../JcloudsReachableAddressStubbedTest.java     |  69 ++-
 .../MachineLifecycleEffectorTasks.java          |  16 +-
 .../brooklyn/entity/AbstractEc2LiveTest.java    |  17 -
 .../util/net/ReachableSocketFinder.java         |  91 +---
 .../util/net/ReachableSocketFinderTest.java     |  34 --
 18 files changed, 1437 insertions(+), 366 deletions(-)
----------------------------------------------------------------------