public class ServerPoolImpl extends DynamicClusterImpl implements ServerPool
ServerPoolLocation. The location can be looked up from the
LocationRegistry (e.g. mgmt.getLocationRegistry().resolve("my-pool-name")),
which uses the ServerPoolLocationResolver.
Each location delegates to the associated ServerPool to claim machines (which are
provisioned as required), and to release machines back to the pool.
This differs from Clocker's use of DynamicLocation in that the ServerPool has multiple
locations. This makes the use of LocationOwner a little confusing
(e.g. LocationOwner.DYNAMIC_LOCATION is not set).| Modifier and Type | Class and Description |
|---|---|
static class |
ServerPoolImpl.MemberTrackingPolicy |
AbstractEntity.BasicConfigurationSupport, AbstractEntity.BasicEnricherSupport, AbstractEntity.BasicGroupSupport, AbstractEntity.BasicPolicySupport, AbstractEntity.BasicSensorSupport, AbstractEntity.BasicSubscriptionSupportDynamicCluster.NodePlacementStrategy, DynamicCluster.ZoneFailureDetectorEntity.AdjunctSupport<T extends EntityAdjunct>, Entity.EnricherSupport, Entity.GroupSupport, Entity.PolicySupport, Entity.SensorSupportBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupportStartable.RestartEffectorBody, Startable.StartEffectorBody, Startable.StopEffectorBodyResizable.InsufficientCapacityExceptionEntityInternal.EnricherSupportInternal, EntityInternal.FeedSupport, EntityInternal.GroupSupportInternal, EntityInternal.PolicySupportInternal, EntityInternal.SensorSupportInternalBrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal| Modifier and Type | Field and Description |
|---|---|
static AttributeSensor<java.util.Map<Entity,MachineLocation>> |
ENTITY_MACHINE
Accesses must be synchronised by mutex
|
static AttributeSensor<java.util.Map<MachineLocation,Entity>> |
MACHINE_ENTITY |
static ConfigKey<java.lang.Boolean> |
REMOVABLE |
CHILD_ADDED, CHILD_REMOVED, CONFIG_KEY_ADDED, CONFIG_KEY_REMOVED, EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, GROUP_ADDED, GROUP_REMOVED, LOCATION_ADDED, LOCATION_REMOVED, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVEDADD_MACHINES_FROM_SPEC, AVAILABLE_COUNT, CLAIMED_COUNT, INITIAL_SIZE, LOCATION_NAME_PREFIX, MEMBER_SPECAVAILABILITY_ZONE_NAMES, CLUSTER, CLUSTER_MEMBER, CLUSTER_MEMBER_ID, CLUSTER_ONE_AND_ALL_MEMBERS_UP, CUSTOM_CHILD_FLAGS, ENABLE_AVAILABILITY_ZONES, ENTITY_QUARANTINED, FACTORY, FAILED_SUB_LOCATIONS, FIRST_MEMBER_SPEC, INITIAL_QUORUM_SIZE, NUM_AVAILABILITY_ZONES, QUARANTINE_FAILED_ENTITIES, QUARANTINE_FILTER, QUARANTINE_GROUP, REMOVAL_STRATEGY, RESIZE_BY_DELTA, RESTART_MODE, 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_REMOVEDRESTART, SERVICE_UP, START, STOPREPLACE_MEMBERDYNAMIC_LOCATION, DYNAMIC_LOCATION_STATUS, LOCATION_FLAGS, LOCATION_NAME, LOCATION_NAME_SUFFIX, LOCATION_SPEC| Constructor and Description |
|---|
ServerPoolImpl() |
| Modifier and Type | Method and Description |
|---|---|
Entity |
addExistingMachine(MachineLocation machine)
Sets the pool to use an existing
MachineLocation as a member. |
java.util.Collection<Entity> |
addExistingMachinesFromSpec(java.lang.String spec)
Adds additional machines to the pool by resolving the given spec.
|
MachineLocation |
claimMachine(java.util.Map<?,?> flags) |
ServerPoolLocation |
createLocation(java.util.Map<java.lang.String,?> flags) |
void |
deleteLocation() |
ServerPoolLocation |
getDynamicLocation() |
|
getRemovalStrategy() |
void |
init()
Default entity initialization, just calls
AbstractEntity.initEnrichers(). |
boolean |
isLocationAvailable() |
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.
|
void |
releaseMachine(MachineLocation machine) |
void |
start(java.util.Collection<? extends Location> locations)
Start the entity in the given collection of locations.
|
void |
stop()
Stop the entity.
|
addNode, removeChild, replaceMember, resize, resizeByDelta, restart, setFactory, setMemberSpec, setRemovalStrategy, setZoneFailureDetector, setZonePlacementStrategyaddMember, addMemberChild, addMemberChild, addMemberInternal, getCurrentSize, getMembers, hasMember, removeMember, setManagementContext, setMembers, setMembersaddChild, addChild, addEnricher, addEnricher, addFeed, addGroup, addLocations, addPolicy, addPolicy, clearLocations, clearParent, config, configure, configure, configure, configure, configure, configure, destroy, emit, emitInternal, enrichers, 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, groups, hashCode, invalidateReferences, invoke, invoke, invoke, modifyAttribute, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, onManagementStopped, policies, refreshInheritedConfig, relations, removeAllEnrichers, removeAllPolicies, removeAttribute, removeEnricher, removeGroup, removeLocations, removePolicy, requestPersist, resetProxy, sensors, setAttribute, setAttribute, setAttributeWithoutPublishing, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setDisplayName, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, subscriptions, toMetadataRecord, toString, unsubscribe, unsubscribegetCatalogItemId, getId, setCatalogItemId, tagsaddNode, resizeByDelta, setFactory, setMemberSpec, setRemovalStrategy, setZoneFailureDetector, setZonePlacementStrategysetMembers, setMembersaddChild, addChild, addMember, addMemberChild, addMemberChild, getCurrentSize, getMembers, hasMember, removeMemberaddEnricher, addEnricher, addFeed, addGroup, addPolicy, addPolicy, clearParent, enrichers, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getConfigRaw, getConfigRaw, getCreationTime, getDisplayName, getEnrichers, getEntityType, getGroups, getIconUrl, getId, getLocations, getParent, getPolicies, groups, invoke, policies, relations, removeChild, removeEnricher, removeGroup, removePolicy, sensors, setDisplayName, setParentgetCatalogItemId, subscriptions, tagsconfig, getConfig, setConfiggetCurrentSize, resizereplaceMembersetCatalogItemIdpublic static final AttributeSensor<java.util.Map<Entity,MachineLocation>> ENTITY_MACHINE
public static final AttributeSensor<java.util.Map<MachineLocation,Entity>> MACHINE_ENTITY
public static final ConfigKey<java.lang.Boolean> REMOVABLE
public void init()
AbstractEntityAbstractEntity.initEnrichers().init in class DynamicClusterImplpublic void start(java.util.Collection<? extends Location> locations)
Startable
Some entities may define custom Effector implementations which support
a richer set of parameters. See the entity-specific Startable.START effector declaration.
start in interface Startablestart in class DynamicClusterImplpublic void rebind()
AbstractBrooklynObjectAbstractBrooklynObject.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 AbstractBrooklynObjectpublic 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.
stop in interface Startablestop in class DynamicClusterImplpublic ServerPoolLocation getDynamicLocation()
getDynamicLocation in interface LocationOwner<ServerPoolLocation,ServerPool>public ServerPoolLocation createLocation(java.util.Map<java.lang.String,?> flags)
createLocation in interface LocationOwner<ServerPoolLocation,ServerPool>public void deleteLocation()
deleteLocation in interface LocationOwner<ServerPoolLocation,ServerPool>public boolean isLocationAvailable()
isLocationAvailable in interface LocationOwner<ServerPoolLocation,ServerPool>public MachineLocation claimMachine(java.util.Map<?,?> flags) throws NoMachinesAvailableException
claimMachine in interface ServerPoolNoMachinesAvailableExceptionpublic void releaseMachine(MachineLocation machine)
releaseMachine in interface ServerPoolpublic Entity addExistingMachine(MachineLocation machine)
ServerPoolMachineLocation as a member. Existing locations
will count towards the capacity of the pool but will not be terminated when the pool is
stopped.addExistingMachine in interface ServerPoolmachine - An existing machine.ServerPool.MEMBER_SPEC.public java.util.Collection<Entity> addExistingMachinesFromSpec(java.lang.String spec)
ServerPooladdExistingMachinesFromSpec in interface ServerPoolspec - A location spec, e.g. byon:(hosts="user@10.9.1.1,user@10.9.1.2,user@10.9.1.3")ServerPool.MEMBER_SPEC.publicgetRemovalStrategy()