Repository: brooklyn-server
Updated Branches:
  refs/heads/master e7cd82357 -> 280d0ce05


Deletes FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE

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

Branch: refs/heads/master
Commit: 4189cae62d9773998fd751926ff28f9b765a6ac7
Parents: fe6e370
Author: Aled Sage <[email protected]>
Authored: Mon May 29 13:15:23 2017 +0100
Committer: Aled Sage <[email protected]>
Committed: Mon May 29 13:15:23 2017 +0100

----------------------------------------------------------------------
 .../core/BrooklynFeatureEnablement.java         |  8 ----
 .../brooklyn/core/entity/AbstractEntity.java    | 49 --------------------
 .../core/location/AbstractLocation.java         | 38 ---------------
 .../entity/group/AbstractGroupImpl.java         | 16 -------
 4 files changed, 111 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4189cae6/core/src/main/java/org/apache/brooklyn/core/BrooklynFeatureEnablement.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/BrooklynFeatureEnablement.java 
b/core/src/main/java/org/apache/brooklyn/core/BrooklynFeatureEnablement.java
index 677640b..fe3609a 100644
--- a/core/src/main/java/org/apache/brooklyn/core/BrooklynFeatureEnablement.java
+++ b/core/src/main/java/org/apache/brooklyn/core/BrooklynFeatureEnablement.java
@@ -70,13 +70,6 @@ public class BrooklynFeatureEnablement {
      * {@link HighAvailabilityMode#STANDBY} */
     public static final String FEATURE_DEFAULT_STANDBY_IS_HOT_PROPERTY = 
FEATURE_PROPERTY_PREFIX+".defaultStandbyIsHot";
     
-    /** whether to attempt to use {@link BrooklynStorage} (datagrid) as a 
backing store for data;
-     * note this is <b>not</b> compatible with {@link 
#FEATURE_DEFAULT_STANDBY_IS_HOT_PROPERTY} 
-     * which uses a blob/file store and a larger-granularity rebind process 
than was intended with the datagrid */
-    /* not sure if we still even need this? now the rebind/read-only feature 
reloads on demand from the persistence store;
-     * the data-grid backing  */
-    public static final String 
FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE = 
FEATURE_PROPERTY_PREFIX+".useBrooklynLiveObjectsDatagridStorage";
-
     /**
      * Renaming threads can really helps with debugging etc; however it's a 
massive performance hit (2x)
      * <p>
@@ -161,7 +154,6 @@ public class BrooklynFeatureEnablement {
         setDefault(FEATURE_BUNDLE_PERSISTENCE_PROPERTY, true);
         setDefault(FEATURE_CATALOG_PERSISTENCE_PROPERTY, true);
         setDefault(FEATURE_DEFAULT_STANDBY_IS_HOT_PROPERTY, false);
-        setDefault(FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE, false);
         setDefault(FEATURE_RENAME_THREADS, false);
         setDefault(FEATURE_JITTER_THREADS, false);
         
setDefault(FEATURE_BACKWARDS_COMPATIBILITY_INFER_CATALOG_ITEM_ON_REBIND, true);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4189cae6/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java 
b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
index ab02285..9935633 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
@@ -95,7 +95,6 @@ import org.apache.brooklyn.core.typereg.RegisteredTypes;
 import org.apache.brooklyn.util.collections.MutableList;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.collections.MutableSet;
-import org.apache.brooklyn.util.collections.SetFromLiveMap;
 import org.apache.brooklyn.util.core.flags.FlagUtils;
 import org.apache.brooklyn.util.core.flags.TypeCoercions;
 import org.apache.brooklyn.util.guava.Maybe;
@@ -511,54 +510,6 @@ public abstract class AbstractEntity extends 
AbstractBrooklynObject implements E
         getManagementSupport().setManagementContext(managementContext);
         entityType.setName(getEntityTypeName());
         if (displayNameAutoGenerated) 
displayName.set(getEntityType().getSimpleName()+":"+Strings.maxlen(getId(), 4));
-
-        if 
(BrooklynFeatureEnablement.isEnabled(BrooklynFeatureEnablement.FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE))
 {
-            Entity oldParent = parent.get();
-            Set<Group> oldGroups = groupsInternal;
-            Set<Entity> oldChildren = children;
-            List<Location> oldLocations = locations.get();
-            EntityConfigMap oldConfig = configsInternal;
-            AttributeMap oldAttribs = attributesInternal;
-            long oldCreationTimeUtc = creationTimeUtc.get();
-            String oldDisplayName = displayName.get();
-
-            parent = 
managementContext.getStorage().getReference(getId()+"-parent");
-            groupsInternal = 
SetFromLiveMap.create(managementContext.getStorage().<Group,Boolean>getMap(getId()+"-groups"));
-            children = 
SetFromLiveMap.create(managementContext.getStorage().<Entity,Boolean>getMap(getId()+"-children"));
-            locations = 
managementContext.getStorage().getNonConcurrentList(getId()+"-locations");
-            creationTimeUtc = 
managementContext.getStorage().getReference(getId()+"-creationTime");
-            displayName = 
managementContext.getStorage().getReference(getId()+"-displayName");
-
-            // Only override stored defaults if we have actual values. We 
might be in setManagementContext
-            // because we are reconstituting an existing entity in a new 
brooklyn management-node (in which
-            // case believe what is already in the storage), or we might be in 
the middle of creating a new 
-            // entity. Normally for a new entity (using EntitySpec creation 
approach), this will get called
-            // before setting the parent etc. However, for backwards 
compatibility we still support some
-            // things calling the entity's constructor directly.
-            if (oldParent != null) parent.set(oldParent);
-            if (oldGroups.size() > 0) groupsInternal.addAll(oldGroups);
-            if (oldChildren.size() > 0) children.addAll(oldChildren);
-            if (oldLocations.size() > 0) 
locations.set(ImmutableList.copyOf(oldLocations));
-            if (creationTimeUtc.isNull()) 
creationTimeUtc.set(oldCreationTimeUtc);
-            if (displayName.isNull()) {
-                displayName.set(oldDisplayName);
-            } else {
-                displayNameAutoGenerated = false;
-            }
-
-            configsInternal = new EntityConfigMap(this, 
managementContext.getStorage().<ConfigKey<?>, Object>getMap(getId()+"-config"));
-            if (!oldConfig.isEmpty()) {
-                
configsInternal.setLocalConfig(oldConfig.getAllConfigLocalRaw());
-            }
-            config().refreshInheritedConfig();
-
-            attributesInternal = new AttributeMap(this, 
managementContext.getStorage().<Collection<String>, 
Object>getMap(getId()+"-attributes"));
-            if (oldAttribs.asRawMap().size() > 0) {
-                for (Map.Entry<Collection<String>,Object> entry : 
oldAttribs.asRawMap().entrySet()) {
-                    attributesInternal.update(entry.getKey(), 
entry.getValue());
-                }
-            }
-        }
     }
 
     /** Where code needs to synch on the attributes, it can access the 
low-level object used for synching

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4189cae6/core/src/main/java/org/apache/brooklyn/core/location/AbstractLocation.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/location/AbstractLocation.java 
b/core/src/main/java/org/apache/brooklyn/core/location/AbstractLocation.java
index d980b34..268d2a4 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/AbstractLocation.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/AbstractLocation.java
@@ -43,7 +43,6 @@ import org.apache.brooklyn.api.sensor.Sensor;
 import org.apache.brooklyn.api.sensor.SensorEventListener;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
-import org.apache.brooklyn.core.BrooklynFeatureEnablement;
 import org.apache.brooklyn.core.config.BasicConfigKey;
 import org.apache.brooklyn.core.config.ConfigConstraints;
 import org.apache.brooklyn.core.config.ConfigKeys;
@@ -62,7 +61,6 @@ import 
org.apache.brooklyn.core.mgmt.internal.SubscriptionTracker;
 import org.apache.brooklyn.core.mgmt.rebind.BasicLocationRebindSupport;
 import org.apache.brooklyn.core.objs.AbstractBrooklynObject;
 import org.apache.brooklyn.core.objs.AbstractConfigurationSupportInternal;
-import org.apache.brooklyn.util.collections.SetFromLiveMap;
 import org.apache.brooklyn.util.core.ClassLoaderUtils;
 import org.apache.brooklyn.util.core.config.ConfigBag;
 import org.apache.brooklyn.util.core.flags.FlagUtils;
@@ -193,42 +191,6 @@ public abstract class AbstractLocation extends 
AbstractBrooklynObject implements
     public void setManagementContext(ManagementContextInternal 
managementContext) {
         super.setManagementContext(managementContext);
         if (displayNameAutoGenerated && getId() != null) 
name.set(getClass().getSimpleName()+":"+getId().substring(0, 
Math.min(getId().length(),4)));
-
-        if 
(BrooklynFeatureEnablement.isEnabled(BrooklynFeatureEnablement.FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE))
 {
-            Location oldParent = parent.get();
-            Set<Location> oldChildren = children;
-            LocationConfigMap oldConfig = configMap;
-            Long oldCreationTimeUtc = creationTimeUtc.get();
-            String oldDisplayName = name.get();
-            HostGeoInfo oldHostGeoInfo = hostGeoInfo.get();
-
-            parent = 
managementContext.getStorage().getReference(getId()+"-parent");
-            children = 
SetFromLiveMap.create(managementContext.getStorage().<Location,Boolean>getMap(getId()+"-children"));
-            creationTimeUtc = 
managementContext.getStorage().getReference(getId()+"-creationTime");
-            hostGeoInfo = 
managementContext.getStorage().getReference(getId()+"-hostGeoInfo");
-            name = 
managementContext.getStorage().getReference(getId()+"-displayName");
-
-            // Only override stored defaults if we have actual values. We 
might be in setManagementContext
-            // because we are reconstituting an existing entity in a new 
brooklyn management-node (in which
-            // case believe what is already in the storage), or we might be in 
the middle of creating a new 
-            // entity. Normally for a new entity (using EntitySpec creation 
approach), this will get called
-            // before setting the parent etc. However, for backwards 
compatibility we still support some
-            // things calling the entity's constructor directly.
-            if (oldParent != null) parent.set(oldParent);
-            if (oldChildren.size() > 0) children.addAll(oldChildren);
-            if (creationTimeUtc.isNull()) 
creationTimeUtc.set(oldCreationTimeUtc);
-            if (hostGeoInfo.isNull()) hostGeoInfo.set(oldHostGeoInfo);
-            if (name.isNull()) {
-                name.set(oldDisplayName);
-            } else {
-                displayNameAutoGenerated = false;
-            }
-
-            configMap = new LocationConfigMap(this, 
managementContext.getStorage().<ConfigKey<?>,Object>getMap(getId()+"-config"));
-            if (!oldConfig.isEmpty()) {
-                configMap.setLocalConfig(oldConfig.getAllConfigLocalRaw());
-            }
-        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4189cae6/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java 
b/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
index f1c1a6f..23fb921 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
@@ -26,14 +26,12 @@ import java.util.Set;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.entity.EntitySpec;
 import org.apache.brooklyn.api.entity.Group;
-import org.apache.brooklyn.core.BrooklynFeatureEnablement;
 import org.apache.brooklyn.core.entity.AbstractEntity;
 import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.entity.EntityInternal;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
 import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.entity.stock.DelegateEntity;
-import org.apache.brooklyn.util.collections.SetFromLiveMap;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,20 +63,6 @@ public abstract class AbstractGroupImpl extends 
AbstractEntity implements Abstra
     @Override
     public void setManagementContext(ManagementContextInternal 
managementContext) {
         super.setManagementContext(managementContext);
-
-        if 
(BrooklynFeatureEnablement.isEnabled(BrooklynFeatureEnablement.FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE))
 {
-            Set<Entity> oldMembers = members;
-            
-            members = 
SetFromLiveMap.create(managementContext.getStorage().<Entity,Boolean>getMap(getId()+"-members"));
-
-            // Only override stored defaults if we have actual values. We 
might be in setManagementContext
-            // because we are reconstituting an existing entity in a new 
brooklyn management-node (in which
-            // case believe what is already in the storage), or we might be in 
the middle of creating a new
-            // entity. Normally for a new entity (using EntitySpec creation 
approach), this will get called
-            // before setting the parent etc. However, for backwards 
compatibility we still support some
-            // things calling the entity's constructor directly.
-            if (oldMembers.size() > 0) members.addAll(oldMembers);
-        }
     }
 
     @Override

Reply via email to