Tabnine Logo
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair

Best Java code snippets using org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair (Showing top 20 results out of 315)

origin: apache/hive

final AtomicReference<AllocationConfiguration> allocConf = new AtomicReference<AllocationConfiguration>();
AllocationFileLoaderService allocsLoader = new AllocationFileLoaderService();
allocsLoader.init(conf);
allocsLoader.setReloadListener(new AllocationFileLoaderService.Listener() {
 @Override
 public void onReload(AllocationConfiguration allocs) {
 allocsLoader.reloadAllocations();
} catch (Exception ex) {
 throw new IOException("Failed to load queue allocations", ex);
 allocConf.set(new AllocationConfiguration(conf));
QueuePlacementPolicy queuePolicy = allocConf.get().getPlacementPolicy();
if (queuePolicy != null) {
 requestedQueue = queuePolicy.assignAppToQueue(requestedQueue, userName);
 if (StringUtils.isNotBlank(requestedQueue)) {
  LOG.debug("Setting queue name to " + requestedQueue + " for user "
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void recomputeShares() {
 policy.computeShares(childQueues, getFairShare());
 for (FSQueue childQueue : childQueues) {
  childQueue.getMetrics().setFairShare(childQueue.getFairShare());
  childQueue.recomputeShares();
 }
}
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

 private String handleMoveToPlanQueue(String targetQueueName) {
  FSQueue dest = queueMgr.getQueue(targetQueueName);
  if (dest != null && allocConf.isReservable(dest.getQueueName())) {
   // use the default child reservation queue of the plan
   targetQueueName = getDefaultQueueForPlanQueue(targetQueueName);
  }
  return targetQueueName;
 }
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent) {
 this.name = name;
 this.scheduler = scheduler;
 this.metrics = FSQueueMetrics.forQueue(getName(), parent, true, scheduler.getConf());
 metrics.setMinShare(getMinShare());
 metrics.setMaxShare(getMaxShare());
 this.parent = parent;
}

origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public void recomputeSteadyShares() {
 policy.computeSteadyShares(childQueues, getSteadyFairShare());
 for (FSQueue childQueue : childQueues) {
  childQueue.getMetrics().setSteadyFairShare(childQueue.getSteadyFairShare());
  if (childQueue instanceof FSParentQueue) {
   ((FSParentQueue) childQueue).recomputeSteadyShares();
  }
 }
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Helper method to check if the queue should preempt containers
 *
 * @return true if check passes (can preempt) or false otherwise
 */
private boolean preemptContainerPreCheck() {
 return parent.getPolicy().checkIfUsageOverFairShare(getResourceUsage(),
   getFairShare());
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
protected Resource getPlanQueueCapacity(String planQueueName) {
 return fairScheduler.getQueueManager().getParentQueue(planQueueName, false)
   .getSteadyFairShare();
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private void removeApp(FSAppAttempt app) {
 app.getQueue().removeApp(app);
 maxAppsEnforcer.untrackRunnableApp(app);
 maxAppsEnforcer.updateRunnabilityOnAppRemoval(app, app.getQueue());
}

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

 @Override
 public void onReload(AllocationConfiguration queueInfo) {
  // Commit the reload; also create any queue defined in the alloc file
  // if it does not already exist, so it can be displayed on the web UI.
  synchronized (FairScheduler.this) {
   allocConf = queueInfo;
   allocConf.getDefaultSchedulingPolicy().initialize(clusterResource);
   queueMgr.updateAllocationConfiguration(allocConf);
   maxRunningEnforcer.updateRunnabilityOnReload();
  }
 }
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Helper method that checks if {@code usage} is strictly less than
 * {@code share}.
 */
private boolean isUsageBelowShare(Resource usage, Resource share) {
 return getQueue().getPolicy().getResourceCalculator().compare(
   scheduler.getClusterResource(), usage, share, true) < 0;
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private boolean isReservable(Resource capacity) {
 // Reserve only when the app is starved and the requested container size
 // is larger than the configured threshold
 return isStarved() &&
   scheduler.isAtLeastReservationThreshold(
     getQueue().getPolicy().getResourceCalculator(), capacity);
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

protected void throwPolicyDoesnotApplyException(SchedulingPolicy policy)
  throws AllocationConfigurationException {
 throw new AllocationConfigurationException("SchedulingPolicy " + policy
   + " does not apply to queue " + getName());
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void setPolicy(SchedulingPolicy policy)
  throws AllocationConfigurationException {
 if (!SchedulingPolicy.isApplicableTo(policy, SchedulingPolicy.DEPTH_LEAF)) {
  throwPolicyDoesnotApplyException(policy);
 }
 super.policy = policy;
}

origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void setPolicy(SchedulingPolicy policy)
  throws AllocationConfigurationException {
 boolean allowed =
   SchedulingPolicy.isApplicableTo(policy, (parent == null)
     ? SchedulingPolicy.DEPTH_ROOT
     : SchedulingPolicy.DEPTH_INTERMEDIATE);
 if (!allowed) {
  throwPolicyDoesnotApplyException(policy);
 }
 super.policy = policy;
}

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

public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent) {
 this.name = name;
 this.scheduler = scheduler;
 this.metrics = FSQueueMetrics.forQueue(getName(), parent, true, scheduler.getConf());
 metrics.setMinShare(getMinShare());
 metrics.setMaxShare(getMaxShare());
 this.parent = parent;
}

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

@Override
public void recomputeShares() {
 policy.computeShares(childQueues, getFairShare());
 for (FSQueue childQueue : childQueues) {
  childQueue.getMetrics().setFairShare(childQueue.getFairShare());
  childQueue.recomputeShares();
 }
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private String handleMoveToPlanQueue(String targetQueueName) {
 FSQueue dest = queueMgr.getQueue(targetQueueName);
 if (dest != null && allocConf.isReservable(dest.getQueueName())) {
  // use the default child reservation queue of the plan
  targetQueueName = getDefaultQueueForPlanQueue(targetQueueName);
 }
 return targetQueueName;
}
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

/**
 * Helper method to check if the queue should preempt containers
 *
 * @return true if check passes (can preempt) or false otherwise
 */
private boolean preemptContainerPreCheck() {
 return parent.getPolicy().checkIfUsageOverFairShare(getResourceUsage(),
   getFairShare());
}
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

@Override
protected Resource getPlanQueueCapacity(String planQueueName) {
 return fairScheduler.getQueueManager().getParentQueue(planQueueName, false)
   .getSteadyFairShare();
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

 private String handleMoveToPlanQueue(String targetQueueName) {
  FSQueue dest = queueMgr.getQueue(targetQueueName);
  if (dest != null && allocConf.isReservable(dest.getQueueName())) {
   // use the default child reservation queue of the plan
   targetQueueName = getDefaultQueueForPlanQueue(targetQueueName);
  }
  return targetQueueName;
 }
}
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair

Most used classes

  • AllocationConfiguration
  • AllocationFileLoaderService
  • QueuePlacementPolicy
  • FSAppAttempt
    Represents an application attempt from the viewpoint of the Fair Scheduler.
  • FSQueue
  • QueueManager,
  • FSLeafQueue,
  • FSOpDurations,
  • FSParentQueue,
  • FSQueueMetrics,
  • FSQueueType,
  • FairSchedulerConfiguration,
  • MaxRunningAppsEnforcer$MultiListStartTimeIterator,
  • MaxRunningAppsEnforcer,
  • QueuePlacementRule$Default,
  • QueuePlacementRule$PrimaryGroup,
  • QueuePlacementRule$SecondaryGroupExistingQueue,
  • QueuePlacementRule$Specified,
  • QueuePlacementRule$User
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