本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler类的典型用法代码示例。如果您正苦于以下问题:Java FifoScheduler类的具体用法?Java FifoScheduler怎么用?Java FifoScheduler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FifoScheduler类属于org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo包,在下文中一共展示了FifoScheduler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureServlets
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected void configureServlets() {
bind(JAXBContextResolver.class);
bind(RMWebServices.class);
bind(GenericExceptionHandler.class);
Configuration rmconf = new Configuration();
rmconf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
rmconf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
rmconf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
rm = new MockRM(rmconf);
bind(ResourceManager.class).toInstance(rm);
if (isKerberosAuth == true) {
filter("/*").through(TestKerberosAuthFilter.class);
} else {
filter("/*").through(TestSimpleAuthFilter.class);
}
serve("/*").with(GuiceContainer.class);
}
示例2: setupAndStartRM
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
private static void setupAndStartRM() throws Exception {
Configuration rmconf = new Configuration();
rmconf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
rmconf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
rmconf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
rmconf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION,
"kerberos");
rmconf.set("yarn.resourcemanager.principal", spnegoPrincipal);
rmconf.set("yarn.resourcemanager.keytab",
spnegoKeytabFile.getAbsolutePath());
rmconf.setBoolean("mockrm.webapp.enabled", true);
UserGroupInformation.setConfiguration(rmconf);
rm = new MockRM(rmconf);
rm.start();
}
示例3: testConfValidation
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Test (timeout = 30000)
public void testConfValidation() throws Exception {
FifoScheduler scheduler = new FifoScheduler();
Configuration conf = new YarnConfiguration();
conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 2048);
conf.setInt(YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, 1024);
try {
scheduler.serviceInit(conf);
fail("Exception is expected because the min memory allocation is" +
" larger than the max memory allocation.");
} catch (YarnRuntimeException e) {
// Exception is expected.
assertTrue("The thrown exception is not the expected one.",
e.getMessage().startsWith(
"Invalid resource scheduler memory"));
}
}
示例4: SchedulerInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
public SchedulerInfo(final ResourceManager rm) {
ResourceScheduler rs = rm.getResourceScheduler();
if (rs instanceof CapacityScheduler) {
this.schedulerName = "Capacity Scheduler";
} else if (rs instanceof FairScheduler) {
this.schedulerName = "Fair Scheduler";
} else if (rs instanceof FifoScheduler) {
this.schedulerName = "Fifo Scheduler";
}
this.minAllocResource = new ResourceInfo(rs.getMinimumResourceCapability());
this.maxAllocResource = new ResourceInfo(rs.getMaximumResourceCapability());
this.schedulingResourceTypes = rs.getSchedulingResourceTypes();
this.maximumClusterPriority =
rs.getMaxClusterLevelAppPriority().getPriority();
}
示例5: setupClass
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
/**
* Sets up this class for use in unit testing. It spins up the YARN mini-cluster and also sets up
* various default classes.
*
* @throws IOException if there's an error accessing the local filesystem
* @throws SQLException if there's an error querying the embedded DB
*/
@BeforeClass
public static void setupClass() throws IOException, SQLException {
conf = new YarnConfiguration();
conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 64);
conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class);
miniCluster = new MiniYARNCluster("test", 1, 1, 1);
miniCluster.init(conf);
miniCluster.start();
conflictHandler = new ObjectConflictHandler();
conflictHandler.setConf(conf);
destinationObjectFactory = new DestinationObjectFactory();
destinationObjectFactory.setConf(conf);
}
示例6: configureServlets
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected void configureServlets() {
bind(JAXBContextResolver.class);
bind(RMWebServices.class);
bind(GenericExceptionHandler.class);
Configuration conf = new Configuration();
conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
rm = new MockRM(conf);
bind(ResourceManager.class).toInstance(rm);
bind(RMContext.class).toInstance(rm.getRMContext());
bind(ApplicationACLsManager.class).toInstance(
rm.getApplicationACLsManager());
bind(QueueACLsManager.class).toInstance(rm.getQueueACLsManager());
serve("/*").with(GuiceContainer.class);
}
示例7: configureServlets
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected void configureServlets() {
bind(JAXBContextResolver.class);
bind(RMWebServices.class);
bind(GenericExceptionHandler.class);
Configuration rmconf = new Configuration();
rmconf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
rmconf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
rmconf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
rm = new MockRM(rmconf);
bind(ResourceManager.class).toInstance(rm);
bind(RMContext.class).toInstance(rm.getRMContext());
bind(ApplicationACLsManager.class).toInstance(
rm.getApplicationACLsManager());
bind(QueueACLsManager.class).toInstance(rm.getQueueACLsManager());
if (isKerberosAuth == true) {
filter("/*").through(TestKerberosAuthFilter.class);
} else {
filter("/*").through(TestSimpleAuthFilter.class);
}
serve("/*").with(GuiceContainer.class);
}
示例8: configureServlets
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected void configureServlets() {
bind(JAXBContextResolver.class);
bind(RMWebServices.class);
bind(GenericExceptionHandler.class);
Configuration conf = new Configuration();
conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
rm = new MockRM(conf);
bind(ResourceManager.class).toInstance(rm);
bind(RMContext.class).toInstance(rm.getRMContext());
bind(ApplicationACLsManager.class).toInstance(
rm.getApplicationACLsManager());
bind(QueueACLsManager.class).toInstance(rm.getQueueACLsManager());
serve("/*").with(GuiceContainer.class);
}
示例9: checkFifoQueue
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
private void checkFifoQueue(SchedulerApplication schedulerApp,
Resource usedResources, Resource availableResources) throws Exception {
FifoScheduler scheduler = (FifoScheduler) rm2.getResourceScheduler();
// ************ check cluster used Resources ********
assertEquals(usedResources, scheduler.getUsedResource());
// ************ check app headroom ****************
SchedulerApplicationAttempt schedulerAttempt =
schedulerApp.getCurrentAppAttempt();
assertEquals(availableResources, schedulerAttempt.getHeadroom());
// ************ check queue metrics ****************
QueueMetrics queueMetrics = scheduler.getRootQueueMetrics();
asserteMetrics(queueMetrics, 1, 0, 1, 0, 2, availableResources.getMemory(),
availableResources.getVirtualCores(), usedResources.getMemory(),
usedResources.getVirtualCores());
}
示例10: configureServlets
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected void configureServlets() {
bind(JAXBContextResolver.class);
bind(RMWebServices.class);
bind(GenericExceptionHandler.class);
Configuration conf = new Configuration();
conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
rm = new MockRM(conf);
bind(ResourceManager.class).toInstance(rm);
bind(RMContext.class).toInstance(rm.getRMContext());
bind(ApplicationACLsManager.class).toInstance(
rm.getApplicationACLsManager());
serve("/*").with(GuiceContainer.class);
}
示例11: testConfValidation
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Test (timeout = 30000)
public void testConfValidation() throws Exception {
ResourceScheduler scheduler = new FifoScheduler();
Configuration conf = new YarnConfiguration();
conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 2048);
conf.setInt(YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, 1024);
try {
scheduler.reinitialize(conf, null);
fail("Exception is expected because the min memory allocation is" +
" larger than the max memory allocation.");
} catch (YarnRuntimeException e) {
// Exception is expected.
assertTrue("The thrown exception is not the expected one.",
e.getMessage().startsWith(
"Invalid resource scheduler memory"));
}
}
示例12: gatherConfigs
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected YarnConfiguration gatherConfigs() {
YarnConfiguration yarnConfigs = new YarnConfiguration(super.gatherConfigs());
yarnConfigs.set("fs.defaultFS", hdfsUnit.getNamenode());
yarnConfigs.set("mapreduce.task.tmp.dir", getTmpDir().toString());
String user = System.getProperty("user.name");
yarnConfigs.set("hadoop.proxyuser." + user + ".hosts", "*");
yarnConfigs.set("hadoop.proxyuser." + user + ".groups", "*");
yarnConfigs.set("yarn.nodemanager.admin-env", "PATH=$PATH:" + cmdUnit.getPath());
try {
host = InetAddress.getLocalHost().getCanonicalHostName().toLowerCase();
} catch (UnknownHostException e) {
LOGGER.warn("Failed to get canonical host name. Using default: " + host);
}
yarnConfigs.set(YarnConfiguration.RM_HOSTNAME, host);
yarnConfigs.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class);
yarnConfigs.addResource("mapred-site.prairie.xml");
yarnConfigs.addResource("yarn-site.prairie.xml");
return yarnConfigs;
}
示例13: configureServlets
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected void configureServlets() {
try {
bind(JAXBContextResolver.class);
bind(RMWebServices.class);
bind(GenericExceptionHandler.class);
Configuration conf = new Configuration();
conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
RMStorageFactory.setConfiguration(conf);
YarnAPIStorageFactory.setConfiguration(conf);
DBUtility.InitializeDB();
rm = new MockRM(conf);
bind(ResourceManager.class).toInstance(rm);
serve("/*").with(GuiceContainer.class);
} catch (IOException ex) {
Logger.getLogger(TestRMWebServices.class.getName()).log(Level.SEVERE, null, ex);
}
}
示例14: configureServlets
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
@Override
protected void configureServlets() {
try {
bind(JAXBContextResolver.class);
bind(RMWebServices.class);
bind(GenericExceptionHandler.class);
Configuration conf = new Configuration();
conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
RMStorageFactory.setConfiguration(conf);
YarnAPIStorageFactory.setConfiguration(conf);
DBUtility.InitializeDB();
rm = new MockRM(conf);
bind(ResourceManager.class).toInstance(rm);
serve("/*").with(GuiceContainer.class);
} catch (IOException ex) {
Logger.getLogger(TestRMWebServicesApps.class.getName()).log(Level.SEVERE, null, ex);
}
}
示例15: setupAndStartRM
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; //导入依赖的package包/类
private static void setupAndStartRM() throws Exception {
Configuration rmconf = new Configuration();
rmconf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
rmconf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
ResourceScheduler.class);
rmconf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
rmconf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION,
"kerberos");
rmconf.set("yarn.resourcemanager.principal", spnegoPrincipal);
rmconf.set("yarn.resourcemanager.keytab",
spnegoKeytabFile.getAbsolutePath());
rmconf.setBoolean("mockrm.webapp.enabled", true);
RMStorageFactory.setConfiguration(rmconf);
YarnAPIStorageFactory.setConfiguration(rmconf);
DBUtility.InitializeDB();
UserGroupInformation.setConfiguration(rmconf);
rm = new MockRM(rmconf);
rm.start();
}