You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2015/09/21 18:06:23 UTC

[1/3] incubator-brooklyn git commit: Fix UpdatingMap for if suppressDuplicates=true

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 3082169da -> 6aefffd59


Fix UpdatingMap for if suppressDuplicates=true

- log.warn to say it should not be set.
- reset config to suppressDuplicates=false


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

Branch: refs/heads/master
Commit: 66d17a4f112b2e30948ba20ecf710a7213562692
Parents: 3b5b235
Author: Aled Sage <al...@gmail.com>
Authored: Sat Sep 19 15:52:21 2015 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Sep 21 14:31:51 2015 +0100

----------------------------------------------------------------------
 .../brooklyn/enricher/stock/UpdatingMap.java    | 23 ++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/66d17a4f/core/src/main/java/org/apache/brooklyn/enricher/stock/UpdatingMap.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/UpdatingMap.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/UpdatingMap.java
index b09b6d6..e4828cb 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/UpdatingMap.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/UpdatingMap.java
@@ -87,11 +87,30 @@ public class UpdatingMap<S,TKey,TVal> extends AbstractEnricher implements Sensor
 
     public UpdatingMap(Map<Object, Object> flags) {
         super(flags);
+    }
+
+    @Override
+    public void init() {
+        super.init();
+        
         // this always suppresses duplicates, but it updates the same map *in place* so the usual suppress duplicates logic should not be applied
         // TODO clean up so that we have synchronization guarantees and can inspect the item to see whether it has changed
-        suppressDuplicates = false;
+        if (Boolean.TRUE.equals(getConfig(SUPPRESS_DUPLICATES))) {
+            LOG.warn("suppress-duplicates must not be set on "+this+" because map is updated in-place; unsetting config; will always implicitly suppress duplicates");
+            config().set(SUPPRESS_DUPLICATES, (Boolean)null);
+        }
     }
-
+    
+    @Override
+    protected <T> void doReconfigureConfig(ConfigKey<T> key, T val) {
+        if (key.getName().equals(SUPPRESS_DUPLICATES.getName())) {
+            if (Boolean.TRUE.equals(val)) {
+                throw new UnsupportedOperationException("suppress-duplicates must not be set on "+this+" because map is updated in-place; will always implicitly suppress duplicates");
+            }
+        }
+        super.doReconfigureConfig(key, val);
+    }
+    
     @SuppressWarnings({ "unchecked", "rawtypes" })
     @Override
     public void setEntity(EntityLocal entity) {


[2/3] incubator-brooklyn git commit: Fix jboss7 serviceUp

Posted by al...@apache.org.
Fix jboss7 serviceUp

Previously, serviceUp was never set to true, for two reasons:

1. because connectServiceUpIsRunning was not called, nothing was 
   unsetting the service-not-up-indicator for SERVICE_PROCESS_IS_RUNNING

2. because the service-not-up-indicator for MANAGEMENT_URL_UP said
   suppressDuplicates=true, then it checked if the map was equal to
   the “old” map before publishing. But the map was the same object,
   and that object had been modified in-place. So the object was 
   always equal to itself. It therefore never did an emit(), so the
   enricher that listened to it to set serviceUp never fired.


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

Branch: refs/heads/master
Commit: 3b5b235f4b5d5ba71eb69722001b21d9f8e30260
Parents: 10c6576
Author: Aled Sage <al...@gmail.com>
Authored: Sat Sep 19 15:41:05 2015 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Sep 21 14:31:51 2015 +0100

----------------------------------------------------------------------
 .../org/apache/brooklyn/entity/webapp/jboss/JBoss7ServerImpl.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3b5b235f/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/jboss/JBoss7ServerImpl.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/jboss/JBoss7ServerImpl.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/jboss/JBoss7ServerImpl.java
index 09f09c1..51e624d 100644
--- a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/jboss/JBoss7ServerImpl.java
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/jboss/JBoss7ServerImpl.java
@@ -126,10 +126,11 @@ public class JBoss7ServerImpl extends JavaWebAppSoftwareProcessImpl implements J
     }
     
     protected void connectServiceUp() {
+        connectServiceUpIsRunning();
+        
         addEnricher(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS)
             .from(MANAGEMENT_URL_UP)
             .computing(Functionals.ifNotEquals(true).value("Management URL not reachable") )
-            .suppressDuplicates(true)
             .build());
     }
     


[3/3] incubator-brooklyn git commit: This closes #908

Posted by al...@apache.org.
This closes #908


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

Branch: refs/heads/master
Commit: 6aefffd59c9d547a89ca797a1aff634fe209ee93
Parents: 3082169 66d17a4
Author: Aled Sage <al...@gmail.com>
Authored: Mon Sep 21 17:06:11 2015 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Sep 21 17:06:11 2015 +0100

----------------------------------------------------------------------
 .../brooklyn/enricher/stock/UpdatingMap.java    | 23 ++++++++++++++++++--
 .../entity/webapp/jboss/JBoss7ServerImpl.java   |  3 ++-
 2 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/6aefffd5/core/src/main/java/org/apache/brooklyn/enricher/stock/UpdatingMap.java
----------------------------------------------------------------------