org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationFileLoaderService类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationFileLoaderService类的一些代码示例,展示了AllocationFileLoaderService类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AllocationFileLoaderService类的具体详情如下:
包路径:org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationFileLoaderService
类名称:AllocationFileLoaderService

AllocationFileLoaderService介绍

暂无

代码示例

代码示例来源: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);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

allocsLoader.init(conf);
allocsLoader.setReloadListener(new AllocationReloadListener());
 allocsLoader.reloadAllocations();
} catch (Exception e) {
 throw new IOException("Failed to initialize FairScheduler", e);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test (expected = UnsupportedFileSystemException.class)
public void testDenyGetAllocationFileFromUnsupportedFileSystem()
  throws UnsupportedFileSystemException {
 Configuration conf = new YarnConfiguration();
 conf.set(FairSchedulerConfiguration.ALLOCATION_FILE, "badfs:///badfile");
 AllocationFileLoaderService allocLoader = new AllocationFileLoaderService();
 allocLoader.getAllocationFile(conf);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

@Override
public void reinitialize(Configuration conf, RMContext rmContext)
  throws IOException {
 try {
  allocsLoader.reloadAllocations();
 } catch (Exception e) {
  LOG.error("Failed to reload allocations file", e);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void serviceInit(Configuration conf) throws Exception {
 this.allocFile = getAllocationFile(conf);
 if (this.allocFile != null) {
  this.fs = allocFile.getFileSystem(conf);
       time > lastModified + ALLOC_RELOAD_WAIT_MS) {
      try {
       reloadAllocations();
      } catch (Exception ex) {
       if (!lastReloadAttemptFailed) {

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public FairScheduler() {
 super(FairScheduler.class.getName());
 clock = new SystemClock();
 allocsLoader = new AllocationFileLoaderService();
 queueMgr = new QueueManager(this);
 maxRunningEnforcer = new MaxRunningAppsEnforcer(this);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

private synchronized void startSchedulerThreads() {
 Preconditions.checkNotNull(updateThread, "updateThread is null");
 Preconditions.checkNotNull(allocsLoader, "allocsLoader is null");
 updateThread.start();
 if (continuousSchedulingEnabled) {
  Preconditions.checkNotNull(schedulingThread, "schedulingThread is null");
  schedulingThread.start();
 }
 allocsLoader.start();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Configuration conf = getConfig();
QueuePlacementPolicy newPlacementPolicy =
  getQueuePlacementPolicy(allocationFileParser, queueProperties, conf);
setupRootQueueProperties(allocationFileParser, queueProperties);
  createReservationQueueConfig(allocationFileParser);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

@Override
public void serviceStop() throws Exception {
 synchronized (this) {
  if (updateThread != null) {
   updateThread.interrupt();
   updateThread.join(THREAD_JOIN_TIMEOUT_MS);
  }
  if (continuousSchedulingEnabled) {
   if (schedulingThread != null) {
    schedulingThread.interrupt();
    schedulingThread.join(THREAD_JOIN_TIMEOUT_MS);
   }
  }
  if (allocsLoader != null) {
   allocsLoader.stop();
  }
 }
 super.serviceStop();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void serviceInit(Configuration conf) throws Exception {
 this.allocFile = getAllocationFile(conf);
 if (allocFile != null) {
  reloadThread = new Thread() {

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

loadQueue(parent, element, minQueueResources, maxQueueResources,
   queueMaxApps, userMaxApps, queueMaxAMShares, queueWeights,
   queuePolicies, minSharePreemptionTimeouts, fairSharePreemptionTimeouts,
Configuration conf = getConfig();
if (placementPolicyElement != null) {
 newPlacementPolicy = QueuePlacementPolicy.fromXml(placementPolicyElement,

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

allocsLoader.init(conf);
allocsLoader.setReloadListener(new AllocationReloadListener());
 allocsLoader.reloadAllocations();
} catch (Exception e) {
 throw new IOException("Failed to initialize FairScheduler", e);

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testGetAllocationFileFromClasspath() {
 Configuration conf = new Configuration();
 conf.set(FairSchedulerConfiguration.ALLOCATION_FILE,
   "test-fair-scheduler.xml");
 AllocationFileLoaderService allocLoader = new AllocationFileLoaderService();
 File allocationFile = allocLoader.getAllocationFile(conf);
 assertEquals("test-fair-scheduler.xml", allocationFile.getName());
 assertTrue(allocationFile.exists());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void reinitialize(Configuration conf, RMContext rmContext)
  throws IOException {
 try {
  allocsLoader.reloadAllocations();
 } catch (Exception e) {
  LOG.error("Failed to reload allocations file", e);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

public FairScheduler() {
 super(FairScheduler.class.getName());
 clock = new SystemClock();
 allocsLoader = new AllocationFileLoaderService();
 queueMgr = new QueueManager(this);
 maxRunningEnforcer = new MaxRunningAppsEnforcer(this);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private synchronized void startSchedulerThreads() {
 Preconditions.checkNotNull(updateThread, "updateThread is null");
 Preconditions.checkNotNull(allocsLoader, "allocsLoader is null");
 updateThread.start();
 if (continuousSchedulingEnabled) {
  Preconditions.checkNotNull(schedulingThread, "schedulingThread is null");
  schedulingThread.start();
 }
 allocsLoader.start();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void serviceStop() throws Exception {
 synchronized (this) {
  if (updateThread != null) {
   updateThread.interrupt();
   updateThread.join(THREAD_JOIN_TIMEOUT_MS);
  }
  if (continuousSchedulingEnabled) {
   if (schedulingThread != null) {
    schedulingThread.interrupt();
    schedulingThread.join(THREAD_JOIN_TIMEOUT_MS);
   }
  }
  if (allocsLoader != null) {
   allocsLoader.stop();
  }
 }
 super.serviceStop();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

@Override
public void serviceInit(Configuration conf) throws Exception {
 this.allocFile = getAllocationFile(conf);
 if (allocFile != null) {
  reloadThread = new Thread() {

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

loadQueue(parent, element, minQueueResources, maxQueueResources,
   queueMaxApps, userMaxApps, queueMaxAMShares, queueWeights,
   queuePolicies, minSharePreemptionTimeouts, fairSharePreemptionTimeouts,
Configuration conf = getConfig();
if (placementPolicyElement != null) {
 newPlacementPolicy = QueuePlacementPolicy.fromXml(placementPolicyElement,

代码示例来源:origin: org.spark-project.hive.shims/hive-shims-scheduler

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);

相关文章