public class DynamicClusterImpl extends AbstractGroupImpl implements DynamicCluster
DynamicCluster.NodePlacementStrategy, DynamicCluster.ZoneFailureDetectorBrooklynObject.TagSupportConfigurable.ConfigurationSupportStartable.RestartEffectorBody, Startable.StartEffectorBody, Startable.StopEffectorBodyEntityInternal.FeedSupportBrooklynObjectInternal.ConfigurationSupportInternalCHILD_ADDED, CHILD_REMOVED, EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, LOCATION_ADDED, LOCATION_REMOVED, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVEDAVAILABILITY_ZONE_NAMES, CLUSTER, CLUSTER_MEMBER, CUSTOM_CHILD_FLAGS, ENABLE_AVAILABILITY_ZONES, ENTITY_QUARANTINED, FACTORY, FAILED_SUB_LOCATIONS, FIRST_MEMBER_SPEC, INITIAL_QUORUM_SIZE, MEMBER_SPEC, NUM_AVAILABILITY_ZONES, QUARANTINE_FAILED_ENTITIES, QUARANTINE_GROUP, REMOVAL_STRATEGY, RESIZE_BY_DELTA, SERVICE_STATE_ACTUAL, SUB_LOCATIONS, ZONE_FAILURE_DETECTOR, ZONE_PLACEMENT_STRATEGYFIRST, FIRST_MEMBER, GROUP_MEMBERS, MEMBER_DELEGATE_CHILDREN, MEMBER_DELEGATE_NAME_FORMAT, RUNNING_QUORUM_CHECK, UP_QUORUM_CHECKGROUP_SIZE, MEMBER_ADDED, MEMBER_REMOVEDINITIAL_SIZERESTART, SERVICE_UP, START, STOPREPLACE_MEMBER| Constructor and Description |
|---|
DynamicClusterImpl() |
| Modifier and Type | Method and Description |
|---|---|
Entity |
addNode(Location loc,
java.util.Map<?,?> extraFlags) |
void |
init()
Default entity initialization, just calls
AbstractEntity.initEnrichers(). |
boolean |
removeChild(Entity child)
Removes the specified child
Entity; its parent will be set to null. |
java.lang.String |
replaceMember(java.lang.String memberId)
Replaces the entity with the given ID, if it is a member.
|
java.lang.Integer |
resize(java.lang.Integer desiredSize)
Grow or shrink this entity to the desired size.
|
java.util.Collection<Entity> |
resizeByDelta(int delta)
Changes the cluster size by the given number.
|
void |
restart()
Restart the entity.
|
void |
setFactory(EntityFactory<?> factory)
Deprecated.
since 0.7.0; use
setMemberSpec(EntitySpec) |
void |
setMemberSpec(EntitySpec<?> memberSpec) |
void |
setRemovalStrategy(com.google.common.base.Function<java.util.Collection<Entity>,Entity> val) |
void |
setZoneFailureDetector(DynamicCluster.ZoneFailureDetector val) |
void |
setZonePlacementStrategy(DynamicCluster.NodePlacementStrategy val) |
void |
start(java.util.Collection<? extends Location> locsO)
Start the entity in the given collection of locations.
|
void |
stop()
Stop the entity.
|
addMember, addMemberChild, addMemberChild, addMemberInternal, getCurrentSize, getMembers, hasMember, removeMember, setManagementContext, setMembers, setMembersaddChild, addChild, addEnricher, addEnricher, addFeed, addGroup, addLocations, addPolicy, addPolicy, addTag, clearLocations, clearParent, config, configure, configure, configure, configure, configure, containsTag, destroy, emit, emitInternal, equals, feeds, firstLocation, getAllAttributes, getAllConfig, getAllConfigBag, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getConfig, getConfig, getConfig, getConfig, getConfigMap, getConfigRaw, getConfigRaw, getCreationTime, getDisplayName, getEffector, getEnrichers, getEntityType, getExecutionContext, getFeedSupport, getGroups, getIconUrl, getLocalConfigBag, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getTags, hashCode, invalidateReferences, invoke, invoke, invoke, modifyAttribute, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, onManagementStopped, refreshInheritedConfig, removeAllEnrichers, removeAllPolicies, removeAttribute, removeEnricher, removeGroup, removeLocations, removePolicy, removeTag, requestPersist, resetProxy, setAttribute, setAttribute, setAttributeWithoutPublishing, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setDisplayName, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toMetadataRecord, toString, unsubscribe, unsubscribegetCatalogItemId, getId, getTagSupport, rebind, setCatalogItemId, tagssetMembers, setMembersaddChild, addChild, addMember, addMemberChild, addMemberChild, getCurrentSize, getMembers, hasMember, removeMemberaddEnricher, addEnricher, addFeed, addGroup, addPolicy, addPolicy, addTag, clearParent, containsTag, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getConfig, getConfigRaw, getConfigRaw, getCreationTime, getDisplayName, getEnrichers, getEntityType, getGroups, getIconUrl, getId, getLocations, getParent, getPolicies, getTags, invoke, removeEnricher, removeGroup, removePolicy, removeTag, setParentgetCatalogItemId, getTagSupport, tagsconfig, setConfiggetCurrentSizesetCatalogItemIdpublic void init()
AbstractEntityAbstractEntity.initEnrichers().init in class AbstractGroupImplpublic void setRemovalStrategy(com.google.common.base.Function<java.util.Collection<Entity>,Entity> val)
setRemovalStrategy in interface DynamicClusterpublic void setZonePlacementStrategy(DynamicCluster.NodePlacementStrategy val)
setZonePlacementStrategy in interface DynamicClusterpublic void setZoneFailureDetector(DynamicCluster.ZoneFailureDetector val)
setZoneFailureDetector in interface DynamicClusterpublic void setMemberSpec(EntitySpec<?> memberSpec)
setMemberSpec in interface DynamicCluster@Deprecated public void setFactory(EntityFactory<?> factory)
setMemberSpec(EntitySpec)setFactory in interface DynamicClusterpublic void start(java.util.Collection<? extends Location> locsO)
Startable
Some entities may define custom Effector implementations which support
a richer set of parameters. See the entity-specific Startable.START effector declaration.
public void stop()
Startable
Some entities may define custom Effector implementations which support
a richer set of parameters. See the entity-specific Startable.STOP effector declaration.
public void restart()
Startable
Some entities may define custom Effector implementations which support
a richer set of parameters. See the entity-specific Startable.RESTART effector declaration.
public java.lang.Integer resize(java.lang.Integer desiredSize)
Resizablepublic java.lang.String replaceMember(java.lang.String memberId)
First adds a new member, then removes this one.
Note for sub-classes; this method can be called while synchronized on mutex.
replaceMember in interface MemberReplaceablememberId - entity id of a member to be replacedpublic java.util.Collection<Entity> resizeByDelta(int delta)
mutex.resizeByDelta in interface DynamicClusterdelta - number of nodes to add or remove#grow(int)public boolean removeChild(Entity child)
EntityEntity; its parent will be set to null.removeChild in interface EntityremoveChild in class AbstractEntitypublic Entity addNode(Location loc, java.util.Map<?,?> extraFlags)
addNode in interface DynamicCluster