brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [04/23] brooklyn-server git commit: task visibility: better names for config retrieval tasks
Date Fri, 06 Oct 2017 08:06:28 GMT
task visibility: better names for config retrieval tasks


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

Branch: refs/heads/master
Commit: 8ecf3950ac1c158e6cac815c596ae0906439363b
Parents: 4430f76
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Sep 15 11:24:43 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Mon Sep 18 17:10:55 2017 +0100

----------------------------------------------------------------------
 .../core/objs/AbstractConfigurationSupportInternal.java | 12 ++----------
 .../brooklyn/core/objs/BrooklynObjectInternal.java      |  2 ++
 2 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8ecf3950/core/src/main/java/org/apache/brooklyn/core/objs/AbstractConfigurationSupportInternal.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractConfigurationSupportInternal.java
b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractConfigurationSupportInternal.java
index 460c8c4..f67f1f5 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractConfigurationSupportInternal.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractConfigurationSupportInternal.java
@@ -106,8 +106,7 @@ public abstract class AbstractConfigurationSupportInternal implements
BrooklynOb
             }
         };
 
-        // TODO can we remove the DST ?  this is structured so maybe not
-        Task<T> t = Tasks.<T>builder().body(job)
+        Task<T> t = Tasks.<T>builder().dynamic(false).body(job)
                 .displayName("Resolving config "+key.getName())
                 .description("Internal non-blocking structured key resolution")
                 .tag(BrooklynTaskTags.TRANSIENT_TASK_TAG)
@@ -126,20 +125,13 @@ public abstract class AbstractConfigurationSupportInternal implements
BrooklynOb
      * See {@link #getNonBlockingResolvingStructuredKey(ConfigKey)}.
      */
     protected <T> Maybe<T> getNonBlockingResolvingSimple(ConfigKey<T> key)
{
-        // TODO See AbstractConfigMapImpl.getConfigImpl, for how it looks up the "container"
of the
-        // key, so that it gets the right context entity etc.
-
-        // getRaw returns Maybe(val) if the key was explicitly set (where val can be null)
-        // or Absent if the config key was unset.
         Object unresolved = getRaw(key).or(key.getDefaultValue());
-        // TODO add description that we are evaluating this config key to be used if the
code below submits futher tasks
-        // and look at other uses of "description" method
-        // and make sure it is marked transient
         Maybe<Object> resolved = Tasks.resolving(unresolved)
                 .as(Object.class)
                 .immediately(true)
                 .deep(true)
                 .context(getContext())
+                .description("Resolving raw value of simple config "+key)
                 .getMaybe();
         if (resolved.isAbsent()) return Maybe.Absent.<T>castAbsent(resolved);
         

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8ecf3950/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
b/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
index 6ad42f4..972612b 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
@@ -96,7 +96,9 @@ public interface BrooklynObjectInternal extends BrooklynObject, Rebindable
{
         /**
          * Returns the uncoerced value for this config key, if available, not taking any
default.
          * If there is no local value and there is an explicit inherited value, will return
the inherited.
+         * May return a {@link Maybe}-wrapped null if the value is explicitly null.
          * Returns {@link Maybe#absent()} if the key is not explicitly set on this object
or an ancestor.
+         * Often this is used with {@link Maybe#or(Object))} to return default value.
          * <p>
          * See also {@link #getLocalRaw(ConfigKey).
          */


Mime
View raw message