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 2014/11/03 16:51:57 UTC

[13/29] git commit: increase the brooklyn node poll frequency to every 2s, to prevent saturating it with monitoring, and other minor tunings to BrooklynNode

increase the brooklyn node poll frequency to every 2s, to prevent saturating it with monitoring, and other minor tunings to BrooklynNode


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

Branch: refs/heads/master
Commit: d94ed9a9e555d771ed0868a7fa78c78bd0fdfee4
Parents: 38c79ad
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sun Oct 26 17:41:30 2014 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Oct 31 09:38:20 2014 -0500

----------------------------------------------------------------------
 .../brooklyn/entity/brooklynnode/BrooklynNode.java     | 13 ++++++++++---
 .../brooklyn/entity/brooklynnode/BrooklynNodeImpl.java |  3 ++-
 usage/cli/src/main/java/brooklyn/cli/Main.java         |  6 ++----
 3 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d94ed9a9/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNode.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNode.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNode.java
index e125971..a0f0032 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNode.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNode.java
@@ -221,14 +221,21 @@ public interface BrooklynNode extends SoftwareProcess, UsesJava {
             "brooklynnode.webconsole.portMapper", "Function for mapping private to public ports, for use in inferring the brooklyn URI", Functions.<Integer>identity());
 
     public static final AttributeSensor<URI> WEB_CONSOLE_URI = new BasicAttributeSensor<URI>(
-        URI.class, "brooklynnode.webconsole.url", "URL of the brooklyn web-console");
+            URI.class, "brooklynnode.webconsole.url", "URL of the brooklyn web-console");
 
     public static final AttributeSensor<ManagementNodeState> MANAGEMENT_NODE_STATE = new BasicAttributeSensor<ManagementNodeState>(
-        ManagementNodeState.class, "brooklynnode.ha.state", "High-availability state of the management node (MASTER, HOT_STANDBY, etc)");
+            ManagementNodeState.class, "brooklynnode.ha.state", "High-availability state of the management node (MASTER, HOT_STANDBY, etc)");
+    
+    public static final ConfigKey<Duration> POLL_PERIOD = ConfigKeys.newConfigKey(Duration.class, "brooklynnode.poll_period",
+            "Frequency to poll for client sensors", Duration.seconds(2));
 
+    @Deprecated
+    /** @deprecated since 0.7.0  this flag is being replaced with the stopWhichAppsOnShutdown flag; 
+     * if truly needed that could be represented here, but in general the hope is to remove all such complexity, 
+     * so the better way if you really do need this is to use {@link #EXTRA_LAUNCH_PARAMETERS} */
     @SetFromFlag("noShutdownOnExit")
     public static final ConfigKey<Boolean> NO_SHUTDOWN_ON_EXIT = ConfigKeys.newBooleanConfigKey("brooklynnode.noshutdownonexit", 
-        "Whether to shutdown entities on exit", false);
+        "Whether to pass the (deprecated) noShutdownOnExit flag to the process", false);
 
     public interface DeployBlueprintEffector {
         ConfigKey<Map<String,Object>> BLUEPRINT_CAMP_PLAN = new MapConfigKey<Object>(Object.class, "blueprintPlan",

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d94ed9a9/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
index 946d3fd..fac22ee 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
@@ -355,7 +355,7 @@ public class BrooklynNodeImpl extends SoftwareProcessImpl implements BrooklynNod
         if (webConsoleUri != null) {
             httpFeed = HttpFeed.builder()
                     .entity(this)
-                    .period(200)
+                    .period(getConfig(POLL_PERIOD))
                     .baseUri(webConsoleUri)
                     .credentialsIfNotNull(getConfig(MANAGEMENT_USER), getConfig(MANAGEMENT_PASSWORD))
                     .poll(new HttpPollConfig<Boolean>(WEB_CONSOLE_ACCESSIBLE)
@@ -365,6 +365,7 @@ public class BrooklynNodeImpl extends SoftwareProcessImpl implements BrooklynNod
                             .suburl("/v1/server/ha/state")
                             .onSuccess(Functionals.chain(Functionals.chain(HttpValueFunctions.jsonContents(), JsonFunctions.cast(String.class)), Enums.fromStringFunction(ManagementNodeState.class)))
                             .setOnFailureOrException(null))
+                    // TODO sensors for load, size, etc
                     .build();
 
             if (!Lifecycle.RUNNING.equals(getAttribute(SERVICE_STATE_ACTUAL))) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d94ed9a9/usage/cli/src/main/java/brooklyn/cli/Main.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/java/brooklyn/cli/Main.java b/usage/cli/src/main/java/brooklyn/cli/Main.java
index f3b9de1..00bf407 100644
--- a/usage/cli/src/main/java/brooklyn/cli/Main.java
+++ b/usage/cli/src/main/java/brooklyn/cli/Main.java
@@ -19,8 +19,6 @@
 package brooklyn.cli;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-
-import brooklyn.management.ha.OsgiManager;
 import groovy.lang.GroovyClassLoader;
 import groovy.lang.GroovyShell;
 import io.airlift.command.Cli;
@@ -66,7 +64,7 @@ import brooklyn.launcher.BrooklynServerDetails;
 import brooklyn.launcher.config.StopWhichAppsOnShutdown;
 import brooklyn.management.ManagementContext;
 import brooklyn.management.ha.HighAvailabilityMode;
-import brooklyn.mementos.BrooklynMementoRawData;
+import brooklyn.management.ha.OsgiManager;
 import brooklyn.rest.security.PasswordHasher;
 import brooklyn.util.ResourceUtils;
 import brooklyn.util.exceptions.Exceptions;
@@ -813,9 +811,9 @@ public class Main extends AbstractMain {
 
     /** method intended for overriding when a different {@link Cli} is desired,
      * or when the subclass wishes to change any of the arguments */
+    @SuppressWarnings("unchecked")
     @Override
     protected CliBuilder<BrooklynCommand> cliBuilder() {
-        @SuppressWarnings({ "unchecked" })
         CliBuilder<BrooklynCommand> builder = Cli.<BrooklynCommand>builder(cliScriptName())
                 .withDescription("Brooklyn Management Service")
                 .withDefaultCommand(InfoCommand.class)