Brooklyn

brooklyn.entity.nosql.mongodb
[Java] Class MongoDBReplicaSetImpl

java.lang.Object
  brooklyn.entity.basic.AbstractEntity
      brooklyn.entity.basic.AbstractGroupImpl
          brooklyn.entity.group.DynamicClusterImpl
              brooklyn.entity.nosql.mongodb.MongoDBReplicaSetImpl
All Implemented Interfaces:
MongoDBReplicaSet

public class MongoDBReplicaSetImpl
extends DynamicClusterImpl

Implementation of MongoDBReplicaSet. Replica sets have a minimum of three members. Removal strategy is always NON_PRIMARY_REMOVAL_STRATEGY.


Field Summary
 
Fields inherited from class DynamicClusterImpl
mutex
 
Fields inherited from class AbstractEntity
EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, managementSupport, tempWorkings
 
Constructor Summary
MongoDBReplicaSetImpl()

 
Method Summary
protected java.util.Map getCustomChildFlags()

Sets MongoDBServer#REPLICA_SET_ENABLED#REPLICA_SET_ENABLED and MongoDBServer#REPLICA_SET_NAME#REPLICA_SET_NAME.

protected EntitySpec getMemberSpec()

MongoDBServer getPrimary()

Function getRemovalStrategy()

@return NON_PRIMARY_REMOVAL_STRATEGY

java.lang.String getReplicaSetName()

java.util.Collection getSecondaries()

java.lang.Integer resize(java.lang.Integer desired)

Ignore attempts to resize the replica set to an even number of entities to avoid having to introduce arbiters.

void start(java.util.Collection locations)

void stop()

 
Methods inherited from class DynamicClusterImpl
addNode, addNode, calculateServiceUp, cleanupFailedNodes, createNode, createNode, discardNode, findSubLocations, getCustomChildFlags, getFactory, getInitialQuorumSize, getMemberSpec, getMembersByLocation, getNonFailedSubLocations, getQuarantineGroup, getRemovalStrategy, getZoneFailureDetector, getZonePlacementStrategy, grow, growByOne, init, isAvailabilityZoneEnabled, isQuarantineEnabled, pickAndRemoveMember, pickAndRemoveMembers, quarantineFailedNodes, removeChild, replaceMember, resize, restart, setFactory, setMemberSpec, setRemovalStrategy, setRemovalStrategy, setZoneFailureDetector, setZonePlacementStrategy, shrink, start, stop, stopAndRemoveNode, waitForTasksOnEntityStart
 
Methods inherited from class AbstractGroupImpl
addMember, getCurrentSize, getMembers, hasMember, init, removeMember, setManagementContext, setMembers, setMembers
 
Methods inherited from class AbstractEntity
addChild, addChild, addEnricher, addGroup, addLocations, addPolicy, clearLocations, clearParent, configure, configure, configure, configure, configure, configure, destroy, emit, emitInternal, equals, finalize, firstLocation, getAllAttributes, getAllConfig, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getConfig, getConfig, getConfig, getConfig, getConfigMap, getCreationTime, getDisplayName, getEffector, getEnrichers, getEntityManager, getEntityType, getEntityTypeName, getExecutionContext, getGroups, getIconUrl, getId, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getSubscriptionTracker, hashCode, init, invalidateReferences, invoke, invoke, invoke, isLegacyConstruction, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, onManagementStopped, refreshInheritedConfig, removeAllEnrichers, removeAllPolicies, removeAttribute, removeChild, removeEnricher, removeLocations, removePolicy, setApplication, setAttribute, setAttribute, setAttributeWithoutPublishing, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setConfigIfValNonNull, setConfigIfValNonNull, setDisplayName, setManagementContext, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toMetadataRecord, toString, toStringHelper, unsubscribe, unsubscribe
 

Constructor Detail

MongoDBReplicaSetImpl

public MongoDBReplicaSetImpl()


 
Method Detail

getCustomChildFlags

.put(MongoDBServer.REPLICA_SET_ENABLED, true)
protected java.util.Map getCustomChildFlags()
Sets MongoDBServer#REPLICA_SET_ENABLED#REPLICA_SET_ENABLED and MongoDBServer#REPLICA_SET_NAME#REPLICA_SET_NAME.


getMemberSpec

protected EntitySpec getMemberSpec()


getPrimary

public MongoDBServer getPrimary()


getRemovalStrategy

public Function getRemovalStrategy()
Returns:
NON_PRIMARY_REMOVAL_STRATEGY


getReplicaSetName

public java.lang.String getReplicaSetName()


getSecondaries

.filter(IS_SECONDARY)
public java.util.Collection getSecondaries()


resize

LOG.info("Ignored request to resize replica set {} to even number of members", getReplicaSetName());
public java.lang.Integer resize(java.lang.Integer desired)
Ignore attempts to resize the replica set to an even number of entities to avoid having to introduce arbiters.
Parameters:
desired - The new size of the entity group. Ignored if even, less than MIN_MEMBERS or more than MAX_MEMBERS.
Returns:
The eventual size of the replica set.
See Also:


start

@Override protected void onEntityRemoved(Entity member) {
public void start(java.util.Collection locations)


stop

public void stop()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.