You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2015/04/22 13:51:47 UTC

[GitHub] incubator-brooklyn pull request: Coerce aggregated sensor values

GitHub user neykov opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/609

    Coerce aggregated sensor values

    Also ignore SERVICE_UP failures from non-RUNNING children. Avoids setting the parent on fire while spinning up a child. /cc @ahgittin as he was the initial contributor of the SERVICE_UP quorum logic.

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

    $ git pull https://github.com/neykov/incubator-brooklyn sensor-aggregator-coerce

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

    https://github.com/apache/incubator-brooklyn/pull/609.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 #609
    
----
commit 2a6d9fd566f90a4fb8e6f67815d9e50f7bb78e63
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2015-04-21T14:10:16Z

    Coerce aggregated values, might be coming from string sources
    
    Caller code expects values to be in the sensor type, coerce the values before returning them. String values could be inserted - for example from BrooklynEntityMirror.

commit bc8eb2664a2170c7e1ebd797e7ba48dda492039d
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2015-04-22T11:41:32Z

    Ignore non-RUNNING children in SERVICE_UP quorum calculation

----


---
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] incubator-brooklyn pull request: Coerce aggregated sensor values

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

    https://github.com/apache/incubator-brooklyn/pull/609#issuecomment-95596861
  
    Looks really good.
    
    Am a tiny bit concerned about us ignoring entity's serviceUp when serviceState is null (as that is a change in behaviour for a situation where the expected behaviour is unclear. However, on balance I'm fine with this.
    
    Merging.


---
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] incubator-brooklyn pull request: Coerce aggregated sensor values

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

    https://github.com/apache/incubator-brooklyn/pull/609#discussion_r28964691
  
    --- Diff: core/src/test/java/brooklyn/entity/basic/ServiceStateLogicTest.java ---
    @@ -240,7 +254,33 @@ public void testManuallySettingIndicatorsOnApplications() throws Exception {
             assertAttributeEquals(entity, Attributes.SERVICE_UP, true);
             assertAttributeEquals(entity, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
         }
    -        
    +
    +    @Test
    +    public void testQuorumWithStringStates() {
    +        final DynamicCluster cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
    +                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(TestEntityWithoutEnrichers.class))
    +                .configure(DynamicCluster.INITIAL_SIZE, 1));
    +
    +        RecordingSensorEventListener r = new RecordingSensorEventListener();
    --- End diff --
    
    Is this listener ever used (beyond registering it)?


---
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] incubator-brooklyn pull request: Coerce aggregated sensor values

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

    https://github.com/apache/incubator-brooklyn/pull/609#discussion_r28964567
  
    --- Diff: core/src/test/java/brooklyn/entity/basic/ServiceStateLogicTest.java ---
    @@ -240,7 +254,33 @@ public void testManuallySettingIndicatorsOnApplications() throws Exception {
             assertAttributeEquals(entity, Attributes.SERVICE_UP, true);
             assertAttributeEquals(entity, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
         }
    -        
    +
    +    @Test
    +    public void testQuorumWithStringStates() {
    +        final DynamicCluster cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
    +                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(TestEntityWithoutEnrichers.class))
    +                .configure(DynamicCluster.INITIAL_SIZE, 1));
    +
    +        RecordingSensorEventListener r = new RecordingSensorEventListener();
    +        app.subscribe(cluster, Attributes.SERVICE_STATE_ACTUAL, r);
    +
    +        cluster.start(ImmutableList.of(new SimulatedLocation()));
    --- End diff --
    
    There is an `app.newSimulatedLocation()`, which uses the `LocationSpec` and `LocationManager` to instantiate the location.


---
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] incubator-brooklyn pull request: Coerce aggregated sensor values

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

    https://github.com/apache/incubator-brooklyn/pull/609


---
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.
---