Search in sources :

Example 1 with SubPolicy

use of com.ms.silverking.cloud.storagepolicy.SubPolicy in project SilverKing by Morgan-Stanley.

the class TopologyRingCreator method _create.

/**
 * Create a new ring that is as similar as possible to the ring passed in so
 * that we minimize the movement of data.
 *
 * @param sourceRing
 *            an immutable SingleRing that may or may not meet the
 *            requirements of the recipe
 * @param recipe
 * @return an immutable SingleRing (returned as a TopologyRing) that meets
 *         the requirements of the recipe
 */
private TopologyRing _create(SingleRing sourceRing, RingTreeRecipe recipe, String ringParentID) {
    // This version ignores the source ring, _create2 takes the source into
    // account
    /*
         * Single StoragePolicy applies. StoragePolicy has primary and secondary
         * SubPolicy Each SubPolicy has multiple SubPolicyMembers
         * 
         * Each SubPolicyMember has a logical ring associated with it - The set
         * of nodes in each of these rings is disjoint with respect to all other
         * ring node sets - Weights must be normalized for each member
         * 
         * Loop structure: For {primary, secondary} For all SubPolicyMembers For
         * all replicas
         */
    Node parent;
    NodeClass nodeClass;
    parent = recipe.topology.getNodeByID(ringParentID);
    nodeClass = parent.getChildNodeClass();
    ProtoRegionList prList;
    prList = ProtoRegionList.createEmpty();
    for (SubPolicy subPolicy : recipe.storagePolicy.getSubPolicies()) {
        prList = allocateSubPolicy(prList, subPolicy, ringParentID, recipe);
    }
    System.out.println("*********************");
    System.out.println(prList);
    return prList.toSingleRing(nodeClass, recipe);
}
Also used : NodeClass(com.ms.silverking.cloud.topology.NodeClass) Node(com.ms.silverking.cloud.topology.Node) GenericNode(com.ms.silverking.cloud.topology.GenericNode) SubPolicy(com.ms.silverking.cloud.storagepolicy.SubPolicy)

Example 2 with SubPolicy

use of com.ms.silverking.cloud.storagepolicy.SubPolicy in project SilverKing by Morgan-Stanley.

the class TopologyRingCreator method _create2.

/**
 * Create a new ring that is as similar as possible to the ring passed in so
 * that we minimize the movement of data.
 *
 * @param sourceRing
 *            an immutable SingleRing that may or may not meet the
 *            requirements of the recipe
 * @param recipe
 * @return an immutable SingleRing (returned as a TopologyRing) that meets
 *         the requirements of the recipe
 */
private TopologyRing _create2(SingleRing sourceRing, RingTreeRecipe recipe, String ringParentID) {
    /*
         * Single StoragePolicy applies. StoragePolicy has primary and secondary
         * SubPolicy Each SubPolicy has multiple SubPolicyMembers
         * 
         * Each SubPolicyMember has a logical ring associated with it - The set
         * of nodes in each of these rings is disjoint with respect to all other
         * ring node sets - Weights must be normalized for each member
         * 
         * Loop structure: For {primary, secondary} For all SubPolicyMembers For
         * all replicas
         */
    Node parent;
    NodeClass nodeClass;
    if (debug) {
        System.out.println("TopologyRingCreator.create2()");
    }
    Preconditions.checkNotNull(sourceRing);
    parent = recipe.topology.getNodeByID(ringParentID);
    nodeClass = parent.getChildNodeClass();
    ProtoRegionList prList;
    prList = ProtoRegionList.createIsomorphic(sourceRing);
    for (SubPolicy subPolicy : recipe.storagePolicy.getSubPolicies()) {
        allocateSubPolicy2(sourceRing, prList, subPolicy, ringParentID, recipe);
    }
    System.out.println("*********************");
    System.out.println(prList);
    return prList.toSingleRing(nodeClass, recipe);
}
Also used : NodeClass(com.ms.silverking.cloud.topology.NodeClass) Node(com.ms.silverking.cloud.topology.Node) GenericNode(com.ms.silverking.cloud.topology.GenericNode) SubPolicy(com.ms.silverking.cloud.storagepolicy.SubPolicy)

Aggregations

SubPolicy (com.ms.silverking.cloud.storagepolicy.SubPolicy)2 GenericNode (com.ms.silverking.cloud.topology.GenericNode)2 Node (com.ms.silverking.cloud.topology.Node)2 NodeClass (com.ms.silverking.cloud.topology.NodeClass)2