Tabnine Logo
ProportionalCapacityPreemptionPolicy.computeIdealResourceDistribution
Code IndexAdd Tabnine to your IDE (free)

How to use
computeIdealResourceDistribution
method
in
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy

Best Java code snippets using org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy.computeIdealResourceDistribution (Showing top 2 results out of 315)

origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

/**
 * This method recursively computes the ideal assignment of resources to each
 * level of the hierarchy. This ensures that leafs that are over-capacity but
 * with parents within capacity will not be preempted. Preemptions are allowed
 * within each subtree according to local over/under capacity.
 *
 * @param root the root of the cloned queue hierachy
 * @param totalPreemptionAllowed maximum amount of preemption allowed
 * @return a list of leaf queues updated with preemption targets
 */
private List<TempQueue> recursivelyComputeIdealAssignment(
  TempQueue root, Resource totalPreemptionAllowed) {
 List<TempQueue> leafs = new ArrayList<TempQueue>();
 if (root.getChildren() != null &&
   root.getChildren().size() > 0) {
  // compute ideal distribution at this level
  computeIdealResourceDistribution(rc, root.getChildren(),
    totalPreemptionAllowed, root.idealAssigned);
  // compute recursively for lower levels and build list of leafs
  for(TempQueue t : root.getChildren()) {
   leafs.addAll(recursivelyComputeIdealAssignment(t, totalPreemptionAllowed));
  }
 } else {
  // we are in a leaf nothing to do, just return yourself
  return Collections.singletonList(root);
 }
 return leafs;
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

/**
 * This method recursively computes the ideal assignment of resources to each
 * level of the hierarchy. This ensures that leafs that are over-capacity but
 * with parents within capacity will not be preempted. Preemptions are allowed
 * within each subtree according to local over/under capacity.
 *
 * @param root the root of the cloned queue hierachy
 * @param totalPreemptionAllowed maximum amount of preemption allowed
 * @return a list of leaf queues updated with preemption targets
 */
private List<TempQueue> recursivelyComputeIdealAssignment(
  TempQueue root, Resource totalPreemptionAllowed) {
 List<TempQueue> leafs = new ArrayList<TempQueue>();
 if (root.getChildren() != null &&
   root.getChildren().size() > 0) {
  // compute ideal distribution at this level
  computeIdealResourceDistribution(rc, root.getChildren(),
    totalPreemptionAllowed, root.idealAssigned);
  // compute recursively for lower levels and build list of leafs
  for(TempQueue t : root.getChildren()) {
   leafs.addAll(recursivelyComputeIdealAssignment(t, totalPreemptionAllowed));
  }
 } else {
  // we are in a leaf nothing to do, just return yourself
  return Collections.singletonList(root);
 }
 return leafs;
}
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacityProportionalCapacityPreemptionPolicycomputeIdealResourceDistribution

Javadoc

This method computes (for a single level in the tree, passed as a List) the ideal assignment of resources. This is done recursively to allocate capacity fairly across all queues with pending demands. It terminates when no resources are left to assign, or when all demand is satisfied.

Popular methods of ProportionalCapacityPreemptionPolicy

  • cloneQueues
    This method walks a tree of CSQueue and clones the portion of the state relevant for preemption in T
  • containerBasedPreemptOrKill
    This method selects and tracks containers to be preemptionCandidates. If a container is in the targe
  • init
  • logToCSV
  • sortContainers
    Compare by reversed priority order first, and then reversed containerId order
  • <init>
  • computeFixpointAllocation
    Given a set of queues compute the fix-point distribution of unassigned resources among them. As pend
  • editSchedule
  • getContainersToPreempt
    Based a resource preemption target drop reservations of containers and if necessary select container
  • getMostUnderservedQueues
  • getNonLabeledResources
    This method returns all non labeled resources.
  • getResourceCalculator
  • getNonLabeledResources,
  • getResourceCalculator,
  • isLabeledContainer,
  • preemptAMContainers,
  • preemptFrom,
  • recursivelyComputeIdealAssignment,
  • resetCapacity,
  • setNodeLabels,
  • addTempQueuePartition

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now