public class DynamicClusterImpl extends AbstractGroupImpl implements DynamicCluster
Modifier and Type | Class and Description |
---|---|
static class |
DynamicClusterImpl.DefaultRemovalStrategy |
AbstractEntity.BasicConfigurationSupport, AbstractEntity.BasicEnricherSupport, AbstractEntity.BasicGroupSupport, AbstractEntity.BasicPolicySupport, AbstractEntity.BasicSensorSupport, AbstractEntity.BasicSubscriptionSupport
DynamicCluster.NodePlacementStrategy, DynamicCluster.ZoneFailureDetector
Entity.AdjunctSupport<T extends EntityAdjunct>, Entity.EnricherSupport, Entity.GroupSupport, Entity.PolicySupport, Entity.SensorSupport
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
Startable.RestartEffectorBody, Startable.StartEffectorBody, Startable.StopEffectorBody
Resizable.InsufficientCapacityException
EntityInternal.EnricherSupportInternal, EntityInternal.EntitySubscriptionSupportInternal, EntityInternal.FeedSupport, EntityInternal.GroupSupportInternal, EntityInternal.PolicySupportInternal, EntityInternal.SensorSupportInternal
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal
APPLICATION_ID, CATALOG_ID, CHILD_ADDED, CHILD_REMOVED, CONFIG_KEY_ADDED, CONFIG_KEY_REMOVED, DEFAULT_DISPLAY_NAME, EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, ENTITY_ID, GROUP_ADDED, GROUP_REMOVED, LOCATION_ADDED, LOCATION_REMOVED, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED
AVAILABILITY_ZONE_NAMES, CLUSTER, CLUSTER_MEMBER, CLUSTER_MEMBER_ID, CLUSTER_ONE_AND_ALL_MEMBERS_UP, CUSTOM_CHILD_FLAGS, ENABLE_AVAILABILITY_ZONES, ENTITY_QUARANTINED, FAILED_SUB_LOCATIONS, FIRST_MEMBER_SPEC, INITIAL_QUORUM_SIZE, MAX_CONCURRENT_CHILD_COMMANDS, MAX_SIZE, MEMBER_SPEC, NUM_AVAILABILITY_ZONES, QUARANTINE_FAILED_ENTITIES, QUARANTINE_FILTER, QUARANTINE_GROUP, REMOVAL_STRATEGY, RESIZE_BY_DELTA, RESTART_MODE, SERVICE_STATE_ACTUAL, START_TIMEOUT, SUB_LOCATIONS, ZONE_FAILURE_DETECTOR, ZONE_PLACEMENT_STRATEGY
FIRST, GROUP_MEMBERS, MEMBER_DELEGATE_CHILDREN, MEMBER_DELEGATE_NAME_FORMAT, RUNNING_QUORUM_CHECK, UP_QUORUM_CHECK
GROUP_SIZE, MEMBER_ADDED, MEMBER_REMOVED
INITIAL_SIZE
RESTART, SERVICE_UP, START, STOP
REPLACE_MEMBER
Constructor and Description |
---|
DynamicClusterImpl() |
Modifier and Type | Method and Description |
---|---|
Entity |
addNode(Location loc,
java.util.Map<?,?> extraFlags) |
void |
init()
Default entity initialization sets ID sensors and calls
AbstractEntity.initEnrichers() . |
void |
rebind()
Called by framework on rebind (in new-style instances):
after configuring, but
before the instance is managed, and
before adjuncts are attached to entities, and
before a reference to an object is shared.
|
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 |
setMemberSpec(EntitySpec<?> memberSpec) |
void |
setRemovalStrategy(<any> 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, setMembers
addChild, addChild, addFeed, addLocations, addLocationsWithoutPublishing, clearLocations, clearParent, config, configure, configure, destroy, enrichers, equals, feeds, firstLocation, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getConfig, getCreationTime, getDisplayName, getEffector, getEntityType, getExecutionContext, getIconUrl, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getParent, getProxy, getProxyIfAvailable, getRebindSupport, groups, hashCode, invalidateReferences, invoke, invoke, invoke, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, onManagementStopped, policies, relations, removeLocations, requestPersist, resetProxy, sensors, setConfigEvenIfOwned, setConfigEvenIfOwned, setDisplayName, setParent, setProxy, subscriptions, toMetadataRecord, toString
addSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId, tags
getFirst, setMembers, setMembers
addChild, addChild, addMember, addMemberChild, addMemberChild, getCurrentSize, getMembers, hasMember, removeMember
addFeed, clearParent, enrichers, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getCreationTime, getDisplayName, getEntityType, getIconUrl, getId, getLocations, getParent, groups, invoke, policies, relations, sensors, setDisplayName, setParent
getCatalogItemId, getCatalogItemIdSearchPath, subscriptions, tags
config, getConfig
getCurrentSize
addSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId
public void init()
AbstractEntity
AbstractEntity.initEnrichers()
.init
in class AbstractGroupImpl
public void rebind()
AbstractBrooklynObject
AbstractBrooklynObject.init()
will not be called on rebind.
If you need to intercept behaviour after adjuncts are attached,
consider AbstractEntity.onManagementStarting()
(but probably worth raising a discussion on the mailing list!)
rebind
in class AbstractBrooklynObject
public void setRemovalStrategy(<any> val)
setRemovalStrategy
in interface DynamicCluster
public void setZonePlacementStrategy(DynamicCluster.NodePlacementStrategy val)
setZonePlacementStrategy
in interface DynamicCluster
public void setZoneFailureDetector(DynamicCluster.ZoneFailureDetector val)
setZoneFailureDetector
in interface DynamicCluster
public void setMemberSpec(EntitySpec<?> memberSpec)
setMemberSpec
in interface DynamicCluster
public 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)
Resizable
public 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 MemberReplaceable
memberId
- entity id of a member to be replacedpublic java.util.Collection<Entity> resizeByDelta(int delta)
mutex
.resizeByDelta
in interface DynamicCluster
delta
- number of nodes to add or remove#grow(int)
public boolean removeChild(Entity child)
Entity
Entity
; its parent will be set to null.removeChild
in interface Entity
removeChild
in class AbstractEntity
public Entity addNode(@Nullable Location loc, java.util.Map<?,?> extraFlags)
addNode
in interface DynamicCluster