brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject [1/3] brooklyn-server git commit: Add ServiceStateLogic enricher for better child state propagation
Date Sun, 28 Aug 2016 21:20:45 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 9238a1081 -> 50d5beeed


Add ServiceStateLogic enricher for better child state propagation


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

Branch: refs/heads/master
Commit: 724458a7e438f23e6fecb1da34b5f1598edf8faf
Parents: ec3010e
Author: Andrew Donald Kennedy <andrew.kennedy@cloudsoftcorp.com>
Authored: Thu Aug 11 23:56:51 2016 +0100
Committer: Andrew Donald Kennedy <andrew.kennedy@cloudsoftcorp.com>
Committed: Sat Aug 20 17:15:13 2016 +0100

----------------------------------------------------------------------
 .../apache/brooklyn/entity/stock/ConditionalEntityImpl.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/724458a7/core/src/main/java/org/apache/brooklyn/entity/stock/ConditionalEntityImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/entity/stock/ConditionalEntityImpl.java
b/core/src/main/java/org/apache/brooklyn/entity/stock/ConditionalEntityImpl.java
index 054b5b0..ba061f4 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/stock/ConditionalEntityImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/stock/ConditionalEntityImpl.java
@@ -33,10 +33,12 @@ import org.apache.brooklyn.core.entity.BrooklynConfigKeys;
 import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
+import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers;
 import org.apache.brooklyn.core.entity.trait.Startable;
 import org.apache.brooklyn.core.location.Locations;
 import org.apache.brooklyn.enricher.stock.Enrichers;
 import org.apache.brooklyn.util.collections.MutableSet;
+import org.apache.brooklyn.util.collections.QuorumCheck;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.time.Duration;
 
@@ -72,8 +74,11 @@ public class ConditionalEntityImpl extends BasicStartableImpl implements
Conditi
                 child = addChild(EntitySpec.create(spec));
                 sensors().set(CONDITIONAL_ENTITY, child);
 
-                // Add enrichers for sensor propagateion
+                // Add enrichers for sensor propagation
                 enrichers().add(Enrichers.builder().propagating(Startable.SERVICE_UP).from(child).build());
+                enrichers().add(ServiceStateLogic.newEnricherFromChildrenState()
+                        .suppressDuplicates(true)
+                        .configure(ComputeServiceIndicatorsFromChildrenAndMembers.RUNNING_QUORUM_CHECK,
QuorumCheck.QuorumChecks.all()));
                 if (Boolean.TRUE.equals(propagate)) {
                     if (sensors.isEmpty()) {
                         enrichers().add(Enrichers.builder().propagatingAllButUsualAnd().from(child).build());


Mime
View raw message