You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by iyovcheva <gi...@git.apache.org> on 2016/10/07 05:36:21 UTC

[GitHub] brooklyn-server pull request #373: Attach configurable effector to SoftwareP...

GitHub user iyovcheva opened a pull request:

    https://github.com/apache/brooklyn-server/pull/373

    Attach configurable effector to SoftwareProcess for AWS

    Attaches an effector set in SoftwareProcess .BROOKLYN_LOCATION_EXTRA_HDD_EFFECTOR if the key is configured.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/iyovcheva/brooklyn-server software-attach-effector

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/373.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #373
    
----
commit 814b7d1779022813c13d83abd684c80a98d3ea72
Author: Ivana Yovcheva <iv...@gmail.com>
Date:   2016-10-06T17:45:39Z

    Attach configurable effector to SoftwareProcess for AWS

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #373: Attach configurable effector to SoftwareProcess ...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/373
  
    This looks like a very specific use case. Can you use `AddEffector` instead?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #373: Attach configurable effector to SoftwareP...

Posted by iyovcheva <gi...@git.apache.org>.
Github user iyovcheva commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/373#discussion_r82384694
  
    --- Diff: software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java ---
    @@ -268,6 +272,36 @@ protected void onUpdated() {
          * Called before driver.start; guarantees the driver will exist, and locations will have been set.
          */
         protected void preStart() {
    +        if (!getLocations().isEmpty() && getLocations().iterator().next() instanceof JcloudsMachineLocation) {
    +            JcloudsMachineLocation location = (JcloudsMachineLocation) getLocations().iterator().next();
    +            if (location.getParent().getProvider().equals("aws-ec2")
    --- End diff --
    
    @aledsage @neykov I agree. Will close the PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #373: Attach configurable effector to SoftwareP...

Posted by iyovcheva <gi...@git.apache.org>.
Github user iyovcheva closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/373


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #373: Attach configurable effector to SoftwareP...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/373#discussion_r82358926
  
    --- Diff: software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java ---
    @@ -268,6 +272,36 @@ protected void onUpdated() {
          * Called before driver.start; guarantees the driver will exist, and locations will have been set.
          */
         protected void preStart() {
    +        if (!getLocations().isEmpty() && getLocations().iterator().next() instanceof JcloudsMachineLocation) {
    +            JcloudsMachineLocation location = (JcloudsMachineLocation) getLocations().iterator().next();
    +            if (location.getParent().getProvider().equals("aws-ec2")
    --- End diff --
    
    @iyovcheva I agree with @neykov - this looks like a very specific use-case. It's a code-smell when we have cloud-specific code (e.g. checking for "aws-ec2"), particularly in generic entities like this.
    
    Also, because the `EffectorBody` class is instantiated reflectively (with classname supplied via the config key), this code really isn't doing anything specific about "extra HDD" other than wiring in a given class to be an effector with that name.
    
    We should be able to use a "mixin". We can use `AddEffector`, which is an `EntityInitializer`, which people can optionally include.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---