You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2022/07/18 16:07:30 UTC

[brooklyn-server] branch master updated (5db3f2052d -> 1d3662785e)

This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git


    from 5db3f2052d Merge pull request #1342 from iuliana/fix/set-key
     new fea1b60ac9 new test
     new 2eee5eecde children batch to correctly look at members
     new a0bcb2c0f8 don't log on deproxying; there are many valid use cases for this
     new 1d3662785e Merge branch 'master' of https://gitbox.apache.org/repos/asf/brooklyn-server

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../brooklyn/camp/brooklyn/EnrichersYamlTest.java  | 22 +++++++++++++++++++++-
 .../core/effector/util/ChildrenBatchEffector.java  |  7 ++++---
 .../org/apache/brooklyn/core/entity/Entities.java  |  3 ++-
 3 files changed, 27 insertions(+), 5 deletions(-)


[brooklyn-server] 01/04: new test

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit fea1b60ac9ec76435376d7f55bf980e2b3f12d79
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Mon Jul 18 17:03:48 2022 +0100

    new test
    
    saw some weirdness resolving this syntax at root; seems to have gone away, i think my container might have been in a weird state, but something to watch
---
 .../brooklyn/camp/brooklyn/EnrichersYamlTest.java  | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java
index c50ad3c08f..37c04fb571 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java
@@ -283,7 +283,27 @@ public class EnrichersYamlTest extends AbstractYamlTest {
         ((TestEntity)childEntity).sensors().set(TestEntity.NAME, "New Name");
         Asserts.eventually(Entities.attributeSupplier(parentEntity, TestEntity.NAME), Predicates.<String>equalTo("New Name"));
     }
-    
+
+    @Test
+    public void testPropogateChildSensorAtRoot() throws Exception {
+        Entity app = createAndStartApplication(loadYaml("test-entity-basic-template.yaml",
+                "  id: c1",
+                "brooklyn.enrichers:",
+                "  - type: org.apache.brooklyn.enricher.stock.Propagator",
+                "    brooklyn.config:",
+                "      enricher.producer: $brooklyn:component(\"c1\")",
+                "      enricher.propagating.inclusions: [ main.uri ]"));
+        waitForApplicationTasks(app);
+
+        log.info("App started:");
+        Dumper.dumpInfo(app);
+        Assert.assertEquals(app.getChildren().size(), 1);
+        final Entity c1 = app.getChildren().iterator().next();
+        AttributeSensor<String> mainUri = Sensors.newSensor(String.class, "main.uri");
+        c1.sensors().set(mainUri, "http://foo/");
+        EntityAsserts.assertAttributeEqualsEventually(app, mainUri, "http://foo/");
+    }
+
     @Test
     public void testMultipleEnricherReferences() throws Exception {
         final Entity app = createAndStartApplication(loadYaml("test-referencing-enrichers.yaml"));


[brooklyn-server] 04/04: Merge branch 'master' of https://gitbox.apache.org/repos/asf/brooklyn-server

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 1d3662785e5339dacce86d3e13533837388bdc0b
Merge: a0bcb2c0f8 5db3f2052d
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Mon Jul 18 17:06:00 2022 +0100

    Merge branch 'master' of https://gitbox.apache.org/repos/asf/brooklyn-server

 .../brooklyn/tasks/kubectl/ContainerCommons.java   |  5 ++--
 .../brooklyn/tasks/kubectl/ContainerTaskTest.java  | 33 ++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)


[brooklyn-server] 02/04: children batch to correctly look at members

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 2eee5eecded930e55767f6b0d1b2fd8c74b1b832
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Mon Jul 18 17:04:37 2022 +0100

    children batch to correctly look at members
    
    in line with the description of its contract
---
 .../apache/brooklyn/core/effector/util/ChildrenBatchEffector.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/util/ChildrenBatchEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/util/ChildrenBatchEffector.java
index 991e575cba..d103f344b6 100644
--- a/core/src/main/java/org/apache/brooklyn/core/effector/util/ChildrenBatchEffector.java
+++ b/core/src/main/java/org/apache/brooklyn/core/effector/util/ChildrenBatchEffector.java
@@ -20,6 +20,7 @@ package org.apache.brooklyn.core.effector.util;
 
 import org.apache.brooklyn.api.effector.Effector;
 import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.Group;
 import org.apache.brooklyn.api.mgmt.Task;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.config.ConfigKeys;
@@ -44,7 +45,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * Effector to  invoking an effector across children or members,
+ * Effector to invoke an effector across children (or, in the case of a Group, members)
  */
 public class ChildrenBatchEffector extends AddEffectorInitializerAbstract {
     public static final Effector<Object> EFFECTOR = Effectors.effector(Object.class, "childrenBatchEffector").
@@ -56,7 +57,7 @@ public class ChildrenBatchEffector extends AddEffectorInitializerAbstract {
             .build();
     public static final ConfigKey<Integer> BATCH_SIZE = ConfigKeys.builder(Integer.class)
             .name("batchSize")
-            .description("Supply a limit to the number of elements replaced at a time; 0 (default) means no limit")
+            .description("Supply a limit to the number of children updated at a time; 0 (default) means no limit, 1 means do them sequentially")
             .defaultValue(0)
             .build();
     public static final ConfigKey<String> EFFECTOR_TO_INVOKE = ConfigKeys.builder(String.class)
@@ -137,7 +138,7 @@ public class ChildrenBatchEffector extends AddEffectorInitializerAbstract {
             final boolean failOnEffectorFailure = params.get(FAIL_ON_EFFECTOR_FAILURE);
 
             List<Task<?>> activeTasks = MutableList.of();
-            List<Entity> items = MutableList.copyOf(entity().getChildren());
+            List<Entity> items = MutableList.copyOf(entity() instanceof Group ? ((Group)entity()).getMembers() : entity().getChildren());
             int initialSize = items.size();
             int count = 0;
 


[brooklyn-server] 03/04: don't log on deproxying; there are many valid use cases for this

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit a0bcb2c0f890d36948b6a35e1514f80dae5ec919
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Mon Jul 18 17:05:08 2022 +0100

    don't log on deproxying; there are many valid use cases for this
---
 core/src/main/java/org/apache/brooklyn/core/entity/Entities.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java b/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
index dfc0402514..7550881b9d 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
@@ -832,7 +832,8 @@ public class Entities {
     @Beta @VisibleForTesting
     public static AbstractEntity deproxy(Entity e) {
         if (!(Proxy.isProxyClass(e.getClass()))) {
-            log.warn("Attempt to deproxy non-proxy "+e, new Throwable("Location of attempt to deproxy non-proxy "+e));
+        // there are a few valid cases where callers might want to deproxy, so don't warn
+//            log.warn("Attempt to deproxy non-proxy "+e, new Throwable("Location of attempt to deproxy non-proxy "+e));
             return (AbstractEntity) e;
         }
         return (AbstractEntity) ((EntityProxyImpl)Proxy.getInvocationHandler(e)).getDelegate();