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 2014/09/09 12:21:35 UTC

[1/4] git commit: fix check brooklyn.properties when ACL are present

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 8e505a50e -> e8d8a723b


fix check brooklyn.properties when ACL are present


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

Branch: refs/heads/master
Commit: 516f53e8296e5ca3ef16961d5debe62b1a53a493
Parents: dd7339e
Author: Andrea Turli <an...@gmail.com>
Authored: Mon Sep 8 11:17:40 2014 +0200
Committer: Andrea Turli <an...@gmail.com>
Committed: Mon Sep 8 11:17:54 2014 +0200

----------------------------------------------------------------------
 .../launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/516f53e8/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
index 024e825..3e7bbb2 100644
--- a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
+++ b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
@@ -579,7 +579,7 @@ public class BrooklynLauncher {
         if (permission.isAbsent()) {
             LOG.debug("Could not determine permissions of file; assuming ok: "+f);
         } else {
-            if (!permission.get().substring(4).equals("------")) {
+            if (!permission.get().subSequence(4, 10).equals("------")) {
                 throw new FatalRuntimeException("Invalid permissions for file "+file+"; expected ?00 but was "+permission.get());
             }
         }


[3/4] git commit: This closes #150

Posted by he...@apache.org.
This closes #150


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

Branch: refs/heads/master
Commit: ec2b5aa5e0ef5b0d8edebb18081258a0237aa4f8
Parents: 8e505a5 de6b110
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Tue Sep 9 11:20:26 2014 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Tue Sep 9 11:20:26 2014 +0100

----------------------------------------------------------------------
 .../brooklynnode/BrooklynEntityMirrorImpl.java  | 40 ++++++++++++++++----
 1 file changed, 33 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[4/4] git commit: This closes #152

Posted by he...@apache.org.
This closes #152


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

Branch: refs/heads/master
Commit: e8d8a723b1dfb8ec8a5e96562a34197701fb358b
Parents: ec2b5aa 516f53e
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Tue Sep 9 11:20:53 2014 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Tue Sep 9 11:20:53 2014 +0100

----------------------------------------------------------------------
 .../launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[2/4] git commit: Start mirroring remote entities asynchronously.

Posted by he...@apache.org.
Start mirroring remote entities asynchronously.

The MIRRORED_ENTITY_URL could be a task instead of a plain property which could block on an attempt to access it. Instead of potentially blocking .init() create a task to start the mirroring as soon as the property is accessible.


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

Branch: refs/heads/master
Commit: de6b11090794a7f2963d9637d1dac2b7cb9f1601
Parents: 3213671
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Fri Sep 5 22:12:42 2014 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Mon Sep 8 14:50:18 2014 +0300

----------------------------------------------------------------------
 .../brooklynnode/BrooklynEntityMirrorImpl.java  | 40 ++++++++++++++++----
 1 file changed, 33 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/de6b1109/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
index 504a408..fb87f39 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
@@ -20,6 +20,7 @@ package brooklyn.entity.brooklynnode;
 
 import java.net.URI;
 import java.util.Map;
+import java.util.concurrent.Callable;
 
 import javax.annotation.Nullable;
 
@@ -33,6 +34,8 @@ import brooklyn.entity.basic.Attributes;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.Entities;
 import brooklyn.entity.basic.EntityFunctions;
+import brooklyn.entity.basic.Lifecycle;
+import brooklyn.entity.basic.ServiceStateLogic;
 import brooklyn.entity.effector.EffectorBody;
 import brooklyn.event.basic.Sensors;
 import brooklyn.event.feed.http.HttpFeed;
@@ -47,6 +50,7 @@ import brooklyn.util.http.HttpTool.HttpClientBuilder;
 import brooklyn.util.http.HttpToolResponse;
 import brooklyn.util.net.Urls;
 import brooklyn.util.stream.Streams;
+import brooklyn.util.task.DynamicTasks;
 import brooklyn.util.task.Tasks;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -70,10 +74,34 @@ public class BrooklynEntityMirrorImpl extends AbstractEntity implements Brooklyn
     @Override
     public void init() {
         super.init();
-        connectSensors();
+        connectSensorsAsync();
+
+        //start spinning, could take some time before MIRRORED_ENTITY_URL is available for first time mirroring
+        setAttribute(Attributes.SERVICE_STATE_ACTUAL, Lifecycle.STARTING);
     }
 
-    protected void connectSensors() {
+    protected void connectSensorsAsync() {
+        Callable<Void> asyncTask = new Callable<Void>() {
+            @Override
+            public Void call() throws Exception {
+                //blocks until available (could be a task)
+                String mirroredEntityUrl = getConfig(MIRRORED_ENTITY_URL);
+                Preconditions.checkNotNull(mirroredEntityUrl, "Required config: "+MIRRORED_ENTITY_URL);
+
+                connectSensors(mirroredEntityUrl);
+                return null;
+            }
+        };
+
+        DynamicTasks.queueIfPossible(
+                Tasks.<Void>builder()
+                    .description("Start entity mirror feed")
+                    .body(asyncTask)
+                    .build())
+            .orSubmitAsync(this);
+    }
+
+    protected void connectSensors(String mirroredEntityUrl) {
         Function<HttpToolResponse, Void> mirrorSensors = new Function<HttpToolResponse,Void>() {
             @SuppressWarnings("rawtypes")
             @Override
@@ -85,11 +113,9 @@ public class BrooklynEntityMirrorImpl extends AbstractEntity implements Brooklyn
                 return null;
             }
         };
-        
-        String sensorsUri = Urls.mergePaths(
-            Preconditions.checkNotNull(getConfig(MIRRORED_ENTITY_URL), "Required config: "+MIRRORED_ENTITY_URL),
-            "sensors/current-state");
-        
+
+        String sensorsUri = Urls.mergePaths(mirroredEntityUrl, "sensors/current-state");
+
         mirror = HttpFeed.builder().entity(this)
             .baseUri(sensorsUri)
             .credentialsIfNotNull(getConfig(BrooklynNode.MANAGEMENT_USER), getConfig(BrooklynNode.MANAGEMENT_PASSWORD))